I'm wondering if there's any way to find the tcp so_sndbuf of an actively running process (such as apache or nginx). I know that tcp_wmem sets the default value, but I'm not sure if the server programs I'm working with set their own.
My purpose for this is that I'm trying to set the Initial Window (IW) (see this link for why) for tcp connections. I looked at this paper from google, and they recommend changing your tcp_wmem default value to MSS*IW. I'm worried, however, that programs might be setting their own so_sndbuf instead of using tcp_wmem, so I want to double check.
I'm using linux kernel 2.6.18-194.26.1.el5 (CentOS).
I don't know about interrogating a currently running process, but you may be able to answer your question by running a program under the control of
strace
, the system call trace utility. For example:This will yield output like this:
You could also use the magic of function interposition to override the
setsockopt()
functional call (and, for example, print out the value associated with theSO_SNDBUF
option), but this is probably not worth the effort.