- Installed
Java13+on machines where YCSB will be run. - Installed
YDB Python SDK. You can install it with commandpip3 install ydb numpy requests ydb[yc]. - Installed
parallel-sshon machine where scripts will be run. We worked withparallel-sshon version2.3.4. - Requirements for the selected database: YDB, CockroachDB, YugabyteDB
First, you need to deploy one of the databases on the machines. For more details on each database:
Now you can start running the benchmark on the selected database.
Below is the instruction for running YCSB for YDB, CockroachDB, YugabyteDB, but first you need to familiarize yourself with YCSB workload.
You can read about YCSB workloads here.
We should have two config files to run YCSB: <DB_NAME>.rc and workload.rc.
The workload.rc file contains the configuration for the YCSB workload. The following variables can be found in this file:
WORKLOADS- a list of workloads to be executed.RECORD_COUNT- the number of records in the database at the start of the workload.OP_COUNT_TOTAL- the number of operations to be performed.DISTRIBUTIONS- what distribution should be used to select the records to operate on – uniform, zipfian, hotspot, sequential, exponential or latestYCSB_THREADS- the number of YCSB client threads (default - 64).YCSB_THREADS_DE- the number of YCSB client threads for workload D and E (default - 512).LOAD_YCSB_THREADS- the number of YCSB client threads when load the data.KEY_ORDER- should records be inserted in order by key (“ordered”), or in hashed order (“hashed”).MAX_PARTS,MAX_PART_SIZE_MB,LOAD_DATA- these are settings for developers and the default values are suitable in most cases.
Next, you need to configure the YDB config file according to your needs.
Suppose that on ydb_host1.com YDB is running.
We want to run YCSB workload against this database from machines ycsb-host1.com, ycsb-host2.com, etc.
If you look into the config file ydb.rc, you can find:
TARGET- one of the hosts where YDB is running (that is,ydb_host1.com).DATABASE_PATH- the path to the database on which the performance tests will be conducted.STATIC_NODE_GRPC_PORT- GRPC port of the static node, by default 2135.YCSB_HOSTS- list of hosts on which YCSB will be run (this is,ycsb-host1.com,ycsb-host2.com, etc).YCSB_HOSTS_COUNT- if you want to limit the number ofYCSB_HOSTSwithout changing the list.YCSB_PATH- path to the folder with YCSB onYCSB_HOSTS.YCSB_TAR_PATH- ifYCSB_PATHis not present, the archive at this path will be unpacked inYCSB_DEPLOY_PATH.
After configuring ydb.rc and workload.rc (more about it above), you can start YCSB:
cd <PATH_TO_BENCHHELPERS>/ycsb
./run_workloads.sh --name ycsb-ydb-test-run1 --log-dir <PATH_TO_LOG_DIR> configs/workload.rc configs/ydb.rcThere are also parameters for run_workloads.sh:
--name- for convenience, the log file names will be suffixed with<NAME>.--threads- same asYCSB_THREADSfrom workload, but with higher priority (overwrites the value from the config).--de-threads- same asYCSB_THREADS_DEfrom workload, but with higher priority (overwrites the value from the config).--ycsb-hosts- same asYCSB_HOSTS_COUNT, but with higher priority (overwrites the value from the config).
By default scripts use anonymous access to YDB. If you want to use a token, then export YDB_ACCESS_TOKEN_CREDENTIALS (be aware, that currently this token will be printed in the logs and will be visible in process list!).
Just like with YDB, let's configure the config file cockroach.rc:
TARGET- one of the hosts where CockroachDB is running.YCSB_HOSTS- list of hosts on which YCSB will be run.YCSB_HOSTS_COUNT- if you want to limit the number ofYCSB_HOSTSwithout changing the list .COCKROACH_PATH- path to the folder with CockroachDB onYCSB_HOSTS.COCKROACH_TAR_PATH- ifCOCKROACH_PATHis not present, the archive at this path will be unpacked inCOCKROACH_DEPLOY_PATH.HA_PROXY_HOST- one of the hosts where haproxy is running.COCKROACH_INIT_SLEEP_TIME_MINUTES- sometimes export fails with CLI error, but continues in cockroach, so we continue to wait.
After configuring cockroach.rc and workload.rc (more about it above), you can start YCSB:
cd <PATH_TO_BENCHHELPERS>/ycsb
./run_workloads.sh --type cockroach --log-dir <PATH_TO_LOG_DIR> configs/workload.rc configs/cockroach.rcYou can read about additional parameters for run_workloads.sh in YDB.
Let's configure the config file yugabyte.rc:
TARGET- one of the hosts where YugabyteDB is running.YCSB_HOSTS- list of hosts on which YCSB will be run.YCSB_HOSTS_COUNT- if you want to limit the number ofYCSB_HOSTSwithout changing the list .YU_YCSB_PATH- path to the folder with YSCB of YugabyteDB onYCSB_HOSTS.YU_YCSB_TAR_PATH- ifYU_YCSB_PATHis not present, the archive at this path will be unpacked inYU_YCSB_DEPLOY_PATH.YU_PATH- path to the folder with YugabyteDB onTARGET.
After configuring yugabyte.rc and workload.rc (more about it above), you can start YCSB on YCQL:
cd <PATH_TO_BENCHHELPERS>/ycsb
./run_workloads.sh --type yugabyte --log-dir <PATH_TO_LOG_DIR> configs/workload.rc configs/yugabyte.rcYou can read about additional parameters for run_workloads.sh in YDB.
If you want to perform a benchmark on YSQL,
then change the --type parameter to yugabyteSQL.