Apache/Benchmarks

From Segfault
Jump to navigation Jump to search

ApacheBench

The Apache HTTP server benchmarking tool ("ab") may be the most commonly known benchmarking tool.

Example:

URL=https://localhost:8080/test.php

# Number of requests
for n in 500 1000 5000; do
   # Number of concurrent connections
   for c in 10 100; do
      # Use HTTP KeepAlive feature?
      for k in 0 1; do
         [ $k = 1 ] && k="-k" || k=""
         ab -n $n -c $c $k -e ab_n"$n"-c"$c"$k.csv -g ab_n"$n"-c"$c"$k.dat "$URL" > ab_n"$n"-c"$c"$k.txt
      done
   done
done

See also: Gnuplot to graph this data.

Siege

https://www.joedog.org/siege-home/

http_load

http_load hasn't been updated since 03/2006, so it's kinda dated. Here's how to run it:

wget https://acme.com/software/http_load/http_load-12mar2006.tar.gz
tar -xzf http_load-12mar2006.tar.gz
cd http_load-12mar2006

You may want to apply the following patch, so that 1) http_load will be compiled with OpenSSL support and 2) install to /opt/http_load:

$ diff -u Makefile.orig Makefile
--- Makefile.orig       2013-02-17 11:34:18.706179572 -0800
+++ Makefile    2013-02-17 11:36:23.175770197 -0800
@@ -9,14 +9,14 @@
 # https://www.openssl.org/  Make sure the SSL_TREE definition points to the
 # tree with your OpenSSL installation - depending on how you installed it,
 # it may be in /usr/local instead of /usr/local/ssl.
-#SSL_TREE =    /usr/local/ssl
-#SSL_DEFS =    -DUSE_SSL
-#SSL_INC =     -I$(SSL_TREE)/include
-#SSL_LIBS =    -L$(SSL_TREE)/lib -lssl -lcrypto
+SSL_TREE =     /usr
+SSL_DEFS =     -DUSE_SSL
+SSL_INC =      -I$(SSL_TREE)/include/openssl
+SSL_LIBS =     -L$(SSL_TREE)/lib -lssl -lcrypto


-BINDIR =       /usr/local/bin
-MANDIR =       /usr/local/man/man1
+BINDIR =       /opt/http_load/bin
+MANDIR =       /opt/http_load/man/man1
 CC =           gcc -Wall
 CFLAGS =       -O $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC)
 #CFLAGS =      -g $(SRANDOM_DEFS) $(SSL_DEFS) $(SSL_INC)

Now we can build & install it:

sudo mkdir -p /opt/http_load/bin /opt/http_load/man
sudo make install

httperf

https://github.com/httperf/httperf

curl-loader

https://curl-loader.sourceforge.net/