Join us on
Star us on
Get Started
Slack
GitHub
Get Started
v2.0 (latest version) v1.3 (earlier version) v1.2 (earlier version) v1.1 (earlier version) v1.0 (earlier version)
  • GET STARTED
    • Quick Start
      • 1. Install YugabyteDB
      • 2. Create Local Cluster
      • 3. Explore YSQL
      • 4. Build an app
        • Java
        • NodeJS
        • Go
        • Python
        • Ruby
        • C#
        • PHP
        • C++
        • C
    • Introduction
    • Explore Core
      • 1. Linear Scalability
      • 2. Fault Tolerance
      • 3. Global Distribution
      • 4. Auto Sharding
      • 5. Tunable Reads
      • 6. Observability
  • USER GUIDES
    • Develop
      • Learn App Dev
        • 1. SQL vs NoSQL
        • 2. Data Modeling
        • 3. Data Types
        • 4. ACID Transactions
        • 5. Aggregations
        • 6. Batch Operations
      • Ecosystem Integrations
        • Apache Kafka
        • Apache Spark
        • JanusGraph
        • KairosDB
        • Presto
        • Metabase
      • Real World Examples
        • E-Commerce App
        • IoT Fleet Management
        • Retail Analytics
      • Explore Sample Apps
    • Deploy
      • Checklist
      • Manual Deployment
        • 1. System Configuration
        • 2. Install Software
        • 3. Start YB-Masters
        • 4. Start YB-TServers
        • 5. Verify Deployment
      • Kubernetes
        • Helm Chart
        • Helm Configuration
        • Local SSD
      • Docker
      • Public Clouds
        • Amazon Web Services
        • Google Cloud Platform
        • Microsoft Azure
      • Pivotal Cloud Foundry
      • Enterprise Edition
        • 1. Prepare Cloud Env
        • 2. Install Admin Console
        • 3. Configure Admin Console
        • 4. Configure Cloud Providers
    • Benchmark
      • Performance
      • YCSB
      • Large Datasets
    • Secure
      • Security Checklist
      • Authentication
      • Authorization
        • 1. RBAC Model
        • 2. Create Roles
        • 3. Grant Permissions
      • TLS Encryption
        • 1. Prepare Nodes
        • 2. Server-Server Encryption
        • 3. Client-Server Encryption
        • 4. Connect to Cluster
    • Manage
      • Backup and Restore
        • Backing Up Data
        • Restoring Data
      • Data Migration
        • Bulk Import
        • Bulk Export
      • Change Cluster Config
      • Upgrade Deployment
      • Diagnostics Reporting
      • Enterprise Edition
        • Create Universe - Multi-Zone
        • Create Universe - Multi-Region
        • Edit Universe
        • Edit Config Flags
        • Health Checking and Alerts
        • Create/Edit Instance Tags
        • Node Status & Actions
        • Read Replicas
        • Backup & Restore
        • Upgrade Universe
        • Delete Universe
    • Troubleshoot
      • Troubleshooting Overview
      • Cluster Level Issues
        • YCQL Connection Issues
        • YEDIS Connection Issues
      • Node Level Issues
        • Check Processes
        • Inspect Logs
        • System Stats
      • Enterprise Edition
        • Troubleshoot Universes
  • REFERENCE
    • APIs
      • YSQL
        • Commands
          • ABORT
          • ALTER DOMAIN
          • ALTER TABLE
          • BEGIN TRANSACTION
          • COMMIT
          • COPY
          • CREATE DATABASE
          • CREATE DOMAIN
          • CREATE INDEX
          • CREATE SCHEMA
          • CREATE SEQUENCE
          • CREATE TABLE
          • CREATE TABLE AS
          • CREATE USER
          • CREATE VIEW
          • DEALLOCATE
          • DELETE
          • DROP DATABASE
          • DROP DOMAIN
          • DROP SEQUENCE
          • DROP TABLE
          • END TRANSACTION
          • EXECUTE
          • EXPLAIN
          • INSERT
          • PREPARE
          • RESET
          • ROLLBACK
          • SELECT
          • SET
          • SET TRANSACTION
          • SHOW
          • SHOW TRANSACTION
          • TRUNCATE
          • UPDATE
        • Datatypes
          • Binary
          • Boolean
          • Character
          • Date-time
          • Json
          • Money
          • Numeric
          • Serial
          • UUID
        • Expressions
          • currval()
          • lastval()
          • nextval()
        • Keywords
        • Reserved Names
      • YCQL
        • Quick Start YCQL
        • ALTER KEYSPACE
        • ALTER ROLE
        • ALTER TABLE
        • CREATE INDEX
        • CREATE KEYSPACE
        • CREATE ROLE
        • CREATE TABLE
        • CREATE TYPE
        • DROP INDEX
        • DROP KEYSPACE
        • DROP ROLE
        • DROP TABLE
        • DROP TYPE
        • GRANT PERMISSION
        • GRANT ROLE
        • REVOKE PERMISSION
        • REVOKE ROLE
        • USE
        • INSERT
        • SELECT
        • UPDATE
        • DELETE
        • TRANSACTION
        • TRUNCATE
        • Simple Value
        • Subscript
        • Function Call
        • Operator Call
        • BLOB
        • BOOLEAN
        • MAP, SET, LIST
        • FROZEN
        • INET
        • Integer & Counter
        • Non-Integer
        • TEXT
        • Date & Time Types
        • UUID & TIMEUUID
        • JSONB
        • Date & Time Functions
    • CLIs
      • yb-ctl
      • yb-docker-ctl
      • yb-master
      • yb-tserver
      • ysqlsh
      • cqlsh
    • Tools
      • TablePlus
  • RELEASES
    • Release History
      • v1.2.12
      • v1.2.11
      • v1.2.10
      • v1.2.9
      • v1.2.8
      • v1.2.6
      • v1.2.5
      • v1.2.4
  • CONCEPTS
    • Architecture
      • Design Goals
      • Layered Architecture
      • Basic Concepts
        • Universe
        • YB-TServer
        • YB-Master
        • Acknowledgements
      • Query Layer
        • Overview
      • DocDB Store
        • Sharding
        • Replication
        • Persistence
        • Performance
      • DocDB Transactions
        • Isolation Levels
        • Single Row Transactions
        • Distributed Transactions
        • Transactional IO Path
  • FAQ
    • Comparisons
      • CockroachDB
      • Google Cloud Spanner
      • MongoDB
      • FoundationDB
      • Amazon DynamoDB
      • Azure Cosmos DB
      • Apache Cassandra
      • Redis In-Memory Store
      • Apache HBase
    • Other FAQs
      • Product
      • Architecture
      • Enterprise Edition
      • API Compatibility
  • CONTRIBUTOR GUIDES
    • Get Involved
  • Misc
    • YEDIS
      • Quick Start
      • Develop
        • Client Drivers
          • C
          • C++
          • C#
          • Go
          • Java
          • NodeJS
          • Python
      • API Reference
        • APPEND
        • AUTH
        • CONFIG
        • CREATEDB
        • DELETEDB
        • LISTDB
        • SELECT
        • DEL
        • ECHO
        • EXISTS
        • EXPIRE
        • EXPIREAT
        • FLUSHALL
        • FLUSHDB
        • GET
        • GETRANGE
        • GETSET
        • HDEL
        • HEXISTS
        • HGET
        • HGETALL
        • HINCRBY
        • HKEYS
        • HLEN
        • HMGET
        • HMSET
        • HSET
        • HSTRLEN
        • HVALS
        • INCR
        • INCRBY
        • KEYS
        • MONITOR
        • PEXPIRE
        • PEXPIREAT
        • PTTL
        • ROLE
        • SADD
        • SCARD
        • RENAME
        • SET
        • SETEX
        • PSETEX
        • SETRANGE
        • SISMEMBER
        • SMEMBERS
        • SREM
        • STRLEN
        • ZRANGE
        • TSADD
        • TSCARD
        • TSGET
        • TSLASTN
        • TSRANGEBYTIME
        • TSREM
        • TSREVRANGEBYTIME
        • TTL
        • ZADD
        • ZCARD
        • ZRANGEBYSCORE
        • ZREM
        • ZREVRANGE
        • ZSCORE
        • PUBSUB
        • PUBLISH
        • SUBSCRIBE
        • UNSUBSCRIBE
        • PSUBSCRIBE
        • PUNSUBSCRIBE
> Benchmark >

YCSB

Attention

This page documents an earlier version. Go to the latest (v2.0)version.

    • Step 1.Clone the YCSB repository
    • Step 2. Use YCQL Driver
    • Step 3. Build YCSB
    • Step 4. Setup cqlsh
    • Step 5. Prepare the driver script
    • Step 6. Run and Check Results

Note

For more information about YCSB see:

  • YCSB Wiki: https://github.com/brianfrankcooper/YCSB/wiki
  • Workload info: https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads

We will first setup YCSB and configure it to use the YCQL Driver for Cassandra.

Step 1.Clone the YCSB repository

You can do this by running the following commands.

cd $HOME
git clone https://github.com/brianfrankcooper/YCSB.git
cd YCSB

Step 2. Use YCQL Driver

  1. In pom.xml change the line <cassandra.cql.version>3.0.0</cassandra.cql.version> to the latest version of the Yugabyte-Cassandra driver <cassandra.cql.version>3.2.0-yb-17</cassandra.cql.version>

Note

You can (and probably should) always check Maven to find the latest version.
  1. In cassandra/pom.xml change the line <groupId>com.datastax.cassandra</groupId> to <groupId>com.yugabyte</groupId>

Step 3. Build YCSB

You can build YCSB by running the following command:

mvn -pl com.yahoo.ycsb:cassandra-binding -am clean package -DskipTests

