More load testing with SysBench

Here is another load testing tool for web servers (mainly LAMP) although you could load test any nix based system. The tool is aimed at systems that run databases, so you would also want to run this against a DB server as well.

From the Sourceforge website:
The idea of this benchmark suite is to quickly get an impression about system performance without setting up complex database benchmarks or even without installing a database at all.

Current features allow to test the following system parameters:

  • file I/O performance
  • scheduler performance
  • memory allocation and transfer speed
  • POSIX threads implementation performance
  • database server performance (OLTP benchmark)

Found in most repos, you can install with a apt-get install or yum install – in this example I will install it onto a CentOS server.

 yum install sysbench 

Running the tool:
There are many options and tests to run such as CPU, Threads, Mutex, Memory, FileIO and MySQL.


 sysbench --test=cpu --cpu-max-prime=20000 run 


 sysbench --num-threads=64 --test=threads --thread-yields=100 --thread-locks=2 run 


sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw prep
sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw run
sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw cleanup

To measure MySQL performance, we first create a test table in the database test with 1,000,000 rows of data.

sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword prepare

Now you can run the MySQL benchmark as follows.

sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run

Clean up the system – remove the test table, run:

sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword cleanup

Reference, docs and more examples:


Bookmark the permalink.