{"id":13438328,"url":"https://github.com/akopytov/sysbench","last_synced_at":"2025-05-15T00:05:59.632Z","repository":{"id":28293577,"uuid":"31806094","full_name":"akopytov/sysbench","owner":"akopytov","description":"Scriptable database and system performance benchmark","archived":false,"fork":false,"pushed_at":"2025-03-09T16:27:25.000Z","size":4834,"stargazers_count":6342,"open_issues_count":208,"forks_count":1109,"subscribers_count":182,"default_branch":"master","last_synced_at":"2025-05-07T23:30:53.877Z","etag":null,"topics":["benchmark","console","freebsd","linux","lua","luajit","macos","micro-benchmarks","mysql","oltp","postgresql","sysbench"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akopytov.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-07T08:27:40.000Z","updated_at":"2025-05-07T19:38:05.000Z","dependencies_parsed_at":"2025-03-25T17:10:29.191Z","dependency_job_id":"b93db1e0-488b-4825-a065-03b8245991b0","html_url":"https://github.com/akopytov/sysbench","commit_stats":{"total_commits":1021,"total_committers":50,"mean_commits":20.42,"dds":0.1194906953966699,"last_synced_commit":"de18a036cc65196b1a4966d305f33db3d8fa6f8e"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akopytov%2Fsysbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akopytov%2Fsysbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akopytov%2Fsysbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akopytov%2Fsysbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akopytov","download_url":"https://codeload.github.com/akopytov/sysbench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249199,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","console","freebsd","linux","lua","luajit","macos","micro-benchmarks","mysql","oltp","postgresql","sysbench"],"created_at":"2024-07-31T03:01:04.572Z","updated_at":"2025-05-15T00:05:59.535Z","avatar_url":"https://github.com/akopytov.png","language":"C","readme":"[![Latest Release][release-badge]][release-url]\n[![Build Status][action-badge]][action-url]\n[![Debian Packages][deb-badge]][deb-url]\n[![RPM Packages][rpm-badge]][rpm-url]\n[![Coverage Status][coveralls-badge]][coveralls-url]\n[![License][license-badge]][license-url]\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again --\u003e\n**Table of Contents**\n\n- [sysbench](#sysbench)\n    - [Features](#features)\n- [Installing from Binary Packages](#installing-from-binary-packages)\n    - [Linux](#linux)\n    - [macOS](#macos)\n    - [Windows](#windows)\n- [Building and Installing From Source](#building-and-installing-from-source)\n    - [Build Requirements](#build-requirements)\n        - [Windows](#windows)\n        - [Debian/Ubuntu](#debianubuntu)\n        - [RHEL/CentOS](#rhelcentos)\n        - [Fedora](#fedora)\n        - [macOS](#macos)\n    - [Build and Install](#build-and-install)\n- [Usage](#usage)\n    - [General Syntax](#general-syntax)\n    - [General Command Line Options](#general-command-line-options)\n    - [Random Numbers Options](#random-numbers-options)\n- [Versioning](#versioning)\n\n\u003c!-- markdown-toc end --\u003e\n\n# sysbench\n\nsysbench is a scriptable multi-threaded benchmark tool based on\nLuaJIT. It is most frequently used for database benchmarks, but can also\nbe used to create arbitrarily complex workloads that do not involve a\ndatabase server.\n\nsysbench comes with the following bundled benchmarks:\n\n- `oltp_*.lua`: a collection of OLTP-like database benchmarks\n- `fileio`: a filesystem-level benchmark\n- `cpu`: a simple CPU benchmark\n- `memory`: a memory access benchmark\n- `threads`: a thread-based scheduler benchmark\n- `mutex`: a POSIX mutex benchmark\n\n## Features\n\n- extensive statistics about rate and latency is available, including\n  latency percentiles and histograms;\n- low overhead even with thousands of concurrent threads. sysbench is\n  capable of generating and tracking hundreds of millions of events per\n  second;\n- new benchmarks can be easily created by implementing pre-defined hooks\n  in user-provided Lua scripts;\n- can be used as a general-purpose Lua interpreter as well, simply\n  replace `#!/usr/bin/lua` with `#!/usr/bin/sysbench` in your script.\n\n# Installing from Binary Packages\n\n## Linux\n\nThe easiest way to download and install sysbench on Linux is using\nbinary package repositories hosted by\n[packagecloud](https://packagecloud.io). The repositories are\nautomatically updated on each sysbench release. Currently x86_64, i386\nand aarch64 binaries are available.\n\nMultiple methods to download and install sysbench packages are available and\ndescribed at \u003chttps://packagecloud.io/akopytov/sysbench/install\u003e.\n\nQuick install instructions:\n\n- Debian/Ubuntu\n  ``` shell\n  curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash\n  sudo apt -y install sysbench\n  ```\n\n- RHEL/CentOS:\n  ``` shell\n  curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | sudo bash\n  sudo yum -y install sysbench\n  ```\n\n- Fedora:\n  ``` shell\n  curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | sudo bash\t\n  sudo dnf -y install sysbench\n  ```\n\n- Arch Linux:\n  ``` shell\n  sudo pacman -Suy sysbench\n  ```\n\n## macOS\n\nOn macOS, up-to-date sysbench packages are available from Homebrew:\n```shell\n# Add --with-postgresql if you need PostgreSQL support\nbrew install sysbench\n```\n\n## Windows\nAs of sysbench 1.0 support for native Windows builds was dropped. It may\nbe re-introduced in later releases. Currently, the recommended way to\nobtain sysbench on Windows is\nusing\n[Windows Subsystem for Linux available in Windows 10](https://msdn.microsoft.com/en-us/commandline/wsl/about).\n\nAfter installing WSL and getting into he bash prompt on Windows\nfollowing Debian/Ubuntu installation instructions is\nsufficient. Alternatively, one can use WSL to build and install sysbench\nfrom source, or use an older sysbench release to build a native binary.\n\n# Building and Installing From Source\n\nIt is recommended to install sysbench from the official binary\npackages as described in\n[Installing from Binary Packages](#installing-from-binary-packages). Below\nare instruction for cases when you want to use sysbench on an\narchitecture for which no binary packages are available.\n\n## Build Requirements\n\n### Windows\nAs of sysbench 1.0 support for native Windows builds was\ndropped. It may be re-introduced in later versions. Currently, the\nrecommended way to build sysbench on Windows is using\n[Windows Subsystem for Linux available in Windows 10](https://msdn.microsoft.com/en-us/commandline/wsl/about).\n\nAfter installing WSL and getting into bash prompt on Windows, following\nDebian/Ubuntu build instructions is sufficient. Alternatively, one can\nbuild and use an older 0.5 release on Windows.\n\n### Debian/Ubuntu\n``` shell\n    apt -y install make automake libtool pkg-config libaio-dev\n    # For MySQL support\n    apt -y install libmysqlclient-dev libssl-dev\n    # For PostgreSQL support\n    apt -y install libpq-dev\n```\n\n### RHEL/CentOS\n``` shell\n    yum -y install make automake libtool pkgconfig libaio-devel\n    # For MySQL support, replace with mysql-devel on RHEL/CentOS 5\n    yum -y install mariadb-devel openssl-devel\n    # For PostgreSQL support\n    yum -y install postgresql-devel\n```\n\n### Fedora\n``` shell\n    dnf -y install make automake libtool pkgconfig libaio-devel\n    # For MySQL support\n    dnf -y install mariadb-devel openssl-devel\n    # For PostgreSQL support\n    dnf -y install postgresql-devel\n```\n\n### macOS\n\nAssuming you have Xcode (or Xcode Command Line Tools) and Homebrew installed:\n``` shell\n    brew install automake libtool openssl pkg-config\n    # For MySQL support\n    brew install mysql\n    # For PostgreSQL support\n    brew install postgresql\n    # openssl is not linked by Homebrew, this is to avoid \"ld: library not found for -lssl\"\n    export LDFLAGS=-L/usr/local/opt/openssl/lib \n```\n\n## Build and Install\n``` shell\n    ./autogen.sh\n    # Add --with-pgsql to build with PostgreSQL support\n    ./configure\n    make -j\n    make install\n```\n\nThe above will build sysbench with MySQL support by default. If you have\nMySQL headers and libraries in non-standard locations (and no\n`mysql_config` can be found in the `PATH`), you can specify them\nexplicitly with `--with-mysql-includes` and `--with-mysql-libs` options\nto `./configure`.\n\nTo compile sysbench without MySQL support, use `--without-mysql`. If no\ndatabase drivers are available database-related scripts will not work,\nbut other benchmarks will be functional.\n\n# Usage\n\n## General Syntax\n\nThe general command line syntax for sysbench is:\n\n\t\t  sysbench [options]... [testname] [command] \n\n- *testname* is an optional name of a built-in test (e.g. `fileio`,\n  `memory`, `cpu`, etc.), or a name of one of the bundled Lua scripts\n  (e.g. `oltp_read_only`), or a *path* to a custom Lua script. If no\n  test name is specified on the command line (and thus, there is no\n  *command* too, as in that case it would be parsed as a *testname*), or\n  the test name is a dash (\"`-`\"), then sysbench expects a Lua script to\n  execute on its standard input.\n\n- *command* is an optional argument that will be passed by sysbench to\n  the built-in test or script specified with *testname*. *command*\n  defines the *action* that must be performed by the test. The list of\n  available commands depends on a particular test. Some tests also\n  implement their own custom commands.\n\n  Below is a description of typical test commands and their purpose:\n\n\t+ `prepare`: performs preparative actions for those tests which need\n\tthem, e.g. creating the necessary files on disk for the `fileio`\n\ttest, or filling the test database for database benchmarks.\n\t+ `run`: runs the actual test specified with the *testname*\n    argument. This command is provided by all tests.\n\t+ `cleanup`: removes temporary data after the test run in those\n    tests which create one.\n\t+ `help`: displays usage information for the test specified with the\n\t*testname* argument. This includes the full list of commands\n\tprovided by the test, so it should be used to get the available\n\tcommands.\n\n- *options* is a list of zero or more command line options starting with\n\t`'--'`. As with commands, the `sysbench testname help` command\n\tshould be used to describe available options provided by a\n\tparticular test.\n\n\tSee [General command line options](README.md#general-command-line-options)\n\tfor a description of general options provided by sysbench itself.\n\n\nYou can use `sysbench --help` to display the general command line syntax\nand options.\n\n## General Command Line Options\n\nThe table below lists the supported common options, their descriptions and default values:\n\n*Option*              | *Description* | *Default value*\n----------------------|---------------|----------------\n| `--threads`           | The total number of worker threads to create                                                                                                                                                                                                                                                                                                                                                                                                                            | 1               |\n| `--events`            | Limit for total number of requests. 0 (the default) means no limit                                                                                                                                                                                                                                                                                                                                                                                                      | 0               |\n| `--time`              | Limit for total execution time in seconds. 0 means no limit                                                                                                                                                                                                                                                                                                                                                                                                             | 10              |\n| `--warmup-time`       | Execute events for this many seconds with statistics disabled before the actual benchmark run with statistics enabled. This is useful when you want to exclude the initial period of a benchmark run from statistics. In many benchmarks, the initial period is not representative because CPU/database/page and other caches need some time to warm up                                                                                                                                                                                                                                                                                                  | 0               |\n| `--rate`              | Average transactions rate. The number specifies how many events (transactions) per seconds should be executed by all threads on average. 0 (default) means unlimited rate, i.e. events are executed as fast as possible                                                                                                                                                                                                                                                                 | 0               |\n| `--thread-init-timeout` | Wait time in seconds for worker threads to initialize                                                                                                                                                                                                                                                                                                                                                                                                                  | 30              |\n| `--thread-stack-size` | Size of stack for each thread                                                                                                                                                                                                                                                                                                                                                                                                                                           | 32K             |\n| `--report-interval`   | Periodically report intermediate statistics with a specified interval in seconds. Note that statistics produced by this option is per-interval rather than cumulative. 0 disables intermediate reports                                                                                                                                                                                                                                                                  | 0               |\n| `--debug`             | Print more debug info                                                                                                                                                                                                                                                                                                                                                                                                                                                   | off             |\n| `--validate`          | Perform validation of test results where possible                                                                                                                                                                                                                                                                                                                                                                                                                       | off             |\n| `--help`              | Print help on general syntax or on a specified test, and exit                                                                                                                                                                                                                                                                                                                                                                                                           | off             |\n| `--verbosity`         | Verbosity level (0 - only critical messages, 5 - debug)                                                                                                                                                                                                                                                                                                                                                                                                                 | 4               |\n| `--percentile`        | sysbench measures execution times for all processed requests to display statistical information like minimal, average and maximum execution time. For most benchmarks it is also useful to know a request execution time value matching some percentile (e.g. 95% percentile means we should drop 5% of the most long requests and choose the maximal value from the remaining ones). This option allows to specify a percentile rank of query execution times to count | 95              |\n| `--luajit-cmd`        | perform a LuaJIT control command. This option is equivalent to `luajit -j`. See [LuaJIT documentation](http://luajit.org/running.html#opt_j) for more information                                                                                                                                                                                                                                                                                                       |               |\n\nNote that numerical values for all *size* options (like `--thread-stack-size` in this table) may be specified by appending the corresponding multiplicative suffix (K for kilobytes, M for megabytes, G for gigabytes and T for terabytes).\n\n## Random Numbers Options\n\nsysbench provides a number of algorithms to generate random numbers that are distributed according to a given probability distribution. The table below lists options that can be used to control those algorithms.\n\n*Option*              | *Description* | *Default value*\n----------------------|---------------|----------------\n`--rand-type` | random numbers distribution {uniform, gaussian, special, pareto, zipfian} to use by default. Benchmark scripts may choose to use either the default distribution, or specify it explictly, i.e. override the default. | special\n`--rand-seed` | seed for random number generator. When 0, the current time is used as an RNG seed. | 0\n`--rand-spec-iter` | number of iterations for the special distribution | 12\n`--rand-spec-pct` | percentage of the entire range where 'special' values will fall in the special distribution | 1\n`--rand-spec-res` | percentage of 'special' values to use for the special distribution | 75\n`--rand-pareto-h` | shape parameter for the Pareto distribution | 0.2\n`--rand-zipfian-exp` | shape parameter (theta) for the Zipfian distribution | 0.8\n\n# Versioning\n\nFor transparency and insight into its release cycle, and for striving to maintain backward compatibility, sysbench will be maintained under the Semantic Versioning guidelines as much as possible.\n\nReleases will be numbered with the following format:\n\n`\u003cmajor\u003e.\u003cminor\u003e.\u003cpatch\u003e`\n\nAnd constructed with the following guidelines:\n\n* Breaking backward compatibility bumps the major (and resets the minor and patch)\n* New additions without breaking backward compatibility bumps the minor (and resets the patch)\n* Bug fixes and misc changes bumps the patch\n\nFor more information on SemVer, please visit [http://semver.org/](http://semver.org/).\n\n[coveralls-badge]: https://coveralls.io/repos/github/akopytov/sysbench/badge.svg?branch=master\n[coveralls-url]: https://coveralls.io/github/akopytov/sysbench?branch=master\n[action-url]: https://github.com/akopytov/sysbench/actions/workflows/ci.yml\n[action-badge]: https://github.com/akopytov/sysbench/actions/workflows/ci.yml/badge.svg\n[license-badge]: https://img.shields.io/badge/license-GPLv2-blue.svg\n[license-url]: COPYING\n[release-badge]: https://img.shields.io/github/release/akopytov/sysbench.svg\n[release-url]: https://github.com/akopytov/sysbench/releases/latest\n[deb-badge]: https://img.shields.io/badge/Packages-Debian-red.svg?style=flat\n[deb-url]: https://packagecloud.io/akopytov/sysbench?filter=debs\n[rpm-badge]: https://img.shields.io/badge/Packages-RPM-blue.svg?style=flat\n[rpm-url]: https://packagecloud.io/akopytov/sysbench?filter=rpms\n","funding_links":[],"categories":["C","HarmonyOS","性能测试","Benchmarks","数据库管理系统","postgresql","Benchmarking"],"sub_categories":["Windows Manager","网络服务_其他","其他性能测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakopytov%2Fsysbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakopytov%2Fsysbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakopytov%2Fsysbench/lists"}