gitwtfhub

wtf is sysbench?

akopytov/sysbench — explained in plain English

Analysis updated 2026-06-24

6,733CAudience · ops devopsComplexity · 2/5Setup · moderate

TL;DR

A command-line tool for benchmarking databases and system hardware, CPU, memory, file I/O, and database queries, used by engineers to compare configurations or stress-test servers before production.

Mindmap

mindmap
  root((sysbench))
    What it does
      System benchmarking
      Database load testing
    Built-in tests
      OLTP read write
      CPU memory file I/O
    Custom tests
      Lua scripting
      Any query pattern
    Output
      Events per second
      Latency percentiles

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Compare two database server configurations to find which handles more transactions per second under load.

REASON 2

Stress-test a MySQL or PostgreSQL server before putting it into production to find its breaking point.

REASON 3

Write a custom Lua benchmark script tailored to your application's specific query patterns.

What's in the stack?

CLuaMySQLPostgreSQL

How it stacks up

akopytov/sysbenchrubymetric/chsrctelegrammessenger/mtproxy
Stars6,7336,7206,760
LanguageCCC
Setup difficultymoderateeasymoderate
Complexity2/51/53/5
Audienceops devopsdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Database tests require MySQL or PostgreSQL client libraries installed before building, Windows users must use WSL.

No explicit license is stated in the repository description.

Wtf does this do

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.

Yoink these prompts

Prompt 1
How do I install sysbench on Ubuntu and run the OLTP read-write benchmark against a local MySQL database with 8 threads for 60 seconds?
Prompt 2
Walk me through using sysbench to benchmark disk I/O on a Linux server, prepare, run, and cleanup steps with example output explained.
Prompt 3
How do I write a custom sysbench Lua script to benchmark a specific SQL query pattern that the built-in OLTP tests don't cover?
Prompt 4
Show me how to interpret sysbench output: what do the latency percentiles and events-per-second numbers actually mean for capacity planning?

Frequently asked questions

wtf is sysbench?

A command-line tool for benchmarking databases and system hardware, CPU, memory, file I/O, and database queries, used by engineers to compare configurations or stress-test servers before production.

What language is sysbench written in?

Mainly C. The stack also includes C, Lua, MySQL.

What license does sysbench use?

No explicit license is stated in the repository description.

How hard is sysbench to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is sysbench for?

Mainly ops devops.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.