Performance testing servers

When you look after a number of servers, or have servers from a number of hosting providers, it's important to make sure that they're relative to each other (to help identify any issues).

There are a variety of tools out there, but here's a rundown of what I use to help:

Apache

ab -T 'application/x-www-form-urlencoded' -A AUTH -n 10 -p post.data http://URL

IO (CPU/Memory/Disk IO and Network IO)

yum install sysbench

sysbench --test=cpu run
sysbench memory run
sysbench fileio prepare --file-num=10 --file-total-size=1G --file-extra-flags=direct

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
./speedtest-cli

Memcached

yum install libmemcached

memslap -s IP:11211 --concurrency=10 --execute-number=10000 --b

MySQL

yum install sysbench

sysbench oltp_read_write --table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=PASSWORD --mysql-host=IP prepare
sysbench oltp_read_write --table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=PASSWORD --mysql-host=IP --max-time=60 --max-requests=0 --num-threads=8 run
sysbench oltp_read_write --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=PASSWORD --mysql-host=IP cleanup

Network connectivity between servers (sometimes just as important as service performance)

Listen on one server: nc -l 1122 > /dev/null

Connect via another server: dd if=/dev/zero bs=2GB count=1 | nc IP 1122



Want to get in touch?