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

[docs] updated ycsb commands #14024

Merged
merged 7 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 70 additions & 70 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_:
aishwarya24 marked this conversation as resolved.
Show resolved Hide resolved

| Workload | Throughput (ops/sec) | Read Latency | Write Latency |
| :------- | :------------------- | :----------- | :------------ |
Expand All @@ -202,6 +202,6 @@ 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
## 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 additional examples, refer to [YCSB workload with automatic tablet splitting example](../../architecture/docdb-sharding/tablet-splitting/#ycsb-workload-with-automatic-tablet-splitting-example).
aishwarya24 marked this conversation as resolved.
Show resolved Hide resolved
Loading