Comments on How to Benchmark Your System (CPU, File IO, MySQL) with Sysbench

How to benchmark your system (CPU, File IO, MySQL) with sysbench. Sysbench is a benchmark suite which allows you to quickly get an impression about system performance which is important if you plan to run a database under intensive load. This article explains how to benchmark your CPU, file IO, and MySQL performance with sysbench.

14 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Michael

For the three MySQL tests, I needed to add --db-driver=mysql

By: Anonymous

Thanks alot, this solved my problem

By: perok

Dead link: http://sysbench.sourceforge.net/

New link: https://github.com/akopytov/sysbench/

By: Paul M

yes, please update the link!

By: Jonathan Hartley

On your file io benchmark, you specify "--max-time=300", and the test output includes:

    Time limit exceeded, exiting...        total time:                          300.0975s

Doesn't this mean that you didn't measure the actual IO speed, but instead the test just timed out, so the total time measured is almost meaningless?

By: Jonn Marc Vistal

sysbench 0.4.12 is what you got by default from ubuntu/fedora repo. You might need to check this article https://www.percona.com/blog/2014/09/02/using-sysbench-0-5-benchmark-mysql-whats-changed-latest-release/ the author here emphasize the change made to oltp test option and the new feature to use lua scripting to write your own load tests.

The latest sysbench version is 5.0, we could get if from lefred or https://github.com/akopytov/sysbench

By: Kim Son Vu

MySQL database name. Note SysBench will not automatically create this database. You should create it manually and grant the appropriate privileges to a user which will be used to access the test table.

By: Vu Kim Son

You should change this to:

sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=database --mysql-user=database_user --mysql-password=password --db-driver=mysql prepare

 

By: xtof

Thanks for this article, useful stuff.

By: cesar

Hello. Can someone explain me about the parameter --cpu-max-prime ???? ([email protected])

By: Faizal

Hello everyone,

Anyone can explain me, why the result of sysbench always different among several trial/test?

By: Matthias

If sysbench mysql test comes up with message: FATAL: unable to connect to MySQL server, aborting...FATAL: error 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)FATAL: failed to connect to database server!

 

Try to specify the socket file by adding:  --mysql-socket=/var/lib/mysql/mysql.sock (or Path to Socket File)

 

sysbench --test=oltp --mysql-db=test --mysql-socket=/var/lib/mysql/mysql.sock --mysql-user=root --mysql-password=xxxxxxxx cleanup

 

By: Tyler

Hi, All tests, ecept for MySQL, execute perfectly. I modified my lines to append the output and display while running:MySQL errors:

No DB drivers specified, using mysql

FATAL: unable to connect to MySQL server, aborting...

FATAL: error 1049: Unknown database 'test'

ALERT: Error: failed to determine table 'sbtest' type!

ALERT: MySQL error: Unknown database 'test'

FATAL: failed to get database capabilities!

sysbench 0.4.12:  multi-threaded system evaluation benchmark

Please advise on how to correct this, as MySQL is a big indicator of my web-server performance.Also, where can we find acceptable ranges / charts for these results to interpret?- Tyler

By: Tyler

My apologies, here's the three failure outputs:

FATAL: unable to connect to MySQL server, aborting...

FATAL: error 1049: Unknown database 'database'

FATAL: failed to connect to database server!

sysbench 0.4.12:  multi-threaded system evaluation benchmark

 

No DB drivers specified, using mysql

FATAL: unable to connect to MySQL server, aborting...

FATAL: error 1049: Unknown database 'test'

ALERT: Error: failed to determine table 'sbtest' type!

ALERT: MySQL error: Unknown database 'test'

FATAL: failed to get database capabilities!

sysbench 0.4.12:  multi-threaded system evaluation benchmark

 

No DB drivers specified, using mysql

FATAL: unable to connect to MySQL server, aborting...

FATAL: error 1049: Unknown database 'test'

FATAL: failed to connect to database server!