Blankman
Blankman

Reputation: 266900

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?

Upvotes: 5

Views: 5841

Answers (2)

CMerrill
CMerrill

Reputation: 1972

It is very easy to get misleading results with ab unless you really know what you're doing.

If you need to simulate 2000 simultaneous connections, then you need to open 2000 connections concurrently - simple as that. If you need to simulate 2000 concurrent TRANSACTIONS, then you need 2000 connections open at once and each of those connections needs to be issuing a request at the same time. A single VM in the cloud can easily open 2000 concurrent connections with either Linux or Windows. Whether or not the software you use (such as ab) will be able to handle it will depend on how efficient it is.

However, if you are really asking "I need to simulate 2000 concurrent USERS", then the answer will be different - as those users may or may not keep connections open when not in use and most connections will be idle most of the time.

Upvotes: 1

Erik Hinton
Erik Hinton

Reputation: 1946

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.

Upvotes: 5

Related Questions