1. install sysbench
>>>sudo apt-get update
>>>sudo apt-get install sysbench
2. CPU testing
>>> sysbench --test=cpu--cpu-max-prime=40000 run
>>> sysbench --test=cpu --cpu-max-prime=50000 --num-threads=4 run
3. File IO Performance Benchmarking
a. Prepare a 20 GB file to check the disk IO performance. This can be done using the command below.
>>> sysbench --test=fileio --file-total-size=20G prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
b. You should prepare a new file for each sysbench IO test that you run. This test file should be bigger than your RAM size (to avoid caching the file in memory during the benchmark). This step might take around 30 minutes, so you should use byobu/screen/tmux to avoid losing any work after disconnecting from the ssh.(see "how to disable ssh timeout" at http://blog.csdn.net/suiqiji206/article/details/50529408)
c. Now, run a benchmark that randomly reads and writes to this file. You should use the command:
>>> sysbench --test=fileio --file-total-size=20G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run
4. web server benchmarking
a. install apache2
>>> sudo apt-get install apache2
>>> sudo apt-get install apache2-utils
Verify that apache is running by visiting the Public DNS Address of your running instance on a web browser. You should see the following "It Works"page or a variant of it
b. test web server. eg. send 1000 requests to http://localhost/ with concurrency level of 100.
>>> ab -n 1000 -c 100 http://localhost/