Skip to content

Instantly share code, notes, and snippets.

@s0enke
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s0enke/84513e6ff4c3c09e4309 to your computer and use it in GitHub Desktop.
Save s0enke/84513e6ff4c3c09e4309 to your computer and use it in GitHub Desktop.
starting bees
bees up --group=bees-load-testing -k soenke -i  ami-f6b11181 -z eu-west-1c -l ubuntu -s 50 -t m1.small
parallel-ssh -O 'StrictHostKeyChecking=No' -h <(aws ec2 describe-instances --filters "Name=tag-key,Values=Name,Name=tag-value,Values=a bee!" | grep ec2- | cut -d'"' -f4 | sed -e 's/^/ubuntu@/g') sudo apt-get -y install apache2-utils

increase open file limits for apache bench

parallel-ssh -O 'StrictHostKeyChecking=No' -h <(aws ec2 describe-instances --filters "Name=tag-key,Values=Name,Name=tag-value,Values=a bee!" | grep ec2- | cut -d'"' -f4 | sed -e 's/^/ubuntu@/g') sudo wget https://gist.githubusercontent.com/s0enke/97fc447a06a19b50bf04/raw/b95286b25cf6c3baf438a79dd6f78cd876ffa5b4/gistfile1.txt -O /etc/security/limits.conf

Start it in an endless loop with lesser request count because strg+c does not work

while true; do bees attack -u http://kamen-dom.jimdo.com/ -c 40000 -n 50000000; sleep 1; done;

Alternative way as ab somehow needs to be restarted to entfach full speed over time (dunno why):

while true; do timeout 120 bees attack -u http://kamen-dom.jimdo.com/ -c 40000 -n 100000000; parallel-ssh -O 'StrictHostKeyChecking=No' -h <(aws ec2 describe-instances --filters "Name=tag-key,Values=Name,Name=tag-value,Values=a bee!" | grep ec2- | cut -d'"' -f4 | sed -e 's/^/ubuntu@/g') sudo killall -9 ab; done;

check if other site is working during attack:

while true; do echo $(date) $(wget -q --tries=1 --timeout=1 http://derevo-dom.jimdo.com/ && echo OK || echo FAIL); sleep 1; done
@s0enke
Copy link
Author

s0enke commented Oct 21, 2014

Testing a new approach to get a stable req/s rate

Stood down 1 bees.
(beeswithmachineguns)soenke♥kellerautomat:~/projects/beeswithmachineguns (master)$ ./bees up --group=bees-load-testing -k soenke -i  ami-f6b11181 -z eu-west-1a -l ubuntu -s 10 
Connecting to the hive.
Attempting to call up 10 bees.
Waiting for bees to load their machine guns...
.
.
.
.
Bee i-e1e5cda2 is ready for the attack.
Bee i-e7e5cda4 is ready for the attack.
Bee i-e6e5cda5 is ready for the attack.
.
.
.
.
.
Bee i-e5e5cda6 is ready for the attack.
Bee i-e4e5cda7 is ready for the attack.
Bee i-ebe5cda8 is ready for the attack.
Bee i-eae5cda9 is ready for the attack.
Bee i-e9e5cdaa is ready for the attack.
Bee i-e8e5cdab is ready for the attack.
Bee i-eee5cdad is ready for the attack.
The swarm has assembled 10 bees.
(beeswithmachineguns)soenke♥kellerautomat:~/projects/beeswithmachineguns (master)$ while true; do ./bees attack -u http://kamen-dom.jimdo.com/ -c 1000 -n 1000; done;
Read 10 bees from the roster.
Connecting to the hive.
Assembling bees.
Each of 10 bees will fire 100 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 5 is joining the swarm.
Bee 6 is joining the swarm.
Bee 7 is joining the swarm.
Bee 4 is joining the swarm.
Bee 8 is joining the swarm.
Bee 9 is joining the swarm.
Bee 0 is firing her machine gun. Bang bang!
Bee 7 is firing her machine gun. Bang bang!
Bee 1 is firing her machine gun. Bang bang!
Bee 4 is firing her machine gun. Bang bang!
Bee 5 is firing her machine gun. Bang bang!
Bee 3 is firing her machine gun. Bang bang!
Bee 9 is firing her machine gun. Bang bang!
Bee 2 is firing her machine gun. Bang bang!
Bee 6 is firing her machine gun. Bang bang!
Bee 8 is firing her machine gun. Bang bang!

@s0enke
Copy link
Author

s0enke commented Oct 21, 2014

Maintaining 3Mreq/minute

  1. use patched https://github.com/Jimdo/beeswithmachineguns/
  2. assemble bees
./bees up --group=bees-load-testing -k soenke -i  ami-f6b11181 -z eu-west-1a -l ubuntu -s 30 -t m1.small
  1. use while loop
while true; do ./bees attack -u http://kamen-dom.jimdo.com/ -c 600 -n 80000000; done;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment