/ Quick Load Test Setup on AWS

Quick Load Test Setup on AWS

One of the major factors in having a good business model is keeping a stronghold on the online customer base. A good business will have multiple sites that resolve fast enough to keep its customers scrolling through pages without hesitation. If the customer has to wait for images and text to load on your website, they would much rather go to your competitors.

Wouldn’t it be nice to know how well your website would perform under pressure? What if you were to launch a product that would attract hundreds or thousands of users to your website? How well do you think your site would resolve with an enormous amount of requests being made? If your business model depends on having a strong customer base online, then beeswithmachineguns is a great way to do load testing on your sites. It will also offer some perspective of how your site performs globally across several regions you expect to target. Bees with machineguns (BWMG) allow you to create several virtual machines (the bees) and attack a single or a range of URLs. You can set the number of VMs, the region you want to launch them from and the URL. The ingredients are: AWS EC2 which runs Linux virtual machines as bees, and Boto and Paramiko Python libraries. While Boto allows you to talk to AWS by validating your credentials, and launch the EC2 instances, Paramiko will allow you to talk to your instances in parallel via SSH.

Bees with machineguns (BWMG) allow you to create several virtual machines (the bees) and attack a single or a range of URLs. You can set the number of VMs, the region you want to launch them from and the URL.

Once the linux server has been brought up and a .boto file with AWS credentials has been created, we can run the command to launch the bees. This will bring up the number of bees from the region you command. Once the bees are ready you will be able to instruct them to attack the URL as you require. Depending on how fast and reliable the connections are, you will see your results accordingly. Once you are satisfied with the results you can command the bees to be brought down securely.

Note: You will incur charges for the number of EC2 instances raised and the time they run for.

 

The following is a running example of BWMG:

$ bees attack –c 800 –k BeesEast –u ‘https://enquizit.com/’

Read 8 bees from the roster.

Connecting to the hive.

Assembling bees.

Each of 8 bees will fire 125 rounds, 100 at a time.

Stinging URL so it will be cached for the attack.

Organizing the swarm.

Bee 0 is joining the swarm.

Bee 1 is joining the swarm.

Bee 2 is joining the swarm.

Bee 3 is joining the swarm.

Bee 4 is joining the swarm.

Bee 5 is joining the swarm.

Bee 6 is joining the swarm.

Bee 7 is joining the swarm.

Bee 0 is firing his machine gun. Bang bang !

Bee 4 is firing his machine gun. Bang bang !

Bee 1 is firing his machine gun. Bang bang !

Bee 6 is firing his machine gun. Bang bang !

Bee 3 is firing his machine gun. Bang bang !

Bee 2 is firing his machine gun. Bang bang !

Bee 7 is firing his machine gun. Bang bang !

Bee 5 is firing his machine gun. Bang bang !

Bee 0 is out of ammo.

Bee 1 is out of ammo.

Bee 6 is out of ammo.

Bee 4 is out of ammo.

Bee 3 is out of ammo.

Bee 7 is out of ammo.

Bee 2 is out of ammo.

Bee 5 is out of ammo.

Offensive complete.

Complete requests: 1000

Requests per second: 5541.940000 [#/sec] (mean)

Time per request: 167.657250 [ms] (mean)

50% response time: 96.250000 [ms] (mean)

90% response time: 137.750000 [ms] (mean)

Mission Assessment: Target crushed bee offensive.

The swarm is awaiting new orders.

A good business will have multiple sites that resolve fast enough to keep its customers scrolling through pages without hesitation.