Http benchmark

From campisano.org
Jump to navigation Jump to search

Siege

from https://github.com/JoeDog/siege

  • static compile

example using siege-4.1.1

./configure --prefix=/tmp/siege --enable-static --without-ssl
make
cd src/
rm -f siege
gcc -I/include/zlib -I/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -o siege_static array.o auth.o base64.o browser.o cache.o cookie.o cookies.o cfg.o creds.o crew.o data.o date.o eval.o ftp.o getopt.o getopt1.o handler.o hash.o http.o init.o load.o log.o main.o md5.o memory.o notify.o page.o parser.o perl.o response.o sock.o ssl.o stralloc.o timer.o url.o util.o version.o  -L/usr/lib -lpthread -lz -static -static-libgcc -static-libstdc++
  • url random parameter test (to avoid cache)

first add an url variable for your site, adding a nonexistent empty query parameter

echo 'U=http://www.campisano.org/?nonexistent_param=' > requests.siege

then add url parameters

for i in `seq 1 1000`; do echo '$(U)'$i; done >> requests.siege

finally, execute 100 concurrent requests continuously

./siege_static -c 100 -b --no-parser --no-follow -v -f requests.siege

note, for a more aggressive test, you should use a custom siege conf file like the follow one

connection = keep-alive
failures = 65535
timeout = 1

and run using nohup:

nohup ./siege_static -R ./siegerc -c 1000 -b --no-parser --no-follow -v -f requests.siege > /tmp/nohup.log 2>&1 &
echo $! > /tmp/nohup.pid
tail -f /tmp/nohup.log

httperf

from https://github.com/httperf/httperf

  • static compile

example using commit de8cd6ad8a79779a0cb74a4aa2175afa9e24df57 (Dec 6, 2020)

su -c 'apt install automake libtool'
libtoolize --force
autoconf -i
automake

note, I must edit ./configure file to disable ssl...

then

./configure --prefix=/tmp/httperf --enable-static
make
cd src
rm -f httperf
gcc -I. -I./gen -I./lib -I./stat -g -O2 -o httperf_static httperf.o object.o call.o conn.o sess.o core.o localevent.o http.o timer.o  gen/libgen.a lib/libutil.a stat/libstat.a -lcrypto -lm -static

TO BE CONTINUED

AB

from https://httpd.apache.org/docs/2.4/programs/ab.html

TO BE CONTINUED