bees with machine guns amazon web services

Bees with machine guns – or how to load-test your application/corporate website for a cup of coffee with the help of Amazon Web Services

First let’s assume that you like decent coffee in larger quantities, so an average cup of coffee would cost around $5. You might ask yourself what you get for that amount of money or how this should even be enough for a load test. But let us introduce the bees with machine guns.

The idea for bees with machine guns originates back to the Chicago Tribune, as they launched one of their largest sites in terms of traffic and had to find a suitable load test scenario. You can imagine it as a utility for arming (creating) many bees (Amazon Web Services AWS EC2 instances) to attack (load test) a target (your web application or corporate website). It is basically a fabric script that utilizes Apache AB to perform the actual load test. But let’s fire up 2 bees and have a look at the sample output:

Each of 2 bees will fire 500 rounds, 50 at a time.
Stinging URL so it will be cached for the attack.
[localhost] run: curl >> /dev/null
Organizing the swarm.
Bee 0 is joining the swarm.
Bee 1 is joining the swarm.
Bee 0 is firing his machine gun. Bang bang!
Bee 1 is firing his machine gun. Bang bang!
Bee 0 is out of ammo.
Bee 1 lost sight of the target (connection timed out).
Offensive complete.
Target failed to fully respond to 1 bees.
Complete requests: 500
Requests per second: 81.670000 [#/sec] (mean)
Time per request: 612.188000 [ms] (mean)
50% response time: 358.000000 [ms] (mean)
90% response time: 1541.000000 [ms] (mean)
Mission Assessment: Target successfully fended off the swarm.
The swarm is awaiting new orders.

As you can see it also gives a nice feedback on how your website performed against the bees and returns a number of useful statistics. But let’s get back to the cup of coffee and do some math. As bees with machine guns utilizes Amazon Web Services (AWS) EC2 instances as bees we will use a special type of instance, called spot instance. You can imagine this as a stock market for compute power, as long as your bid is above the spot price, your instance is running, if it drops below the spot price, Amazon shuts down your instance. At the moment you can get a small spot instance in Australia (Sydney) for around $0.02 per hour, so for your cup of coffee you could start approximately 250 instances. But how do 250 instances compare in a load test? Let’s assume each instance can send 20 requests per seconds. That would be the equivalent of 432 million hits per day, or triple the amount of hits LinkedIn gets globally according to Quantcast.

That is quite an impressive number for a cup of coffee. You could even start instances in other regions/countries to simulate a global access pattern or test the efficiency of your content delivery network, however please keep in mind that the target URL stays the same. For a more sophisticated pattern we recommend using jmeter.

Unfortunately Amazon Web Services will not allow you to start 250 machines initially. Not because they don’t want you to do so, but more as a protection against an accidental launch of large amounts of instances. You can either contact the ever helpful AWS support to raise your limit or why not contact us and we will set up everything for you?


Share this Post

About the Author

Markus Mueller

Facebook Twitter

Founder of HappyCloudSolutions with a passion for all things digital.

Other articles carefully selected for you