0

I would like to run simulations on the Linux TCP receive buffer to find out how big my buffer has to be.

Is there any software available to perform such simulation? It would be handy to be able to fill up the buffer to see what happens with my application.

Update: It seems like we are using to big buffers, because we get buffer overruns. Our network is at 1Gbit and ping is only 0,08ms. Our buffer settings look like this:

net.ipv4.icmp_echo_ignore_broadcasts = 1 
net.ipv4.conf.all.rp_filter = 1 
fs.inotify.max_user_watches = 65536 
net.core.rmem_max = 16777216 
net.core.wmem_max = 16777216 
net.core.rmem_default = 1733248 
net.core.wmem_default = 1733248 
net.ipv4.tcp_rmem = 4096 1733248 16777216 
net.ipv4.tcp_wmem = 4096 1733248 16777216 
net.ipv4.tcp_window_scaling = 1 
net.ipv4.tcp_timestamps = 1

1 Answer 1

1

Check this article. It seems to do a good job describing the optimization process, and it has example code (Java and C) to access / change the sizes. There's also a link to a Linux tool to determine optimum size.

This other article show some things you can access using the /proc/sys file system, which is a nice source for real-time info. It shows how to use it using the command line.

4
  • It seems like we are using to big buffers, because we get buffer overruns. Our network is at 1Gbit and ping is only 0,08ms. Our buffer settings look like this. net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.conf.all.rp_filter = 1 fs.inotify.max_user_watches = 65536 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.core.rmem_default = 1733248 net.core.wmem_default = 1733248 net.ipv4.tcp_rmem = 4096 1733248 16777216 net.ipv4.tcp_wmem = 4096 1733248 16777216 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 Jul 16, 2015 at 6:48
  • I've included your actual data into the original question. You should always try to keep relevant data together...
    – jcoppens
    Jul 16, 2015 at 14:34
  • 1
    Calculating with the formula from the first reference, you'd be ok with 0.00008*1e9/9 = 10k buffer. I do find 0.08ms rather spectacular (sure you are not pinging the local network card? :) If you have access to two machines, I'd install pathrate and try it out.
    – jcoppens
    Jul 16, 2015 at 14:46
  • Unfortunately, the server is running Windows XP. The network between the Windows server and the Linux client is 1Gbps and they are located in the same server rack. I noticed also that the RTT was really good and I confirm that it is for a different host and not from localhost. Jul 21, 2015 at 10:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .