Skip to content

Commit

Permalink
[docs] [Benchmark] updated ycsb commands (#14024)
Browse files Browse the repository at this point in the history
* removed maxexecutiontime

* added a note

* changed note placement

* added note in other files and lots of edits

* changes from review
  • Loading branch information
aishwarya24 authored Sep 16, 2022
1 parent 6b7492e commit e676889
Show file tree
Hide file tree
Showing 14 changed files with 907 additions and 1,026 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ For information on the relevant YSQL API, see [CREATE TABLE ... SPLIT AT VALUES]

## Manual tablet splitting

Imagine there is a table with pre-existing data spread across a certain number of tablets. It is possible to split some or all of the tablets in this table manually.
Imagine there is a table with pre-existing data spread across a certain number of tablets. It is possible to split some or all of the tablets in this table manually.

{{< note title="Note" >}}

Expand Down Expand Up @@ -244,8 +244,7 @@ In the event that performance suffers due to automatic tablet splitting, the fol
* `post_split_trigger_compaction_pool_max_queue_size` indicates the number of outstanding post-split compaction tasks that can be queued at once per node, limited to 16 by default.
* `automatic_compaction_extra_priority` provides additional compaction priorities to [smaller compactions](../concepts/yb-tserver/#small-and-large-compaction-queues) when automatic tablet splitting is enabled. This prevents smaller compactions from being starved for resources by the larger post-split compactions. This is set to 50 by default (the maximum recommended), and can be reduced to 0.


### YCSB workload with automatic tablet splitting example
### Example: YCSB workload with automatic tablet splitting

In the following example, a three-node cluster is created and uses a YCSB workload to demonstrate the use of automatic tablet splitting in a YSQL database:

Expand Down
140 changes: 69 additions & 71 deletions docs/content/preview/benchmark/ycsb-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Benchmark YSQL performance with YCSB
headerTitle: YCSB
linkTitle: YCSB
description: Benchmark YSQL performance with YCSB using the standard JDBC binding.
headcontent: Benchmark YSQL performance with YCSB using the standard JDBC binding.
menu:
preview:
identifier: ycsb-1-ysql
Expand Down Expand Up @@ -45,7 +46,7 @@ For additional information about YCSB, refer to the following:
* [YCSB Wiki](https://github.com/brianfrankcooper/YCSB/wiki)
* [Workload info](https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads)

## Running the Benchmark
## Running the benchmark

To run the benchmark, ensure that you meet the prerequisites and complete steps such as starting YugabyteDB and configuring its properties.

Expand All @@ -62,7 +63,7 @@ $ tar -xzf ycsb.tar.gz
$ cd YCSB
```

Ensure that you have the YSQL shell `ysqlsh` and that its location is included in the `PATH` variable, as follows:
Ensure that you have the YSQL shell [ysqlsh](../../admin/ysqlsh/) and that its location is included in the `PATH` variable, as follows:

```sh
$ export PATH=$PATH:/path/to/ysqlsh
Expand All @@ -76,9 +77,9 @@ $ export PATH=$PATH:/Users/yugabyte/code/bin

### Start YugabyteDB

Start your YugabyteDB cluster by following the procedure described in [Manual Deployment](../../deploy/manual-deployment/). Note the IP addresses of the nodes in the cluster, as these addresses are required when configuring the properties file.
Start your YugabyteDB cluster by following the procedure described in [Manual deployment](../../deploy/manual-deployment/). Note the IP addresses of the nodes in the cluster, as these addresses are required when configuring the properties file.

### Configure the Properties File
### Configure the properties file

Update the file `db.properties` in the YCSB directory with the following contents, replacing values for the IP addresses in the `db.url` field with the correct values for all the nodes that are part of the cluster:

Expand All @@ -91,7 +92,7 @@ db.passwd=

The other configuration parameters are described in [Core Properties](https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties).

### Run the Benchmark
### Run the benchmark

Use the following script `run_jdbc.sh` to load and run all the workloads:

Expand All @@ -107,91 +108,90 @@ $ ./run_jdbc.sh --ip <ip> --recordcount <number of rows>

To obtain the maximum performance out of the system, you can tune the `threadcount` parameter in the script. As a reference, for a `c5.4xlarge` instance with 16 cores and 32GB RAM, you use a threadcount of 32 for the loading phase and 256 for the execution phase.

### Verify Results
### Verify results

The `run_jdbc.sh` script creates two result files per workload: one for the loading, and one for the execution phase with the details of throughput and latency.

For example, for a workload it creates, inspect the `workloada-ysql-load.dat` and `workloada-ysql-transaction.dat` files.

### Run Individual Workloads (optional)
### Run individual workloads (optional)

Optionally, you can run workloads individually.
Optionally, you can run workloads individually using the following steps:

**Start the YSQL shell** using the following command:
1. Start the YSQL shell using the following command:

```sh
$ ./bin/ysqlsh -h <ip>
```
```sh
$ ./bin/ysqlsh -h <ip>
```

**Create the `ycsb` database** as follows:
1. Create the `ycsb` database as follows:

```sql
yugabyte=# CREATE DATABASE ycsb;
```
```sql
yugabyte=# CREATE DATABASE ycsb;
```

**Connect to the database** as follows:
1. Connect to the database** as follows:

```sql
yugabyte=# \c ycsb
```
```sql
yugabyte=# \c ycsb
```

**Create the table** as follows:

```sql
ycsb=# CREATE TABLE usertable (
YCSB_KEY TEXT,
FIELD0 TEXT, FIELD1 TEXT, FIELD2 TEXT, FIELD3 TEXT,
FIELD4 TEXT, FIELD5 TEXT, FIELD6 TEXT, FIELD7 TEXT,
FIELD8 TEXT, FIELD9 TEXT,
PRIMARY KEY (YCSB_KEY ASC))
SPLIT AT VALUES (('user10'),('user14'),('user18'),
('user22'),('user26'),('user30'),('user34'),('user38'),
('user42'),('user46'),('user50'),('user54'),('user58'),
('user62'),('user66'),('user70'),('user74'),('user78'),
('user82'),('user86'),('user90'),('user94'),('user98'));
```
1. Create the table as follows:

**Load the data** before you start the `jdbc` workload:
```sql
ycsb=# CREATE TABLE usertable (
YCSB_KEY TEXT,
FIELD0 TEXT, FIELD1 TEXT, FIELD2 TEXT, FIELD3 TEXT,
FIELD4 TEXT, FIELD5 TEXT, FIELD6 TEXT, FIELD7 TEXT,
FIELD8 TEXT, FIELD9 TEXT,
PRIMARY KEY (YCSB_KEY ASC))
SPLIT AT VALUES (('user10'),('user14'),('user18'),
('user22'),('user26'),('user30'),('user34'),('user38'),
('user42'),('user46'),('user50'),('user54'),('user58'),
('user62'),('user66'),('user70'),('user74'),('user78'),
('user82'),('user86'),('user90'),('user94'),('user98'));
```

```sh
$ ./bin/ycsb load jdbc -s \
-P db.properties \
-P workloads/workloada \
-p recordcount=1000000 \
-p operationcount=10000000 \
-p threadcount=32 \
-p maxexecutiontime=180
```
1. Load the data before you start the `jdbc` workload:

**Run the workload** as follows:
```sh
$ ./bin/ycsb load jdbc -s \
-P db.properties \
-P workloads/workloada \
-p recordcount=1000000 \
-p operationcount=10000000 \
-p threadcount=32
```

```sh
$ ./bin/ycsb run jdbc -s \
-P db.properties \
-P workloads/workloada \
-p recordcount=1000000 \
-p operationcount=10000000 \
-p threadcount=256 \
-p maxexecutiontime=180
```
1. Run the workload as follows:

**Run other workloads** (for example, `workloadb`) by changing the corresponding argument in the preceding command, as follows:
{{< note title="Note" >}}
The `recordcount` parameter in the following `ycsb` commands should match the number of rows in the table.
{{< /note >}}

```sh
$ ./bin/ycsb run jdbc -s \
-P db.properties \
-P workloads/workloadb \
-p recordcount=1000000 \
-p operationcount=10000000 \
-p threadcount=256 \
-p maxexecutiontime=180
```
```sh
$ ./bin/ycsb run jdbc -s \
-P db.properties \
-P workloads/workloada \
-p recordcount=1000000 \
-p operationcount=10000000 \
-p threadcount=256
```

1. Run other workloads (for example, `workloadb`) by changing the corresponding argument in the preceding command, as follows:

### Expected Results
```sh
$ ./bin/ycsb run jdbc -s \
-P db.properties \
-P workloads/workloadb \
-p recordcount=1000000 \
-p operationcount=10000000 \
-p threadcount=256
```

When run on a 3-node cluster of `c5.4xlarge` AWS instances (16 cores, 32GB of RAM and 2 EBS volumes) all belonging to the same AZ with the client VM running in the same AZ, expect the following results:
## Expected results

**One Million Rows**
When run on a 3-node cluster of `c5.4xlarge` AWS instances (16 cores, 32GB of RAM, and 2 EBS volumes) all belonging to the same availability zone with the client VM running in the same availability zone, expect the following results for _1 million rows_:

| Workload | Throughput (ops/sec) | Read Latency | Write Latency |
| :------- | :------------------- | :----------- | :------------ |
Expand All @@ -202,6 +202,4 @@ When run on a 3-node cluster of `c5.4xlarge` AWS instances (16 cores, 32GB of RA
| Workload E | 16,642 | 15ms scan | Not applicable |
| Workload F | 29,500 | 2ms | 15ms read-modify-write |

### Additional Examples

For additional examples, refer to [Example Using a YCSB Workload with Automatic Tablet Splitting](/preview/architecture/docdb-sharding/tablet-splitting/#example-using-a-ycsb-workload-with-automatic-tablet-splitting).
For an additional example, refer to [Example: YCSB workload with automatic tablet splitting example](../../architecture/docdb-sharding/tablet-splitting/#example-ycsb-workload-with-automatic-tablet-splitting).
Loading

0 comments on commit e676889

Please sign in to comment.