I was doing some performance testing for Apache using ab. Apache in our case is only working as a load balancer balancing load between two Liferay servers.

Initially, I did the testing for 1000 requests with 100 concurrent requests. The tests went fine.

But when I perform the tests for 500 concurrent users with 1000 requests, the tests were failing.

$ ab -c 500 -n 1000 http://103.X.X.X/web/guest/statistics 
This is ApacheBench, Version 2.3 <$Revision: 655654 $> 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 
Licensed to The Apache Software Foundation,   

Benchmarking  (be patient)

Completed 100 requests
Completed 200 requests
Completed 300 requests

apr_socket_recv: Connection timed out (110)

Total of 386 requests completed

Can see the following message in Kernel.

May 13 14:21:15 www kernel: possible SYN flooding on port 80. Sending cookies.

I tried increasing the value for the following two parameters , but the tests were still failing and same error can be seen in system log file.

# echo "1024" > /proc/sys/net/core/somaxconn 
# echo "2048" > /proc/sys/net/ipv4/tcp_max_syn_backlog 

We have a campaign coming up where we are expecting large numbers of hits to our server. Since the tests were failing, we are somewhat worried whether our server will be able to take up the load. We are expecting around 500-700 concurrent requests for one single day during the campaign.

Kindly suggest how to improve our server performance to take the load.

  • FWIW, ab is a pretty weak tool if you're doing anything more than trivial load testing. I'm not even sure I'd recommend anyone actually ever use it for its intended purpose. I would look into something like Apache jMeter to generate your load and collect the data from jMeter and the sar report on the server to determine performance characteristics. – Bratchley May 13 '13 at 12:53
  • Also, as Pascal suggested, we need to know more about your architecture and what kind of workloads you're going to see before we can make concrete suggestions. Since this is linux about all I could suggest is "If it's a read-heavy webserver, using the deadline scheduler for local disks and noop for SAN LUN's is probably preferable". We need more information than we currently have to determine what steps you should take. – Bratchley May 13 '13 at 13:00

for benchamrking purposes you should disable syn_cookies:

echo 0 > /proc/sys/net/ipv4/tcp_syncookies

But re-enable them if you're done!

If the server can't take the load you have to optimize your webapp, tune your config, use some kind of caching or use more than one server fronted by a loadbalancer. I can't tell more detals because it highly depends on your application and the workload you expect. Maybe you should take a look at projects like nginx or varnish. Is there a database in your backend? Maybe this can be a bootleneck too...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.