Talk:Benchmarking

From wiki.mikejung.biz
Jump to navigation Jump to search

Liquidweb 728x90.jpg

Benchmarking Videos and Links

THIS IS A BACKUP OF THE MAIN PAGE BEFORE / IN CASE I EDITED IT TO HELL

GTAC 2014: The Challenge of Fairly Comparing Cloud Providers

{{#ev:youtube|https://www.youtube.com/watch?v=_YstK4EEzhQ}}

Benchmarking Tools

Google Compute SSD FIO Script

https://cloud.google.com/compute/docs/local-ssd

This FIO script is meant to be run on Ubuntu, but can be quickly converted to work with any OS.

# Change this variable to the path of the device you want to test
block_dev=/mount/point

# install dependencies
sudo apt-get -y update
sudo apt-get install -y fio


# full write pass
sudo fio --name=writefile --size=100G --filesize=100G \
--filename=$block_dev --bs=1M --nrfiles=1 \
--direct=1 --sync=0 --randrepeat=0 --rw=write --refill_buffers --end_fsync=1 \
--iodepth=200 --ioengine=libaio

# rand read
sudo fio --time_based --name=benchmark --size=100G --runtime=30 \
--filename=$block_dev --ioengine=libaio --randrepeat=0 \
--iodepth=128 --direct=1 --invalidate=1 --verify=0 --verify_fatal=0 \
--numjobs=4 --rw=randread --blocksize=4k --group_reporting

# rand write
sudo fio --time_based --name=benchmark --size=100G --runtime=30 \
--filename=$block_dev --ioengine=libaio --randrepeat=0 \
--iodepth=128 --direct=1 --invalidate=1 --verify=0 --verify_fatal=0 \
--numjobs=4 --rw=randwrite --blocksize=4k --group_reporting

SSD Break In

This should work ok with larger SSDs / RAIDS. Might want to rinse and repeat a few times and continue testing until the results are stable. This could take a few hours of testing to complete. Also, you will want to try and test the drives / arrays with about 80-90% utilization (make sure the drives free space is around 10%)

dd if=/dev/zero of=bigfile bs=1M count=100000
dd if=/dev/zero of=bigfile1 bs=1M count=100000
dd if=/dev/zero of=bigfile2 bs=1M count=100000
dd if=/dev/zero of=bigfile3 bs=1M count=100000
dd if=/dev/zero of=bigfile4 bs=1M count=100000
dd if=/dev/zero of=bigfile5 bs=1M count=100000
dd if=/dev/zero of=bigfile6 bs=1M count=100000
rm -f bigfile*

The main reason for doing this is to make sure that the SSDs you are testing have hit their "steady state performance". If you do not break in the ssds and fill them up a few times with writes you will get higher than normal performance numbers, which is not going to tell you what the real world performance actually is. Even worse, you might start running benchmarks and wonder why performance continues to drop even as you tweak and optimize settings to improve performance. This will throw a lot of people off, so it's best to write to the SSD until performance has stabilized.

fio

Install Fio on Ubuntu

Installing FIO on Ubuntu 14.10 is really easy, you can simply apt-get install fio.

apt-get install fio

Install Fio on CentOS 6

yum install libibverbs.x86_64
wget http://pkgs.repoforge.org/fio/fio-2.1.10-1.el6.rf.x86_64.rpm
rpm -iv fio-2.1.10-1.el6.rf.x86_64.rpm

Install Fio on CentOS 7

Installing FIO on CentOS 7 is also pretty simple. You can grab the fio 2.1.10 rpm below, then you simply use RPM to install it.

wget http://pkgs.repoforge.org/fio/fio-2.1.10-1.el7.rf.x86_64.rpm
rpm -iv fio-2.1.10-1.el7.rf.x86_64.rpm

Fio random read and write tests

Random write test. This writes a total of 4GB files, running 8 processes at once. If you are testing a server with say 8GB of RAM, you would want to adjust the file size to be double the RAM to avoid excessive buffering, if there is 8GB of RAM, then set size to 2G. Group reporting will combine each job's stats so you get an overall result.

fio --name=randwrite --ioengine=libaio --iodepth=16 --rw=randwrite --bs=4k --direct=0 --size=512M --numjobs=8 --runtime=240 --group_reporting

Random read test. This reads a total of 4GB files, running 8 processes at once. If you are testing a server with say 8GB of RAM, you would want to adjust the file size to be double the RAM to avoid excessive buffering, if there is 8GB of RAM, then set size to 2G. Group reporting will combine each job's stats so you get an overall result.

fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=512M --numjobs=8 --runtime=240 --group_reporting


AWS tests:

##The following command performs 16 KB random write operations.

fio --name fio_test_file --direct=1 --rw=randwrite --bs=4k --size=1G --numjobs=16 --time_based --runtime=180 --group_reporting

##The following command performs 16 KB random read operations.

fio --name fio_test_file --direct=1 --rw=randread --bs=4k --size=1G --numjobs=16 --time_based --runtime=180 --group_reporting

Fio Random Write Test using libaio and direct flags

This Fio test will use libaio for the ioengine, it will also use direct io for the tests. This means the test will avoid using the host's page cache for writes and write directly to disk. This may produce lower test results, however they will be much more consistent and represent a more real world scenario.

fio --name=randwrite --ioengine=libaio --iodepth=16 --rw=randwrite --bs=4k --direct=1 --size=1G --numjobs=8 --runtime=240 --group_reporting

Fio Random Read Test using libaio and direct flags

This Fio test will use libaio for the ioengine, it will also use direct io for the tests. This means the test will avoid using the host's page cache for reads and will read directly from disk. This may produce lower test results, however they will be much more consistent and represent a more real world scenario.

The nice thing about using directfor random read tests is that you do not have to create some massive test file to avoid inflated test results due to reading out of RAM.

fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=1 --size=1G --numjobs=8 --runtime=240 --group_reporting

DD Write Tests

You can use this to break in new SSDs, ideally you will want to fill up the drive to about 90% remove the files, and repeat a few times to cause the garbage collection to kick in.

dd if=/dev/zero of=ddtest1 bs=1M count=8192 conv=fdatasync
dd if=/dev/zero of=ddtest2 bs=1M count=8192 conv=fdatasync
dd if=/dev/zero of=ddtest3 bs=1M count=8192 conv=fdatasync
rm -f ddtest1 ddtest2 ddtest3
dd if=/dev/zero of=ddtest1 bs=1M count=8192 conv=fdatasync
dd if=/dev/zero of=ddtest2 bs=1M count=8192 conv=fdatasync
dd if=/dev/zero of=ddtest3 bs=1M count=8192 conv=fdatasync
rm -f ddtest1 ddtest2 ddtest3

This is a test for small writes.

dd if=/dev/zero of=test bs=4K count=2000000 conv=fdatasync ; sleep 10 ; dd if=/dev/zero of=test bs=4K count=2000000 conv=fdatasync ; sleep 10 ; dd if=/dev/zero of=test bs=4K count=2000000 conv=fdatasync

sysbench

Install Sysbench 0.4.12 From Source CentOS 6.5 and CentOS 6.6

Grab the source files for sysbench, unzip the tar.gz file, then install the dependencies needed for Sysbench. This should work on most Redhat / CentOS based systems.

wget http://pkgs.fedoraproject.org/repo/pkgs/sysbench/sysbench-0.4.12.tar.gz/3a6d54fdd3fe002328e4458206392b9d/sysbench-0.4.12.tar.gz
tar zxvf sysbench-0.4.12.tar.gz
yum install libtool.x86_64 openssl-devel.x86_64 openssl-static.x86_64
cd sysbench-0.4.12/
libtoolize --force --copy
./autogen.sh
./configure
make
make install

/usr/bin/ld: cannot find -lssl If you see this error, make sure that you have the openssl-devel and openssl-static packages installed.

Using Sysbench 0.5 LUA

Sysbench 0.5 OLTP Read and Write Test

This script will run 6 tests, each lasting 4 minutes. It will run 1 through 64 threaded tests, which seem to be the most common tests to run. This test does selects, updates, and various other things and is considered to be a "read / write" MySQL mixed workload.

for each in 1 4 8 16 32 64; do sysbench --test=/usr/share/doc/sysbench/tests/db/oltp.lua --oltp-table-size=20000000 --mysql-db=sysbench --mysql-user=sysbench --mysql-password=password --max-time=240 --max-requests=0 --num-threads=$each run; done

Sysbench 0.5 OLTP Read Only Test

This script will run 6 tests, each lasting 4 minutes. It will run 1 through 64 threaded tests, which seem to be the most common tests to run. This runs selects only, and is considered to be "read only".

for each in 1 4 8 16 32 64; do sysbench --test=/usr/share/doc/sysbench/tests/db/oltp.lua --oltp-table-size=20000000 --mysql-db=sysbench --mysql-user=sysbench --mysql-password=password --oltp-read-only=on --max-time=240 --max-requests=0 --num-threads=$each run; done

Install Sysbench 0.5 on Ubuntu 14.04

Percona includes the latest version of sysbench in their repos, and if you care about performance, chances are you are using Percona, if not, then you may not want to install it this way.

echo "deb http://repo.percona.com/apt trusty main" >> /etc/apt/sources.list.d/percona.list
echo "deb-src http://repo.percona.com/apt trusty main" >> /etc/apt/sources.list.d/percona.list
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
apt-get update
apt-get install sysbench

Install Sysbench 0.4.12 on CentOS

Download and install Repos (Cent 6.5)

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum install sysbench

Install Sysbench on CentOS 7

This should work ok for CentOS 7, verified it does indeed install sysbench 0.4.12

wget ftp://ftp.gnome.org/mirror/fedora/epel/6/x86_64/sysbench-0.4.12-5.el6.x86_64.rpm
wget http://downloads.mysql.com/archives/mysql-5.1/MySQL-shared-compat-5.1.49-1.rhel5.x86_64.rpm
rpm -iv MySQL-shared-compat-5.1.49-1.rhel5.x86_64.rpm
yum install postgresql-libs.x86_64
rpm -iv sysbench-0.4.12-5.el6.x86_64.rpm

Test Script

Prepare the server

apt-get update
apt-get install -y sysbench 
apt-get install -y mysql-server
sysbench --test=fileio --file-total-size=4G --file-num=64 prepare

mysql -u root -ppassword -e "CREATE DATABASE sysbench;"
mysql -u root -ppassword -e "CREATE USER 'sysbench'@'localhost' IDENTIFIED BY 'password';"
mysql -u root -ppassword -e "GRANT ALL PRIVILEGES ON *.* TO 'sysbench'@'localhost' IDENTIFIED  BY 'password';"
sysbench --test=oltp --db-driver=mysql --oltp-table-size=40000000 --mysql-db=sysbench --mysql-user=sysbench --mysql-password=password prepare


#!/bin/bash

for run in 1 2 3 ;do
for thread in 1 4 8 16 32 ;do

echo "Performing test RW-${thread}T-${run}"
sysbench --test=fileio --file-total-size=4G --file-test-mode=rndwr --max-time=60 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=${thread} run > /root/RW-${thread}T-${run}

echo "Performing test RR-${thread}T-${run}"
sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrd --max-time=60 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=${thread} run > /root/RR-${thread}T-${run}

echo "Performing test SQ-${thread}T-${run}"
sysbench --test=oltp --db-driver=mysql --oltp-table-size=40000000 --mysql-db=sysbench --mysql-user=sysbench --mysql-password=password --max-time=60 --max-requests=0 --num-threads=${thread} run > /root/SQ-${thread}T-${run}

done
done

Various Tests

Disk Tests

##The size of the file depends on the amount of RAM in the system, so if you have 32GB RAM installed, the test file needs to be larger than 32GB
sysbench --test=fileio --file-total-size=60G --file-num=64 prepare

##Random Write using no fsync (Should show the highest potential random writes)
sysbench --test=fileio --file-total-size=60G --file-test-mode=rndwr --max-time=720 --max-requests=0 --num-threads=8 --file-num=64 --file-io-mode=async --file-extra-flags=direct --file-fsync-freq=0 run

##Random Write using default fsync (Should show typical fsync behavior)
sysbench --test=fileio --file-total-size=60G --file-test-mode=rndwr --max-time=720 --max-requests=0 --num-threads=8 --file-num=64 --file-io-mode=async --file-extra-flags=direct --file-fsync-freq=0 run


##Random Read Only
sysbench --test=fileio --file-total-size=20G --file-test-mode=rndrd --max-time=240 --max-requests=0 --num-threads=${1,8,64} run

##Mixed Random Read and Write
sysbench --test=fileio --file-total-size=20G --file-test-mode=rndrw --max-time=240 --file-fsync-all --max-requests=0 --num-threads=${1,8,64} run


###For Loops

###RAND WRITE 1 - 16 thread
for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndwr --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=1 run; done; sleep 10; for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndwr --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=4 run; done; sleep 10; for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndwr --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=8 run; done; sleep 10; for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndwr --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=16 run; done;

###RAND READ 1 - 16 thread
for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrd --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=1 run; done; sleep 10;for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrd --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=4 run; done; sleep 10;for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrd --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=8 run; done; sleep 10;for each in {1..3} ; do sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrd --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=16 run; done; sleep 10;

CPU Tests

##This test defaults to using 1 thread, good to run with one thread, then 32 or whatever
sysbench --test=cpu --cpu-max-prime=20000 run

sysbench --test=cpu --cpu-max-prime=20000 --num-threads=32 run

RAM Tests

sysbench --test=memory --memory-block-size=1K --memory-scope=global --memory-total-size=100G --memory-oper=read run

sysbench --test=memory --memory-block-size=1K --memory-scope=global --memory-total-size=100G --memory-oper=write run

Using OLTP with custom .lua scripts

##Install and move to the db test directory##
wget wget http://www.lefred.be/files/sysbench-0.5-3.el6_.x86_64.rpm
rpm -iv sysbench-0.5-3.el6_.x86_64.rpm
cd /usr/share/doc/sysbench/tests/db

##Prepare a test table on the target system##
sysbench --test=parallel_prepare.lua --oltp-table-size=10000000 --mysql-host=$remote_host --mysql-db=sysbench --mysql-user=sysbench --mysql-password=password --oltp-tables-count=1 --num-threads=32 prepare

##Run Tests based off of .lua##
sysbench --test=oltp_simple.lua --oltp-table-size=10000000 --mysql-host=$remote_host --mysql-db=sysbench --mysql-user=sysbench --mysql-password=password --oltp-read-only=on --oltp-skip-trx=on    --max-time=120 --max-requests=0 --max-time=120 --num-threads=512 run


MySQL Tests

##Create Database 
CREATE DATABASE sysbench;

##Create User
CREATE USER 'sysbench'@'localhost' IDENTIFIED BY '$password';

##Grant Access 
GRANT ALL PRIVILEGES ON *.* TO 'sysbench'@'localhost' IDENTIFIED  BY '$password';

##Prepare a test table
sysbench --test=oltp --db-driver=mysql --oltp-table-size=10000000 --mysql-db=sysbench --mysql-user=root --mysql-password=password prepare

##Read-Only Test without "BEGIN"
sysbench --db-driver=mysql --test=oltp --oltp-table-size=10000000 --mysql-host=$IP --mysql-db=sysbench --mysql-user=sysbench --mysql-password=$password --max-time=120 --max-requests=0 --oltp-read-only --oltp-skip-trx  --oltp-nontrx-mode=select --num-threads=256 run

##Read-Only Test
sysbench --test=oltp --oltp-table-size=10000000 --mysql-db=sysbench --mysql-user=root --mysql-password=password --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run

##Mixed Test
sysbench --test=oltp --oltp-table-size=10000000 --mysql-db=sysbench --mysql-user=root --mysql-password=password --max-time=60 --max-requests=0 run

##Mixed Test 8 threads
sysbench --test=oltp --oltp-table-size=10000000 --mysql-db=sysbench --mysql-user=root --mysql-password=password --max-time=60 --max-requests=0 --num-threads=8 run

##16 threads, Random connect / disconnect for threads
sysbench --test=oltp --oltp-table-size=10000000 --mysql-db=sysbench --mysql-user=root --mysql-password=password --max-time=60 --max-requests=0 --num-threads=16 --oltp-reconnect-mode=random run
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/common.lua-20110427224028-j1y84gokmt93n8xn-1/common.lua
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/sysbenchtestsdbinser-20090113060453-687cibzqa6u5f1i4-115/insert.lua
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/oltp.lua-20110427224028-j1y84gokmt93n8xn-2/oltp.lua
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/sysbenchtestsdboltp_-20090113060453-687cibzqa6u5f1i4-118/oltp_simple.lua
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/sysbenchtestsdbselec-20090113060453-687cibzqa6u5f1i4-119/select.lua
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/select_random_points-20101028165209-ue1iedn6sn5azlvx-1/select_random_points.lua
wget http://bazaar.launchpad.net/~vadim-tk/sysbench/sysbench-db-scripts/download/head:/select_random_ranges-20101028165209-ue1iedn6sn5azlvx-2/select_random_ranges.lua

Sysbench CPU Tests

To run a single threaded CPU test, run the following command

sysbench --test=cpu --cpu-max-prime=20000 --num-threads=1 run

You can use the script below to run multi threaded Sysbench CPU tests

for each in 1 2 4 8 16 32 64; do sysbench --test=cpu --cpu-max-prime=20000 --num-threads=$each run; done

The lower the result, the faster the CPU. Multithreaded CPUs will not show their true performance unless you run the test with the correct amount of threads. If you have an 8 core CPU you should run an 8 thread CPU test to get the true performance number.

Cloud / VPS CPU Performance Test Results with Sysbench

Sysbench Fileio Tests

Sysbench Prepare

Generally, I like to create / prepare test files before I run the read and write tests. To prepare test files, run the command below:

sysbench --test=fileio --file-total-size=2G --file-num=64 prepare
  • file-total-size Can be adjusted to whatever size you want. You can use M for Megabytes as well. I like to use a file size of at least 2 times the amount of RAM that the box has.
  • file-num Can be adjusted as well. The default is 128. but you can raise or lower this value to more closely match your workload.

Sysbench Random Write Test

Below is a basic Sysbench random write test. This test uses a file size of 2GB, and will run for a maximum of 240 seconds before finishing. For larger tests you might want to enforce a max time so that the tests do not run for hours and hours. The example below is only running a singled threaded test. Typically, the higher you set num-threads the faster the result will be. However, this is only true up to a point, usually performance will start to cap out once you reach a thread count that is 2 x the number of CPUs on the test system.

sysbench --test=fileio --file-total-size=2G --file-test-mode=rndwr --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=1 run

I prefer to run the script below, which will run the same random write test multiple times. This test will run 1, 4, 8, 16, 32, and 64 threaded random write tests.

for each in 1 4 8 16 32 64; do sysbench --test=fileio --file-total-size=2G --file-test-mode=rndwr --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=$each run; sleep 10; done

Sysbench Random Read Test

Below is a basic Sysbench random read test. This test uses a file size of 2GB, and will run for a maximum of 240 seconds before finishing. For larger tests you might want to enforce a max time so that the tests do not run for hours and hours. The example below is only running a singled threaded test. Typically, the higher you set num-threads the faster the result will be. However, this is only true up to a point, usually performance will start to cap out once you reach a thread count that is 2 x the number of CPUs on the test system.

sysbench --test=fileio --file-total-size=2G --file-test-mode=rndrd --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=1 run

I prefer to run the script below, which will run the same random read test multiple times. This test will run 1, 4, 8, 16, 32, and 64 threaded random read file io tests.

for each in 1 4 8 16 32 64; do sysbench --test=fileio --file-total-size=2G --file-test-mode=rndrd --max-time=240 --max-requests=0 --file-block-size=4K --file-num=64 --num-threads=$each run; sleep 10; done

Intel E5-2690v2 KVM Sysbench CPU Pinning Results

  • Testing using a single VM located on a CentOS 6 box. Running KVM, allocated all 40 vCPUs to the guest instance.

Running Sysbench CPU with 40 threads

sysbench --test=cpu --cpu-max-prime=20000 --num-threads=40 run
  • CPU Affinity all Total Time Taken: 0.9807s

By default each vCPU's CPU affinity will be set to each Host CPU. You can change force this by running the command below

for each in {0..39}; do virsh vcpupin $instance_ID $each 0-39 ; done
  • Each vCPU Pinned to Corresponding Host CPU Total Time Taken: 0.9218s

To optimize performance, I pinned each vCPU to the corresponding host CPU. So vCPU 0 affinity is set to Host CPU 0, etc, etc

for each in {0..39}; do virsh vcpupin $instance_ID $each $each ; done

Phoronix Test Suite

The latest version of Phoronix test suite can be found here

To install the latest version of Phoronix test suite on Ubuntu, grab the latest .deb, install php5 and then just install the package

wget http://phoronix-test-suite.com/releases/repo/pts.debian/files/phoronix-test-suite_5.4.1_all.deb
apt-get install php5-cli php5-gd php5-json
dpkg -i phoronix-test-suite_5.4.1_all.deb

If you get this error when trying to run the Apache or Nginx test The following tests failed to properly run:- pts/nginx-1.1.0: Static Web Page Serving you might need to run the command below to disable IPV6 networking which appears to be what causes this to fail, every time I run into this error disabling IPV6 using sysctl resolves the issue

## Resolves the Nginx phoronix issue with Ubuntu

echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -p


Phoronix test suite includes Apache Benchmark 2.4.7, also called: pts/apache-1.6.1 This test is just a basic AB test that hammers Apache with lots of requests. I'm not sure what test file is being used, but I would assume Apache is just serving up a basic html file and AB tries to request the file as many times as possible in a given amount of time.

/usr/bin/phoronix-test-suite benchmark pts/apache

There is also an NGINX performance test, called pts/nginx-1.1.0. This test also uses Apache benchmark, but this time NGINX is serving the requests, not apache. If you run into errors while running the test, and it fails to complete on Ubuntu. You might need to disable IPV6 in /etc/sysctl.conf.

/usr/bin/phoronix-test-suite benchmark pts/nginx

###If pts/nginx-1.1.0 fails to run on Ubuntu, run these commands to resolve the issue

echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -p


/usr/bin/phoronix-test-suite benchmark pts/phpbench


Here is a list of some CPU intensive suites to run

phoronix-test-suite benchmark pts/cpu
phoronix-test-suite benchmark pts/cryptography
phoronix-test-suite benchmark pts/database
phoronix-test-suite benchmark pts/java

Suite tests (A lot of tests wrapped up into one)

## See what tests are available
phoronix-test-suite list-tests
## Basic CPU test
phoronix-test-suite benchmark pts/cpu
## Basic Disk test
phoronix-test-suite benchmark pts/disk
## Basic RAM test
phoronix-test-suite benchmark pts/memory
## Overall system test
phoronix-test-suite benchmark pts/linux-system
## Overall mobo test
phoronix-test-suite benchmark pts/server

Individual tests

Disk / File System Tests

##fio is an advanced disk benchmark that depends upon the kernel's AIO access library.
phoronix-test-suite benchmark pts/fio

##AIO-Stress is an a-synchronous I/O benchmark created by SuSE. Current this profile uses a 2048MB test file and a 64KB record size.
phoronix-test-suite benchmark pts/aio-stress

##Dbench is a benchmark designed by the Samba project as a free alternative to netbench, but dbench contains only file-system calls for testing the disk performance.
phoronix-test-suite benchmark pts/dbench

##The IOzone benchmark tests the hard disk drive / file-system performance.
phoronix-test-suite benchmark pts/iozone

##Compilebench tries to age a filesystem by simulating some of the disk IO common in creating, compiling, patching, stating and reading kernel trees. It indirectly measures how well filesystems can maintain directory locality as the disk fills up and directories age. This current test is setup to use the makej mode with 10 initial directories
phoronix-test-suite benchmark pts/compilebench

CPU Tests

##Smallpt is a C++ global illumination renderer written in less than 100 lines of code. Global illumination is done via unbiased Monte Carlo path tracing and there is multi-threading support via the OpenMP library.
phoronix-test-suite benchmark pts/smallpt

##This test measures the time needed to compress a file using Gzip compression.
phoronix-test-suite benchmark pts/compress-gzip
 
##Time how long it takes to calculate pi to varying lengths.
phoronix-test-suite benchmark pts/systester

##This is a benchmark of John The Ripper, which is a password cracker.
phoronix-test-suite benchmark pts/john-the-ripper

##This is a test of C-Ray, a simple raytracer designed to test the floating-point CPU performance. This test is multi-threaded (16 threads per core), will shoot 8 rays per pixel for anti-aliasing, and will generate a 1600 x 1200 image.
phoronix-test-suite benchmark pts/c-ray

##NPB, NAS Parallel Benchmarks, is a benchmark developed by NASA for high-end computer systems. This test profile currently uses the MPI version of NPB.
phoronix-test-suite benchmark pts/npb

##This is a test of ab, which is the Apache benchmark program. This test profile measures how many requests per second a given system can sustain when carrying out 700,000 requests with 100 requests being carried out concurrently.
phoronix-test-suite benchmark pts/apache

RAM / Cache Tests

##This benchmark tests the system memory (RAM) performance.
phoronix-test-suite benchmark pts/ramspeed

##This benchmark tests the system memory (RAM) performance.
phoronix-test-suite benchmark pts/stream

##CacheBench is designed to test the memory and cache bandwidth performance
phoronix-test-suite benchmark pts/cachebench 

##PHPBench is a benchmark suite for PHP. It performs a large number of simple tests in order to bench various aspects of the PHP interpreter. PHPBench can be used to compare hardware, operating systems, PHP versions, PHP accelerators and caches, compiler options, etc.
phoronix-test-suite benchmark pts/phpbench

IOzone

This will run a ton of IOzone tests, sleeping for 60 seconds in-between them

iozone -l 8 -i 0 -i 1 -i 2 -e -+n -r 4K -s 1G -O ;
sleep 60 ;
iozone -l 8 -i 0 -i 1 -i 2 -e -+n -r 4K -s 1G ;
sleep 60 ; 
iozone -e -s 12G -r 64K -t 1 -i 0 -i 1 -+n ; 
sleep 60 ; 
iozone -e -s 12G -r 64K -t 1 -i 0 -i 1 -+n ;
sleep 60 ; 
iozone -e -s 12G -r 64K -t 1 -i 0 -i 1 -+n ; 
sleep 60 ; 
iozone -t 1 -i 0 -i 1 -i 2 -e -+n -r 4K -s 12G -O ; 
sleep 60 ;
iozone -t 1 -i 0 -i 1 -i 2 -e -+n -r 4K -s 12G -O

IOzone commands

##Sequential Write, 64K requests, 32 threads:
iozone -I -t 32 -M -O -r 64k -s 500m -+u -w -i 0

##Sequential Read, 64K requests, 32 threads:
iozone -I -t 32 -M -O -r 64k -s 500m -+u -w -i 1

##Random Read/Write, 4K requests, 32 threads:
iozone -I -t 32 -M -O -r 4k -s 500m -+u -w -i 2

IOzone command line options

##Save output to spreadsheet
-b $filename

##Specify test types
-i [1-13]

    0=write/rewrite
    1=read/re-read
    2=random-read/write
    3=Read-backwards
    4=Re-write-record
    5=stride-read
    6=fwrite/re-fwrite
    7=fread/Re-fread,
    8=random mix
    9=pwrite/Re-pwrite
    10=pread/Re-pread
    11=pwritev/Re-pwritev
    12=preadv/Re-preadv

Specify the file size using iozone (file size used to test)
-s $number (1M, 512M, 4G, etc)

Specify the record size for testing
-r $number (1K, 4K, 64K, etc)

Throughput test
-t $threads

Increase the file size
-g $number (usually should be 3x amount of RAM)


Personal tests (work in progress). This should give a good measurement of sequencial reads and writes, the file size will need to be larger than RAM on the server, but 12GB is usually a good starting point.

##Use fsync,file size is 12GB, record size is 64K, use 1 thread for throughput, test read and write, no re-tests, save to file.

iozone -e -s 12G -r 64K -t 1 -i 0 -i 1 -+n -b 12GB_64K_RW.txt

##Use fsync,file size is 12GB, record size is 64K, use 1 thread for throughput, test read and write, no re-tests, save to file, output in OPS/s

iozone -e -s 12G -r 64K -t 1 -i 0 -i 1 -+n -O -b 12GB_64K_RW_OPS.txt

UnixBench Installation and Commands

To run a quick test with Unix bench, you simply need to wget the file, extract it and then use ./Run -i $Number of Runs. Each run can take between 10 and 30 minutes so if you just want a quick idea of performance use -i 1, if you want to run the test more times simply replace "1" with how many times you want to run the test.

apt-get install make gcc
wget https://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
tar zxvf UnixBench5.1.3.tgz
cd UnixBench
make
./Run -i 1

ioping Installation and Commands

The latest version of ioping can be found here -- https://code.google.com/p/ioping/downloads/list

To install and run ioping you can simply wget the file, extract it cd into the directory and run "./ioping". The -c option lets you specify the amount of times ioping will attempt a read request. The more times you let ioping request data, the more accurate the test results will be. The other option to specify is . the option after -c, this is the location to run the test. If you only have a single volume, using . will just run the test in your current directory. If you want to run the test in say, /home, you would use a command like this ./ioping -c 1000 /home/. If you want to run the ioping test in the current directory, replace /home/ with "."

wget https://ioping.googlecode.com/files/ioping-0.8.tar.gz
tar zxvf ioping-0.8.tar.gz
cd ioping-0.8/
make
make install
./ioping -c 1000 /home/

##To run ioping in current directory

./ioping -c 1000 .

By default, ioping will use 4KiB block size for each request. If you wish to change the way ioping runs tests you can modify the options shown below

Usage: ioping [-LABCDWRq] [-c count] [-w deadline] [-pP period] [-i interval]
               [-s size] [-S wsize] [-o offset] directory|file|device
        ioping -h | -v

      -c <count>      stop after <count> requests
      -w <deadline>   stop after <deadline>
      -p <period>     print raw statistics for every <period> requests
      -P <period>     print raw statistics for every <period> in time
      -i <interval>   interval between requests (1s)
      -s <size>       request size (4k)
      -S <wsize>      working set size (1m)
      -o <offset>     working set offset (0)
      -k              keep and reuse temporary working file
      -L              use sequential operations (includes -s 256k)
      -A              use asynchronous I/O
      -C              use cached I/O
      -D              use direct I/O
      -W              use write I/O *DANGEROUS*
      -R              seek rate test (same as -q -i 0 -w 3 -S 64m)
      -B              print final statistics in raw format
      -q              suppress human-readable output
      -h              display this message and exit
      -v              display version and exit

When ioping is finished, it will display this information. The most relevant information that ioping displays is iops and the average and mdev response time per request. The individual request stats will usually be in us (microsecond) if you have really fast storage, or ms (millisecond). Please keep in mind that a microsecond(us) is 1/1,000,000 of a second, and a millisecond(ms) is 1/1000 of a second. Another way to look at it is that there are 1000us in 1ms.

1000 requests completed in 1.7 min, 109 iops, 440.0 KiB/s
min/avg/max/mdev = 190 us / 9.1 ms / 291.1 ms / 41.7 ms

In the example above, ioping is telling me that on average I have a response time of 9.1ms, with a maximum response time of 291ms, and mdev of 41.7ms, which I believe means that a majority of responses fall under this response time. This is important to take note of, if the mdev is much higher than the average then it means there are some responses that are taking significantly more time to complete than others, depending on how frequently this happens your system could experience slowness or even lock up if there is significant IO happening all the time.

PerfKitBenchmarker

Google recently announced a new benchmarking framework that is meant to make it easier to benchmark cloud servers, or vps servers by including a ton of benchmarks within one easy to use utility.

To install PerfKitBenchmarker on Ubuntu 14.10 you can use git to clone the current build and use pip to install all the required dependencies. Please note that PerfKitBenchmarker is designed to be run from a remote computer. The idea is to let PerfKitBenchmarker connect via ssh key and test remote servers from a single location. This means you could setup a single VM somewhere and run the tests from that VM without having to login to all the remote servers you are testing. It is possible to run PerfKitBenchmarker on a local machine without connecting to the cloud.

apt-get install git python-pip python-dev
git clone https://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git
cd PerfKitBenchmarker/
pip install -r requirements.txt

Once you have finished installing perfkit you can cd into the perfkitbenchmarker directory, then run the pkb.py script to initiate benchmarks. There are a ton of options you can use with pkb.py, to view all the options run pkb.py --help

cd perfkitbenchmarker/
./pkb.py --help
./pkb.py run 

Benchmarks:
        aerospike:  Runs Aerospike
        block_storage_workload:  Runs FIO in sequential, random, read and write modes to simulate various scenarios.
        bonnie++:  Runs Bonnie++.
        cassandra_stress:  Benchmark Cassandra using cassandra-stress
        cluster_boot:  Create a cluster, record all times to boot
        copy_throughput:  Get cp and scp performance between vms.
        coremark:  Run Coremark a simple processor benchmark
        fio:  Runs fio in sequential, random, read and write modes.
        hadoop_terasort:  Runs Terasort
        hpcc:  Runs HPCC.
        iperf:  Run iperf
        mesh_network:  Measures VM to VM cross section bandwidth in a mesh network.
        mongodb:  Run YCSB against MongoDB.
        netperf:  Run TCP_RR, TCP_CRR, UDP_RR and TCP_STREAM Netperf benchmarks
        object_storage_service:  Object/blob storage service benchmarks.
        ping:  Benchmarks ping latency over internal IP addresses
        redis:  Run memtier_benchmark against Redis.
        speccpu2006:  Run Spec CPU2006
        sysbench_oltp:  Runs Sysbench OLTP
        unixbench:  Runs UnixBench.

Benchmark Sets:
        arm_set:  ARM benchmark set.
        mit_set:  Massachusetts Institute of Technology benchmark set.
        canonical_set:  Canonical benchmark set.
        google_set:  This benchmark set is maintained by Google Cloud Platform Performance Team.
        rackspace_set:  Rackspace benchmark set.
        stanford_set:  Stanford University benchmark set.
        thesys_technologies_set:  Thesys Technologies LLC. benchmark set.
        cloudspectator_set:  CloudSpectator benchmark set.
        cisco_set:  Cisco benchmark set.
        tradeworx_set:  Tradeworx Inc. benchmark set.
        mellanox_set:  Mellanox benchmark set.
        intel_set:  Intel benchmark set.
        microsoft_set:  Microsoft benchmark set.
        qualcomm_technologies_set:  Qualcomm Technologies, Inc. benchmark set.
        cloudharmony_set:  CloudHarmony benchmark set.
        ecocloud_epfl_set:  EcoCloud/EPFL benchmark set.
        red_hat_set:  Red Hat benchmark set.
        broadcom_set:  Broadcom benchmark set.
        centurylinkcloud_set:  This benchmark set is supported on CenturyLink Cloud.
        standard_set:  The standard_set is a community agreed upon set of benchmarks to measure Cloud performance.