I have website that gets higher tcp timeouts at peak times and slows down bit, here are few stat graphs

enter image description here

sysctl config atm:

net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

Any idea what I should change/add to config?

  • TCP timeouts may not be caused by a kernel issue. More likely it is something with the application taking too long and causing connections to be abandoned. You might look at the number of open file handles, that is often a limiting factor on Redhat/CentOS systems. Can you offer more details about the applications and any complaints from users? – mfarver Aug 24 '10 at 23:18
up vote 1 down vote accepted

My first guess is that you're seeing your network receive buffers fill up, in which case you might want to increase them with the sys.net.core.netdev_max_backlog sysctl.

You might be seeing a lot of dropped connections in TIME_WAIT, in which case you might want to drop the timeout with net.ipv4.vs.timeout_timewait.

Both of these should be identifiable with netstat.

Your application's socket buffers might be too small, too; you can bump them up with the net.core.rmem_max, net.core.wmem_max, and net.ipv4.tcp_rmem and net.ipv4.tcp_wmem. This is probably not the case, though, but if you're getting a lot of traffic you might find increasing these socket buffer queue sizes helps you handle the traffic.

Remember to measure before and after you change each value. I recommend googling for them to understand their behaviour so you can better apply them to your use case.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.