Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC-574][ysql] update benchmark doc - sysbench page #25194

Merged
merged 11 commits into from
Dec 26, 2024
110 changes: 73 additions & 37 deletions docs/content/preview/benchmark/sysbench-ysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,36 @@ sysbench is a popular tool for benchmarking databases like PostgreSQL and MySQL,

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

### Install sysbench

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

<ul class="nav nav-tabs nav-tabs-yb">
<li>
<a href="#github" class="nav-link active" id="github-tab" data-bs-toggle="tab" role="tab" aria-controls="github" aria-selected="true">
<i class="fab fa-github" aria-hidden="true"></i>
Source
</a>
</li>
<li>
<a href="#rhel" class="nav-link" id="rhel-tab" data-bs-toggle="tab" role="tab" aria-controls="rhel" aria-selected="true">
<i class="fa-brands fa-redhat" aria-hidden="true"></i>
RHEL
</a>
</li>
<li >
<a href="#macos" class="nav-link" id="macos-tab" data-bs-toggle="tab" role="tab" aria-controls="macos" aria-selected="true">
<i class="fa-brands fa-apple" aria-hidden="true"></i>
macOS
</a>
</li>

</ul>

<div class="tab-content">
<div id="github" class="tab-pane fade show active" role="tabpanel" aria-labelledby="github-tab">

Install sysbench using the following steps:

```sh
Expand All @@ -39,55 +69,63 @@ Make sure you have the [YSQL shell](../../api/ysqlsh/) `ysqlsh` exported to the
$ export PATH=$PATH:/path/to/ysqlsh
```

### Start YugabyteDB
</div>

Start your YugabyteDB cluster by following the steps in [Manual deployment](../../deploy/manual-deployment/).
<div id="rhel" class="tab-pane fade" role="tabpanel" aria-labelledby="rhel-tab">

{{< tip title="Tip" >}}
You will need the IP addresses of the nodes in the cluster for the next step.
{{< /tip>}}
```sh
wget https://github.com/yugabyte/sysbench/releases/download/1.0.0-yb/sysbench-1.0.0-1.el8.x86_64.rpm

### Run the benchmark
sudo yum install -y sysbench-1.0.0-1.el8.x86_64.rpm
```

Run the `run_sysbench.sh` shell script to load the data and run the various workloads:
</div>
<div id="macos" class="tab-pane fade" role="tabpanel" aria-labelledby="macos-tab">

```sh
./run_sysbench.sh --ip <ip>
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 script runs all 8 workloads using 64 threads with the number of tables as 10 and the table size as 100k.
</div>

If you want to run the benchmark with a different count of tables and tablesize, do the following:
</div>

```sh
./run_sysbench.sh --ip <ip> --numtables <number of tables> --tablesize <number of rows in each table>
```
### Start YugabyteDB

### Run individual workloads (optional)
Start your YugabyteDB cluster by following the steps in [Manual deployment](../../deploy/manual-deployment/).

{{< tip title="Tip" >}}
You will need the IP addresses of the nodes in the cluster for the next step.
{{< /tip>}}

### Run individual workloads

You can choose to run the following workloads individually:

* oltp_insert
* oltp_point_select
* oltp_write_only
* 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> \
--tables=10 \
--table-size=100000 \
--range_key_partitioning=true \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=5433 \
--pgsql-user=yugabyte \
--pgsql-db=yugabyte \
$ sysbench <workload> \
--tables=10 \
--table-size=100000 \
--range_key_partitioning=true \
--db-driver=pgsql \
--pgsql-host=<comma-separated-ips> \
--pgsql-port=5433 \
--pgsql-user=yugabyte \
--pgsql-db=yugabyte \
prepare
```

Expand All @@ -111,17 +149,15 @@ $ sysbench <workload> \

## Expected results

The following results are for a 3-node cluster with each node on a c5.4xlarge AWS instance (16 cores, 32 GB of RAM, and 2 EBS volumes), all in the same AZ with the client VM running in the same AZ.
The following results are for a 3-node cluster, 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.
sudhanshu456 marked this conversation as resolved.
Show resolved Hide resolved

### 10 tables each with 100k rows

| Workload | Throughput (txns/sec) | Latency (ms) |
| :-------------------- | :-------------------- | :----------- |
| OLTP_READ_ONLY | 3276 | 39 |
| OLTP_READ_WRITE | 487 | 265 |
| OLTP_WRITE_ONLY | 1818 | 70 |
| OLTP_POINT_SELECT | 95695 | 1.3 |
| OLTP_INSERT | 6348 | 20.1 |
| OLTP_UPDATE_INDEX | 4052 | 31 |
| OLTP_UPDATE_NON_INDEX | 11496 | 11 |
| OLTP_DELETE | 67499 | 1.9 |
| Workload | Throughput(txns/sec) | Latency(ms) |
| --------------------- | -------------------- | ----------- |
| oltp_read_only | 36150 | 1.6 |
| oltp_read_write | 2150 | 11.1 |
| oltp_multi_insert | 5450 | 4.4 |
| oltp_update_index | 2420 | 9.8 |
| oltp_update_non_index | | |
sudhanshu456 marked this conversation as resolved.
Show resolved Hide resolved
| oltp_delete | | |