This topic describes the tests on ApsaraDB for Redis Enhanced Edition (Tair) ESSD-based instances. The test environment, tool, methods, and results are introduced.

Overview

Tair ESSD-based instances are developed based on enhanced SSDs (ESSDs) and are compatible with core data structures and APIs of open source Redis. These instances can provide large-capacity, low-cost, and persistent database services. ESSD-based instances reduce costs and improve data reliability. In addition, ESSD-based instances reduce the amount of memory that is reserved for the forks of native Redis databases. ESSD-based instances are suitable for scenarios that store warm and cold data, and require compatibility with open source Redis, large capacity, and high access performance. For more information, see ESSD-based instances.

Test environment

Environment itemDescription
Region and zoneAll tests are performed in Hangzhou Zone I.
Instance architectureThe standard master-replica architecture is used. For more information, see Standard architecture.
Virtual machine to deploy stress testing toolsAn Elastic Compute Service (ECS) instance of the ecs.g6e.13xlarge type is used. For more information, see Overview of instance families.
ESSD-based instances
  • tair.essd.standard.xlarge
  • tair.essd.standard.2xlarge
  • tair.essd.standard.4xlarge
  • tair.essd.standard.8xlarge
  • tair.essd.standard.13xlarge

For more information about the instance types, see ESSD-based instances.

Test the performance of ESSD-based instances in the following scenarios:
  • Scenarios in which the memory size is larger than the data volume: Most data can be accessed from the memory. In these scenarios, the ratio of the memory size to the data volume is approximately 7:1.
  • Scenarios in which the data volume is larger than the memory size: Only part of the data is cached in the memory. Most access requests require read and write operations on disks. In these scenarios, the ratio of the memory size to the data volume is approximately 1:4.

Test tool

You can use open source YCSB to perform stress tests. YCSB is a Java tool that can be used to benchmark the performance of multiple types of databases. For more information about how to install and use YCSB, see YCSB.

In this test, the YCSB source code is modified to allow you to set the recordcount parameter to a LONG-typed value and test the string-related commands of Redis. To obtain the modified source code, download the YCSB source code package.

Workloads

  • Data loading: performs 100% string set operations (write operations).
  • Uniform-Read: runs Workload A that consists of 100% random string get operations (read operations). This tests read performance under harsh conditions.
  • Zipfian-Read: uses Workload C that adopts Zipfian as the data distribution method to test read performance in scenarios in which most read requests are sent to access a small portion of data. Most read scenarios belong to these scenarios.
  • Uniform-50%Read-50%Update: uses Workload A that consists of 50% string set operations (update operations) and 50% string get operations. This tests the performance of random updates.

For more information about workloads, see Core Workloads.

Test commands

The following script is used to test performance in scenarios where the data volume is larger than the memory size:

#! /bin/bash

ip=192.168.0.23
port=3100
timeout=30000
command_group=string
recordcount=640000000
run_operationcount=20000000
fieldcount=1
fieldlength=100
threads=32
load_sleep_time=600
run_sleep_time=60

echo "##################################### $command_group  ############################################"
#Load
./bin/ycsb load redis -s -P workloads/workloada -p "redis.host=${ip}" -p  "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${recordcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -threads ${threads}
sleep ${load_sleep_time}

#Uniform-Read
./bin/ycsb run redis -s -P workloads/workloadc  -p "redis.host=${ip}" -p  "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${run_operationcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -p "requestdistribution=uniform" -threads ${threads}
sleep ${run_sleep_time}

#Zipfian-Read
./bin/ycsb run redis -s -P workloads/workloadc  -p "redis.host=${ip}" -p  "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${run_operationcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -p "requestdistribution=zipfian" -threads ${threads}
sleep ${run_sleep_time}

#Uniform-50%Read-50%Update
./bin/ycsb run redis -s -P workloads/workloada  -p "redis.host=${ip}" -p  "redis.port=${port}" -p "recordcount=${recordcount}" -p "operationcount=${run_operationcount}" -p "redis.timeout=${timeout}" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -p "requestdistribution=uniform" -threads ${threads}
Table 1. Parameters
ParameterDescription
ipThe IP address used to connect to the Tair instance.
port The service port used to connect to the Tair instance.
timeoutThe timeout period of the test command.
command_groupThe type of data to be tested. Set this parameter to String.
recordcountThe amount of prepared data.
run_operationcountThe amount of data involved in the operation. When you set this parameter, take note of the following rules:
  • In scenarios in which the memory size is larger than the data volume, set this parameter to the value of the recordcount parameter.
  • In scenarios in which the data volume is larger than the memory size, set this parameter to the value of the recordcount parameter divided by 32.
fieldcountThe number of fields. Set this parameter to 1.
fieldlengthThe length of each field. Set this parameter to 100.
threadsThe number of YCSB threads. Set this parameter based on the instance type.

Test results

Test metricDescription
QPSThe number of read and write operations that are processed per second.
Average LatencyThe average latency of read or write operations. Unit: µs.
99th Percentile LatencyThe highest latency for the fastest 99% of operations. Unit: µs. For example, if this parameter is set to 500 µs, 99% of the operations are processed within 500 µs.

Scenarios in which the memory size is larger than the data volume

Test results for scenarios in which the memory size is larger than the data volume
CategoryYCSB configuration WorkloadsQPSAverage Latency (µs)99th Percentile Latency (µs)
tair.essd.standard.xlarge

recordcount=20000000

run_operationcount=20000000

threads=32

Load36,7408511,595
Uniform-Read103,890294907
Zipfian-Read106,357288865
Uniform-50%Read-50%Update46,610Read: 530Read: 1,108
Update: 795Update: 1,684
tair.essd.standard.2xlarge

recordcount=40000000

run_operationcount=40000000

threads=50

Load54,6709111,528
Uniform-Read150,796314995
Zipfian-Read151,110314977
Uniform-50%Read-50%Update69,137Read: 537Read: 948
Update: 878Update: 1,479
air.essd.standard.4xlarge

recordcount=80000000

run_operationcount=80000000

threads=100

Load90,7031,0991,697
Uniform-Read285,8333391,196
Zipfian-Read288,7503351,162
Uniform-50%Read-50%Update110,316Read: 757Read: 1,114
Update: 1,041Update: 1,536
tair.essd.standard.8xlarge

recordcount=160000000

run_operationcount=160000000

threads=120

Load117,5811,0111,692
Uniform-Read477,099242784
Zipfian-Read494,550234727
Uniform-50%Read-50%Update196,245Read: 519Read: 829
Update: 691Update: 1,096
tair.essd.standard.13xlarge

recordcount=240000000

run_operationcount=240000000

threads=160

Load126,3661,2492,281
Uniform-Read673,183231637
Zipfian-Read691,383230652
Uniform-50%Read-50%Update197,803Read: 678Read: 940
Update: 935Update: 1,925

Scenarios in which the data volume is larger than the memory size

Test results for scenarios in which the data volume is larger than the memory size
CategoryYCSB configuration WorkloadsQPSAverage Latency (µs)99th Percentile Latency (µs)
tair.essd.standard.xlarge

recordcount=640000000

run_operationcount=20000000

threads=32

Load25,5611,2453,497
Uniform-Read25,7271,2392,042
Zipfian-Read47,5596671,217
Uniform-50%Read-50%Update19,731Read: 1,576Read: 6,383
Update: 1,639Update: 6,487
tair.essd.standard.2xlarge

recordcount=1280000000

run_operationcount=40000000

threads=50

Load42,2871,1793,465
Uniform-Read35,7941,3941,880
Zipfian-Read77,7596371,219
Uniform-50%Read-50%Update28,656Read: 1,716Read: 8,863
Update: 1,761Update: 8,951
air.essd.standard.4xlarge

recordcount=2560000000

run_operationcount=80000000

threads=100

Load65,9231,5146,615
Uniform-Read44,7532,2327,903
Zipfian-Read120,3378261,382
Uniform-50%Read-50%Update38,470Read: 2,577Read: 8,535
Update: 2,617Update: 8,583
tair.essd.standard.8xlarge

recordcount=5120000000

run_operationcount=160000000

threads=120

Load89,2311,3409,575
Uniform-Read51,1752,3432,955
Zipfian-Read131,3179111,573
Uniform-50%Read-50%Update38,930Read: 3,063Read: 8,695
Update: 3,097Update: 8,735
tair.essd.standard.13xlarge

recordcount=7680000000

run_operationcount=240000000

threads=160

Load92,1631,7339,879
Uniform-Read51,2673,51016,623
Zipfian-Read138,5221,1522,131
Uniform-50%Read-50%Update39,584Read: 4,022Read: 12,159
Update: 4,057Update: 12,239