Compare two database server configurations to find which handles more transactions per second under load.
Stress-test a MySQL or PostgreSQL server before putting it into production to find its breaking point.
Write a custom Lua benchmark script tailored to your application's specific query patterns.
Database tests require MySQL or PostgreSQL client libraries installed before building, Windows users must use WSL.
sysbench is a command-line tool for measuring how fast a computer system or database can work under load. Engineers and developers use it to run standardized tests against MySQL, PostgreSQL, or other databases, and to benchmark CPU speed, memory throughput, file system performance, and threading. The project has around 6,700 GitHub stars and is written mostly in C. The tool comes with several built-in tests you can run right away. The OLTP group of tests simulates typical database read and write operations, which is useful for comparing database setups or configurations. Separate tests cover raw CPU math, memory access patterns, file I/O, thread scheduling, and lock contention. Because each test is defined as a Lua script, you can also write your own custom benchmarks if the built-in ones do not match your scenario. Installing sysbench on Linux is straightforward: the maintainers publish ready-made packages for Debian, Ubuntu, RHEL, CentOS, Fedora, and Arch Linux via a package repository. On macOS, Homebrew provides an up-to-date package. Native Windows builds were dropped starting with version 1.0, the recommended approach on Windows is to use Windows Subsystem for Linux and then follow the Linux instructions. Building from source requires a C compiler, automake, libtool, and optionally the client libraries for MySQL or PostgreSQL if you want database support. The build process is a standard configure-then-make sequence. Once installed, you run sysbench by specifying a test name, a command such as prepare, run, or cleanup, and any options for thread count, duration, or test-specific settings. The output from a run includes rate statistics showing events per second alongside latency numbers, with percentile breakdowns and histograms. This makes it practical for capacity planning, for checking whether a configuration change improved throughput, or for stress-testing a database server before putting it into production.
← akopytov on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.