Skip to content

Commit

Permalink
[DOC-574][ysql] update benchmark doc - sysbench page (#25194)
Browse files Browse the repository at this point in the history
* update sysbench docs, add alternative options for sysbench install

* remove latest release text

* use inline content instead of separate files

* correct the alignment of slashes

* shift the sysbench result per release version

* minor edit

* add rest of the releases results

* add specific versions with build number

* use short format

---------

Co-authored-by: Dwight Hodge <ghodge@yugabyte.com>
  • Loading branch information
sudhanshu456 and ddhodge authored Dec 26, 2024
1 parent da7fe7d commit 63f9ba0
Show file tree
Hide file tree
Showing 6 changed files with 464 additions and 282 deletions.
117 changes: 75 additions & 42 deletions docs/content/preview/benchmark/sysbench-ysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,42 @@ 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/).

Make sure you have the [YSQL shell](../../api/ysqlsh/) `ysqlsh` exported to the `PATH` variable.

```sh
$ export PATH=$PATH:/path/to/ysqlsh
```

### 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 @@ -31,63 +67,64 @@ $ cd sysbench
$ ./autogen.sh && ./configure --with-pgsql && make -j && sudo make install
```

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

Make sure you have the [YSQL shell](../../api/ysqlsh/) ysqlsh exported to the `PATH` variable.
<div id="rhel" class="tab-pane fade" role="tabpanel" aria-labelledby="rhel-tab">

```sh
$ export PATH=$PATH:/path/to/ysqlsh
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
```

### Start YugabyteDB
</div>
<div id="macos" class="tab-pane fade" role="tabpanel" aria-labelledby="macos-tab">

Start your YugabyteDB cluster by following the steps in [Manual deployment](../../deploy/manual-deployment/).
```sh
brew install postgresql@14 wget

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

### Run the benchmark
sudo installer -pkg Sysbench.pkg -target /
```

Run the `run_sysbench.sh` shell script to load the data and run the various workloads:
</div>

```sh
./run_sysbench.sh --ip <ip>
```
</div>

This script runs all 8 workloads using 64 threads with the number of tables as 10 and the table size as 100k.
This installs the sysbench utility in `/usr/local/bin`.

If you want to run the benchmark with a different count of tables and tablesize, do the following:
### Start YugabyteDB

```sh
./run_sysbench.sh --ip <ip> --numtables <number of tables> --tablesize <number of rows in each table>
```
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 (optional)
### 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 +148,13 @@ $ 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 running YBDB version {{< yb-version version="preview" format="short">}}, 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 | 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 | 48980 | 1.22 |
| oltp_read_write | 2380 | 10 |
| oltp_multi_insert | 5850 | 4.1 |
| oltp_update_index | 2550 | 9.41 |
117 changes: 75 additions & 42 deletions docs/content/stable/benchmark/sysbench-ysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,42 @@ 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/).

Make sure you have the [YSQL shell](../../api/ysqlsh/) `ysqlsh` exported to the `PATH` variable.

```sh
$ export PATH=$PATH:/path/to/ysqlsh
```

### 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 @@ -29,63 +65,64 @@ $ cd sysbench
$ ./autogen.sh && ./configure --with-pgsql && make -j && sudo make install
```

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

Make sure you have the [YSQL shell](../../api/ysqlsh/) `ysqlsh` exported to the `PATH` variable.
<div id="rhel" class="tab-pane fade" role="tabpanel" aria-labelledby="rhel-tab">

```sh
$ export PATH=$PATH:/path/to/ysqlsh
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
```

### Start YugabyteDB
</div>
<div id="macos" class="tab-pane fade" role="tabpanel" aria-labelledby="macos-tab">

Start your YugabyteDB cluster by following the steps in [Manual deployment](../../deploy/manual-deployment/).
```sh
brew install postgresql@14 wget

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

### Run the benchmark
sudo installer -pkg Sysbench.pkg -target /
```

Run the `run_sysbench.sh` shell script to load the data and run the various workloads:
</div>

```sh
./run_sysbench.sh --ip <ip>
```
</div>

This script runs all 8 workloads using 64 threads with the number of tables as 10 and the table size as 100k.
This installs the sysbench utility in `/usr/local/bin`.

If you want to run the benchmark with a different count of tables and tablesize, do the following:
### Start YugabyteDB

```sh
./run_sysbench.sh --ip <ip> --numtables <number of tables> --tablesize <number of rows in each table>
```
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 (optional)
### 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 @@ -109,17 +146,13 @@ $ 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 running YBDB version {{< yb-version version="stable" format="short">}}, 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 | 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 | 46710 | 1.28 |
| oltp_read_write | 2480 | 9.6 |
| oltp_multi_insert | 5860 | 4.1 |
| oltp_update_index | 2610 | 9.2 |
Loading

0 comments on commit 63f9ba0

Please sign in to comment.