How to fix the error “TCP: time wait bucket table overflow” ?

How to fix the error “TCP: time wait bucket table overflow” ?

I was getting the following error in the “/var/log/messages” on my webserver.

 

This used to happen when the traffic on the server increased beyond 20k qps.

After googling for sometime, i found reason for this. This error was due to increased number of TIME_WAIT connections on the server. You can find more details of TIME_WAIT connections here

In order to fix this, i had to enable the following kernel parameters

On a Centos Machine, you can do this by adding following lines in the /etc/sysctl.conf

Now run the following command , to load the changes we made

Now you can verify the values by

As you can see both “ipv4.tcp_tw_recycle” and “ipv4.tcp_tw_reuse”  set to 1 now. I never seen those errors after making the above changes.

 

Leave a Reply

Your email address will not be published. Required fields are marked *