explaingit

akopytov/sysbench

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

TLDR

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
Click or tap to explore — scroll the page freely

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

Things people build with this

USE CASE 1

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

USE CASE 2

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

USE CASE 3

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

Tech stack

CLuaMySQLPostgreSQL

Getting it running

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.

In plain English

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.

Copy-paste 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?
Open on GitHub → Explain another repo

← akopytov on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.