Skip to content

Instantly share code, notes, and snippets.

@fzoccara
Forked from Integralist/Apache Ab.sh
Last active August 16, 2018 09:27
Show Gist options
  • Select an option

  • Save fzoccara/31241c6db97f224347c584d0c1b5086c to your computer and use it in GitHub Desktop.

Select an option

Save fzoccara/31241c6db97f224347c584d0c1b5086c to your computer and use it in GitHub Desktop.
Apache Ab Stress Test CLI tool
# Run Ubuntu
docker run -it ubuntu
# Update packages
apt-get update
# Install manual pages
apt-get install man
# Install (amongst other things) the `ab` command
apt-get install apache2-utils
# create file with urls
echo https://fzoccara.com/ > urls-light.txt
# Install manual pages
apt-get install wget
wget https://raw.githubusercontent.com/philipgloyne/apachebench-for-multi-url/master/ab.c
wget https://github.com/philipgloyne/apachebench-for-multi-url/blob/master/ab?raw=true
apt-get install gcc
gcc -I /usr/include/apr-1.0 -I /usr/include/apache2 ab.c -o ab -lm -lapr-1 -laprutil-1
# Make 300 requests, using 200 concurrent users, to urls in file
ab -n 300 -c 200 -v 4 -L urls.txt > results.txt
#OR:
# Make 300 requests, using 200 concurrent users, to the specified URL
ab -n 300 -c 200 https://fzoccara.com/ > results.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment