I was tweaking one of our linux web servers and started messing around with tuning TCP and got a little confused.
I had been monitoring (netstat- ant) our tcp connections and would roughly see about an average of 620 connections. Usually about 450-500ish were in the TIME_WAIT state. I have read a few times that reusing and enabling fast recycling of the TW sockets improves performance. Enabling reuse and recycling definitely reduce the number of total number of sockets I have but don't see how that can improve performance. After I changed the kernel settings (sysctl -w net.ipv4.tcp_tw_reuse=1 & sysctl -w net.ipv4.tcp_tw_recycle=1) I am seeing about a 150 connections (netstat -ant|wc) and about an average of 55 stuck in the TIME_WAIT socket.
Since the TIME_WAIT socket is the state after the server's FIN and user's last ACK what performance can this give. Doesn't this just give me the possibility of handling more connections? Since the socket is suppose to stay in TIME_WAIT for twice the Maximum Segment Lifetime or 240secs, what does setting the reuse and recycling end up setting the 2MSL time to? Zero? Couldn't this mean that the user might not get all the data they requested or their data could be mixed up with another request?
Sorry for all the questions but my head hurts trying to figure this out and see if this is actually improving my TCP performance.
Thanks,
Nick -- This is just my Beta Sig. Testers Wanted.
I had been monitoring (netstat- ant) our tcp connections and would roughly see about an average of 620 connections. Usually about 450-500ish were in the TIME_WAIT state. I have read a few times that reusing and enabling fast recycling of the TW sockets improves performance. Enabling reuse and recycling definitely reduce the number of total number of sockets I have but don't see how that can improve performance. After I changed the kernel settings (sysctl -w net.ipv4.tcp_tw_reuse=1 & sysctl -w net.ipv4.tcp_tw_recycle=1) I am seeing about a 150 connections (netstat -ant|wc) and about an average of 55 stuck in the TIME_WAIT socket.
Since the TIME_WAIT socket is the state after the server's FIN and user's last ACK what performance can this give. Doesn't this just give me the possibility of handling more connections? Since the socket is suppose to stay in TIME_WAIT for twice the Maximum Segment Lifetime or 240secs, what does setting the reuse and recycling end up setting the 2MSL time to? Zero? Couldn't this mean that the user might not get all the data they requested or their data could be mixed up with another request?
Sorry for all the questions but my head hurts trying to figure this out and see if this is actually improving my TCP performance.
Thanks,
Nick -- This is just my Beta Sig. Testers Wanted.