public
Last active

ZF benchmarks

  • Download Gist
benchmark.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#!/bin/bash
 
concurrent=5
max=81
 
while [ $concurrent -lt $max ]
do
ab_args='-n 2000 -c '$concurrent
folder='run-'`date +'%Y%m%d%H%M%S'`'-'$concurrent
 
echo -e '============\nReady for testing '$folder', '
ssh frameworks-test.local '/etc/init.d/apache2 restart'
sleep 5
echo -e 'Starting test..\n============'
 
mkdir $folder
 
ab $ab_args -g $folder/zf1.dat http://zf1.frameworks.dev/ | tee $folder/ab-zf1.log
echo -e 'Done, restarting Apache..\n============'
ssh frameworks-test.local '/etc/init.d/apache2 restart'
sleep 5
echo -e 'Starting next test..\n============'
 
ab $ab_args -g $folder/zf2.dat http://zf2.frameworks.dev/ | tee $folder/ab-zf2.log
 
cat <<PLOT > $folder/plot.p
# output as png image
set terminal png
 
# save file to "out.png"
set output "$folder/out.png"
 
# graph title
set title "ab $ab_args"
 
# nicer aspect ratio for image size
#set size 1,0.7
 
# y-axis grid
set grid y
 
# x-axis label
set xlabel "request"
 
# y-axis label
set ylabel "response time (ms)"
 
plot "$folder/zf1.dat" using 9 smooth sbezier with lines title "Zend Framework 1", \
"$folder/zf2.dat" using 9 smooth sbezier with lines title "Zend Framework 2"
PLOT
 
gnuplot $folder/plot.p
 
echo -e '============\nDone, files can be found in '$folder
let "concurrent*=2"
done

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.