Skip to content

Instantly share code, notes, and snippets.

@JCotton1123
Created September 30, 2013 02:09
Show Gist options
  • Save JCotton1123/6758588 to your computer and use it in GitHub Desktop.
Save JCotton1123/6758588 to your computer and use it in GitHub Desktop.
Apache Bench script - needs some work
#!/usr/local/bin/bash
numberOfRequestsValues="10 20 40"
concurrencyValues="1 2 4"
abCmd="/usr/local/sbin/ab"
for url in $(cat $1); do
echo "# $url"
echo
for numberOfRequests in $numberOfRequestsValues; do
for concurrency in $concurrencyValues; do
echo "## Requests: $numberOfRequests; Concurrency: $concurrency"
echo '```'
$abCmd -r -n $numberOfRequests -c $concurrency $url 2>&1
echo '```'
echo
done
done
echo "## Number of requests serviced in 20 seconds"
$abCmd -t 20 $url 2>&1
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment