4

I did some load test under Ubuntu10.10 with Siege 2.6.9, script I used as follows,
siege -c 900 -r 30 -i -f urls.txt, but I got tons of error messages like

error: socket: unable to connect sock.c:222: Operation already in progress or socket timeout

I noticed most requests' response time are less than 0.2 secs, but after a while, some requests' response time increased to 5 secs, and a pause happened periodically,
So I did some linux kernel tuning jobs, e.g.

sysctl -w net.ipv4.tcp_tw_reuse=1  
sysctl -w net.ipv4.tcp_timestamps=1  
sysctl -w net.ipv4.tcp_tw_recycle=1  

After that, the circumstance became better, but not good enough,
So could you guys could give me more infomation about socket/tcp parameters tuning on
linux kernel parameters, such as recycle/reuse/close the sockets in a TIME_WAIT state.
Any advices or suggestions would be highly appreciated. Many thanks.

1 Answer 1

3

You might want to try lowering net.ipv4.tcp_fin_timeout, which affects how long the sockets hang out in TIME_WAIT. This is already fairly low at 60; try lowering it 10 at a time and see if it improves the situation.

 echo 50 >/proc/sys/net/ipv4/tcp_fin_timeout 

If it works, add it to sysctl.conf:

net.ipv4.tcp_fin_timeout = 50 # or whatever works best

Just keep in mind that, while it helps with load testing, it isn't necessarily a great default for real-world usage.

  • Eric
1
  • @Eric Maybe the problem has nothing to do with socket, it's a matter of load testing tool, I'll do the test again with another tool(e.g. Jmeter or something). Thanks anyway. Jun 2, 2011 at 3:44

You must log in to answer this question.

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