Fedora Linux Support Community & Resources Center
  #1  
Old 18th June 2008, 11:26 PM
rpdumps Offline
Registered User
 
Join Date: May 2007
Posts: 33
how to know socket buffer size of TCP connections dynamically ?

Hello,

From the tcp man pages, pre-allocated maximum buffer size for a TCP connection can be known.

My interest is to know whether there is a method to find what socket size application called for and

kernel response to it ? As it will change dynamically, is it possible to know buffer size for active TCP connections?



Is there command/utility to find these values by giving a TCP socket identifier or any files to look under /proc?

Thanks
Reply With Quote
  #2  
Old 20th June 2008, 04:49 PM
rpdumps Offline
Registered User
 
Join Date: May 2007
Posts: 33
Any suggestions or pointers to docs would be great...

thanks
Reply With Quote
  #3  
Old 21st June 2008, 01:30 AM
rpdumps Offline
Registered User
 
Join Date: May 2007
Posts: 33
found some information on sockets,from /proc/net/sockstat
[user@localhost net]$ cat sockstat
sockets: used 610
TCP: inuse 39 orphan 14 tw 7 alloc 41 mem 12
UDP: inuse 11 mem 0
UDPLITE: inuse 0
RAW: inuse 0
FRAG: inuse 0 memory 0

/proc/net/tcp , the entries next to inode as references to socket and it's memory location for a TCP connection

[user@localhost net]$ cat tcp
sl local_address rem_address st tr tm->when retrnsmt uid timeout inode
3: 0100007F:0277 00000000:0000 0A 00:00000000 00000000 0 0 9037 1 efbde000 3000 0 0 2 -1
4: 0100007F:0019 00000000:0000 0A 00:00000000 00000000 0 0 8630 1 f787ce40 3000 0 0 2 -1

Also if from ==> ll /proc/PID/fd/ .. it has a symbolic link to the port listed in netstat o/p

lrwx------ 1 61 -> socket:[36451]
lrwx------ 1 62 -> socket:[36452]
lrwx------ 1 63 -> socket:[34854]
lrwx------ 1 64 -> socket:[34851]

[user@localhost fd]$ sudo netstat -tpn
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address PID/Program name
tcp 1 0 192.168.1.101:34854 xxxx:80 4904/npviewer.bin
tcp 1 0 192.168.1.101:34851 xxxx:80 4904/npviewer.bin

Any info or docs to understand above o/ps would be helpful ....
Reply With Quote
  #4  
Old 21st June 2008, 04:13 PM
duncan Offline
Registered User
 
Join Date: Feb 2004
Location: Florida (central)
Age: 64
Posts: 87
Try this:

#Add the following to /etc/sysctl.conf, and then run "sysctl -p"
## increase Linux TCP buffer limits
net.core.rmem_max = 8388608
net.core.wmem_max = 8388608
net.core.rmem_default = 65536
net.core.wmem_default = 65536
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack =1
net.ipv4.tcp_window_scaling = 1
# increase Linux autotuning TCP buffer limits
net.ipv4.tcp_rmem = 4096 87380 8388608
net.ipv4.tcp_wmem = 4096 65536 8388608
net.ipv4.tcp_mem = 8388608 8388608 8388608
Reply With Quote
  #5  
Old 21st June 2008, 04:25 PM
rpdumps Offline
Registered User
 
Join Date: May 2007
Posts: 33
Thanks but I am not trying to increase buffer size...

I want to know whether socket statistics like application requested,, actual allocation, current allocation etc for a given active TCP connection can be determined or not.
Reply With Quote
Reply

Tags
buffer, connections, dynamically, size, socket, tcp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 9 64-bit socket buffer size fedora001 Servers & Networking 0 25th November 2008 05:26 PM
How do I increase sound buffer size? larka06 Using Fedora 0 13th November 2006 08:26 PM
Talk daemon and Socket operation on non-socket Br0kan Using Fedora 3 1st March 2006 07:29 PM
CPU dynamically scaling laptop FC4 missing_myself Hardware & Laptops 5 20th June 2005 12:52 PM
max tcp connections and socket numbers on fedora3 cweng Servers & Networking 1 9th April 2005 10:40 AM


Current GMT-time: 14:47 (Tuesday, 29-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat