Htttest.sh

From Federal Burro of Information
Revision as of 18:55, 26 February 2023 by David (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

smash apache with ab.


#!/bin/sh

# this test the performance of apache alone based on various concurrency levels.

#URL="http://66.46.148.83/"

COUNT="10000"
AB="/usr/local/apache/bin/ab"
CONCURS="300"
PID=$$
#CONCURS="100 200 300 400 500 600 700 800 900 1000"

# sample size
N=10

for i in `seq 1 $N`
        do
        for CONCUR in $CONCURS
                do
                echo Processing run $i CONCUR $CONCUR
                echo $AB -n $COUNT -c $CONCUR $URL >> data.$i.$CONCUR.$PID
                $AB -n $COUNT -c $CONCUR $URL > data.$i.$CONCUR.$PID
                done

        done

and a report script:

#!/bin/sh

echo Elapse
grep "Time taken for tests" $1* | awk '{print $5}'
echo Failed
grep "Failed requests" $1* | awk '{print $3}'
echo RPS
grep "Requests per second" $1* | awk '{print $4}'
echo Per request time
grep "across all concurrent requests" $1* | awk '{print $4}'