I was benchmarking my site with apache ab and I noticed that the response time had big differences when running ab on the server and running ab on a client box remotely.
So what's the biggest difference between running ab on the server and running ab remotely. Is the time consumed on net transportation?
Latency and network capacity.
We wrote a good article about concurrency/load testing with Siege (which is very similar to AB) specifically mentioning local versus remote testing.
You can read the full version here:
http://www.sonassi.com/knowledge-base/magento-kb/why-siege-isnt-an-accurate-test-tool-for-magento-performance/
Content extracted from http://www.sonassi.com/knowledge-base/magento-kb/why-siege-isnt-an-accurate-test-tool-for-magento-performance/
Yes, the different network situation is the cause. An HTTP request tends to require 2 round-trips (for a very small request and response):
So, ping your server, and double that; that's the time that's being added to each request, on average.
You can enable HTTP keep-alive with
-k
and drop one of those round-trips out of the equation, but it will still be slower than local requests due to latency.As you suggested the difference is due to the internet transfer from a remote client to the web server.
So it's always a good practice when doing benchmark to try and simulate your user experience. So what I do i try to run different benchmarks based on my visitors geo location to find out how they experience the site. For example if most of my visitor are from USA I run an EC2 instance from there and run the benchmark.
Based on that you can decide to deploy some kind of CDN if is needed.