Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
up vote 1 down vote accepted

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:

# strace -f -e trace=setsockopt /path/to/program

This will yield output like this:

setsockopt(3, SOL_SOCKET, SO_SNDBUF, [98304], 4) = 0

You could also use the magic of function interposition to override the setsockopt() functional call (and, for example, print out the value associated with the SO_SNDBUF option), but this is probably not worth the effort.

share|improve this answer
Awesome! This works great, thanks! strace is pretty cool.... – Mediocre Gopher Jun 24 '11 at 14:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.