Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating 2000 concurrent connections, is apache bench reliable?

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?

like image 503
Blankman Avatar asked Oct 28 '11 02:10

Blankman


People also ask

How apache Bench works?

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.

What is concurrency in Apache benchmark?

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.

How to check number of concurrent connections in Apache?

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.

What is the concurrency of Apache bench?

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.

Is a single instance of Apache bench enough for benchmarking?

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.

How to test Apache bench on the same VPS?

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.


1 Answers

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.

like image 175
Erik Hinton Avatar answered Sep 27 '22 18:09

Erik Hinton