Reputation: 139
I test my website using ab
as ab -n 10000 -c 1000 http://example.com/path
and I got response as 160 #/second
. But when i test it as ab -n 10000 -c 1000 http://localhost/path
the response is totally different 1500 #/second
.
why?
Upvotes: 1
Views: 1773
Reputation: 637
From what I understand, you are testing the same website in 2 different configurations:
Testing your remote website involves the network connection between your computer and the remote server. when testing locally, all the goes through the loopback network interface which is probably several orders of magnitude faster than your DSL internet connection.
Upvotes: 1
Reputation: 168002
Normally you should not be running load generator (ab
or any other tool) on the same host where application under test lives as load testing tools themselves are very resource intensive and you may run into the situation when application under test and load generator are struggling for the same CPU, RAM, Network, Disk, Swap, etc.
So I would recommend running ab
from another host in your intranet, this way you will be able to get more clear results without aforementioned mutual interference. Remember to monitor baseline OS health metrics using vmstat, iostat, top, sar, etc. on both application under test and load generator side - it should give you more clear picture regarding what's going on and what is the impact of the perceived load.
You may also want to try out a more advanced tool as ab
has quite limited load testing capabilities, check out Open Source Load Testing Tools: Which One Should You Use? article for more information on the most prominent free and open source load testing solutions (all listed tools are cross-platform so you will be able to run them on Linux)
Upvotes: 2