I need to load test or simulate 2K connections to my web application to see how it handles load etc.
If I run apache bench on my laptop, I'm guessing it can't possible simulate this?
Does this mean I should fire up seperate VM's to hit a production server, each doing maybe 200 seperate connections each?
Would I be doing 1 request x 2K concurrent users?
Or can I play around like 500 x 400 to get the same results?
ApacheBench allows you to configure the number of requests to send, a timeout limit, and request headers. ab will send the requests, wait for a response (up to a user-specified timeout), and output statistics as a report.
In simple words, ab -n 1000 -c 5 http://www.example.com/ where, -n 1000: ab will send 1000 number of requests to example.com server in order to perform for the benchmarking session. -c 5 : 5 is concurrency number i.e. ab will send 5 number of multiple requests to perform at a same time to example.com server.
Here are the steps to check number of concurrent connections in Apache. There are numerous ways to count the number of connections to your Apache server. You can use any of the following commands to do so. 1. Using Netstat You can use any of the following netstat commands to check number of concurrent connections to Apache.
And -c is the concurrency and denotes the number of multiple requests to perform at a time. Default is one request at a time. So in this test, Apache Bench will make 100 requests with concurrency 10 to the Apache organization server.
Therefore, when benchmarking high-capacity servers, a single instance of Apache Bench can itself be a bottleneck. To completely saturate the target URL, it is better to use additional instances of Apache Bench in parallel, if your server has multiple processor cores.
If you want to test a web application hosted on the same VPS, then it is enough to install the Apache web server only − Being an Apache utility, Apache Bench is automatically installed on installation of the Apache web server. Let us now see how to verify Apache Bench Installation.
You should checkout Bees with machine guns It is very customizable and allows you to spin up a swarm of micro EC2 instances that "attack" your server. It is an exceptional real world test. You can experiment with 2000 simultaneous requests, 200 users requesting 10 each, 2000 requesting 1 resource each etc. You a great feel where the bottlenecks are.
As far as cost, it costs pennies for the instances. It's a great tool. I know a lot of high-traffic apps/sites using and relying on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With