I have created a web app where the client polls the server every 1-2 seconds for a small bit of information. I have configured a Ubuntu 12.04 droplet with Varnish as a frontend to Apache.
Here’s a real URL that I’m serving:
http://lafayettecc.org/lcc_live/event/132/progress
You can see that it returns only a single integer
If I log into my server and run apachebench I get astounding results:
====================================== $ ab -n 200 -c 200 http://lafayettecc.org/lcc_live/event/132/progress 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, http://www.apache.org/
[TRIMMED]
Document Path: /lcc_live/event/132/progress Document Length: 2 bytes
$ ab -n 100 -c 20 http://lafayettecc.org/lcc_live/event/132/progress 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, http://www.apache.org/
$ ab -n 100 -c 20 http://lafayettecc.org/lcc_live/event/132/progress 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, http://www.apache.org/
Benchmarking lafayettecc.org (be patient)…done
Server Software: Apache/2.2.22 Server Hostname: lafayettecc.org Server Port: 80
Document Path: /lcc_live/event/132/progress Document Length: 2 bytes
The performance is way worse, but that’s okay since I have to consider my own network lag to the droplet.
$ ab -n 100 -c 50 http://lafayettecc.org/lcc_live/event/132/progress 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, http://www.apache.org/
So, is there some reason why my droplet can handle massively concurrent requests locally, but times out when they come from the network?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi Jeff, <br> <br>Are you still experiencing this? What OS is the local machine? It seems that there is a known issue with ApacheBench on (at least) OSX, that could be causing what you’re seeing: <br> <br>http://simon.heimlicher.com/articles/2012/07/08/fix-apache-bench-ab-on-os-x-lion <br> <br>Let us know if it’s still a problem!