Step 4. Setup cqlsh

You can setup Yugabyte-cqlsh by doing the following:

cd $HOME
git clone https://github.com/yugabyte/cqlsh

Step 5. Prepare the driver script

  1. Create an executable file in the YCSB folder:
cd $HOME/YCSB
touch run-yb-ycsb.sh
chmod a+x run-yb-ycsb.sh
  1. Copy the following contents in run-yb-ycsb.sh:

Note

You may want to customize the values below (such as ) with the correct/intended ones for your setup.
#!/bin/bash


# YB-CQL host (any of the yb-tserver hosts)
# (The other nodes should get automatically discovered by the driver).
hosts=127.0.0.1
ycsb=$HOME/YCSB/bin/ycsb
cqlsh=$HOME/cqlsh/bin/cqlsh <ip-addr>
ycsb_setup_script=$HOME/YCSB/cassandra/src/test/resources/ycsb.cql
keyspace=ycsb
table=usertable
# See https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties for param descriptions
params="-p recordcount=1000000 -p operationcount=10000000"

setup() {
    $cqlsh <<EOF
create keyspace $keyspace with replication = {'class': 'SimpleStrategy', 'replication_factor' : 3};
EOF
    $cqlsh -k $keyspace -f $ycsb_setup_script
}

cleanup() {
    $cqlsh <<EOF
drop table $keyspace.$table;
drop keyspace $keyspace;
EOF
}

delete_data() {
    $cqlsh -k $keyspace <<EOF
drop table $table;
EOF
    $cqlsh -k $keyspace -f $ycsb_setup_script
}


run_workload() {
    local workload=$1-----------------
    echo =========================== $workload ===========================
    $ycsb load cassandra-cql -p hosts=$hosts -P workloads/$workload $params \
      -p threadcount=40 | tee $workload-load.dat
    $ycsb run cassandra-cql -p hosts=$hosts -P workloads/$workload $params \
      -p cassandra.readconsistencylevel=QUORUM -p cassandra.writeconsistencylevel=QUORUM \
      -p threadcount=256 -p maxexecutiontime=180 | tee $workload-transaction.dat
    delete_data
}

setup

load_data workloada
run_workload workloada
run_workload workloadb
run_workload workloadc
run_workload workloadf
run_workload workloadd

truncate_table
load_data workloade
run_workload workloade

cleanup

We use YugabyteDB with strongly consistent reads and writes, which corresponds, in Cassandra, to using the QUORUM option for both cassandra.readconsistencylevel and cassandra.writeconsistencylevel (see the command above).

Step 6. Run and Check Results

Simply run the script above:

./run-yb-ycsb.sh

Tip

See also this page about running workloads in parallel.

Results for each workload will be in workload[abcdef]-transaction.dat (e.g. workloada-transaction.dat).

    • Step 1.Clone the YCSB repository
    • Step 2. Use YCQL Driver
    • Step 3. Build YCSB
    • Step 4. Setup cqlsh
    • Step 5. Prepare the driver script
    • Step 6. Run and Check Results
Benchmark
Performance
Benchmark
Large Datasets
Talk to Community
  • Slack
  • Github
  • Forum
  • StackOverflow
Yugabyte
Contact Us
Copyright © 2017-2019 Yugabyte, Inc. All rights reserved.