---
title: "sysbench"
url: "https://docs.yugabyte.com/stable/benchmark/sysbench-ysql/"
---

# sysbench

Benchmark YSQL performance using sysbench.

Benchmark YSQL performance using sysbench

sysbench is a popular tool for benchmarking databases like PostgreSQL and MySQL, as well as system capabilities like CPU, memory, and I/O. The [YugabyteDB version of sysbench](https://github.com/yugabyte/sysbench "YugabyteDB version of sysbench") is forked from the [official version](https://github.com/akopytov/sysbench "official version") with a few modifications to better reflect YugabyteDB's distributed nature.

## Running the benchmark

### Prerequisites

To ensure the recommended hardware requirements are met and the database is correctly configured before benchmarking, review the [deployment checklist](/stable/deploy/checklist/ "deployment checklist").

### Install sysbench

Install sysbench on a machine which satisfies the Prerequisites using one of the following options:

- [Source](#github)
- [RHEL](#rhel)
- [macOS](#macos)

Install sysbench using the following steps:

```sh
$ cd $HOME
$ git clone https://github.com/yugabyte/sysbench.git
$ cd sysbench
$ ./autogen.sh && ./configure --with-pgsql && make -j && sudo make install
```

Note

RHEL package is only for EL8

```sh
wget https://github.com/yugabyte/sysbench/releases/download/1.0.0-yb/sysbench-1.0.0-1.el8.x86_64.rpm

sudo yum install -y sysbench-1.0.0-1.el8.x86_64.rpm
```

Note

The MacOS package is only for Apple Silicon.

```sh
brew install postgresql@14 wget

wget https://github.com/yugabyte/sysbench/releases/download/1.0.0-yb/Sysbench.pkg

sudo  installer -pkg Sysbench.pkg -target /
```

This installs the sysbench utility in `/usr/local/bin`.

### Start YugabyteDB

Start your YugabyteDB cluster by following the steps in [Manual deployment](/stable/deploy/manual-deployment/ "Manual deployment").

Tip

You will need the IP addresses of the nodes in the cluster for the next step.

### Run individual workloads

You can choose to run the following workloads individually:

- oltp\_read\_only
- oltp\_read\_write
- oltp\_multi\_insert
- oltp\_update\_index
- oltp\_update\_non\_index
- oltp\_delete

Before starting the workload, load the data as follows:

```sh
sysbench <workload> \
  --pgsql-host=<comma-separated-ips> \
  --tables=20 \
  --table_size=5000000 \
  --range_key_partitioning=false \
  --serial_cache_size=1000 \
  --create_secondary=true \
  --pgsql-db=yugabyte \
  --pgsql-user=yugabyte \
  --db-driver=pgsql \
  --pgsql-port=5433 \
  prepare
```

Run a workload as follows:

```sh
sysbench <workload> \
  --pgsql-host=<comma-separated-ips> \
  --tables=20 \
  --table_size=5000000  \
  --range_key_partitioning=false \
  --serial_cache_size=1000 \
  --create_secondary=true \
  --pgsql-db=yugabyte \
  --pgsql-user=yugabyte \
  --db-driver=pgsql \
  --pgsql-port=5433 \
  --time=1800 \
  --warmup-time=300 \
  --num_rows_in_insert=10 \
  --point_selects=10 \
  --index_updates=10 \
  --non_index_updates=10 \
  --range_selects=false \
  --thread-init-timeout=90 \
  --threads=60 \
  run
```

## Expected results

The following results are for a 3-node cluster running YBDB version 2026.1.2, with each node running on a c5.2xlarge AWS instance (8 cores, 16 GiB of RAM), all in the same AZ, with a replication factor of 3 and TLS enabled.

### 10 tables each with 100k rows

Workload Benchmark Statistics Per Query Statistics Queries executed in each transaction 

Throughput (txns/sec) Latency (ms) - avg Throughput (queries/sec) Latency (ms) - avg 

oltp\_read\_only 4616.32 13 46163.2 1.3 10 point selects 

oltp\_read\_write 245.49 97.76 7855.68 3.05 10 point selects  
10 index updates  
10 non-index update  
1 Insert  
1 Delete 

oltp\_multi\_insert 585.66 40.98 5856.6 4.09 10 Insert 

oltp\_update\_index 259.64 92.43 2596.4 9.43 10 index updates

The *Queries executed in each transaction* column shows the individual queries that are executed as part of each sysbench transaction, for each workload. These queries impact the overall transaction performance and are key to understanding the workload distribution for different sysbench benchmarks.
