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

Overview

Tair persistent memory-optimized instances adopt persistent memory to provide large-capacity in-memory databases that are compatible with open source Redis. Persistent memory-optimized instances do not use disks to implement data persistence and cost 30% less than ApsaraDB for Redis Community Edition instances while delivering almost identical throughput and latency and maintaining the persistence of each operation. This helps improve the reliability of business data. For more information, see Persistent memory-optimized instances.

Test environment

Environment itemDescription
Region and zoneAll tests are performed in Zhangjiakou Zone A.
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.8xlarge type is used. For more information, see Overview of instance families.
Instance typeThe instance type tair.scm.standard.32m.128d is used in the tests. For more information, see Persistent memory-optimized instances.

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.

Open source YCSB tests only hashes. To use YCSB to test strings, you must use the RedisClient.java file to replace the original file that has the same name in the YCSB/redis/src/main/java/site/ycsb/db directory after you download YCSB.

Workloads

The total amount of data involved in the test is 8 GB. The data distribution method is Zipfian. The performance of persistent memory-optimized instances was tested in the following scenarios:

  • Data loading: 100% write operations.
  • Workload C: 100% read operations.
  • Workload A: 50% update operations and 50% read operations.

For more information about workloads, see Core Workloads.

Note The complex commands for sets and Zsets cannot be tested in this test due to their applicable scenarios. You can customize a test for sets and Zsets based on your business scenario.

Test commands

# Load data.
workload=a
./bin/ycsb load redis -s -P workloads/workload${workload} -p "redis.host=${server_ip}" -p  "redis.port=${port}" -p "redis.password=${password}" -p "recordcount=${recordcount}" -p "operationcount=${operationcount}" -p "redis.timeout=30000" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -threads ${threads}  -p "redis.password=***:*****"

# Run Workload C.
workload=c
./bin/ycsb run redis -s -P workloads/workload${workload} -p "redis.host=${server_ip}" -p  "redis.port=${port}" -p "redis.password=${password}" -p "recordcount=${recordcount}" -p "operationcount=${operationcount}" -p "redis.timeout=30000" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -threads ${threads} -p "redis.password=***:*****"

# Run Workload A.
workload=a
./bin/ycsb run redis -s -P workloads/workload${workload} -p "redis.host=${server_ip}" -p  "redis.port=${port}" -p "redis.password=${password}" -p "recordcount=${recordcount}" -p "operationcount=${operationcount}" -p "redis.timeout=30000" -p "redis.command_group=${command_group}" -p "fieldcount=${fieldcount}" -p "fieldlength=${fieldlength}" -threads ${threads} -p "redis.password=***:*****" 
Table 1. Parameters
ParameterDescription
server_ipThe IP address used to connect to the Tair instance.
port The service port used to connect to the Tair instance.
password

The password format varies based on the selected account:

  • If you use the default account whose username is the same as the instance ID, enter the password. For example, if the username of the default account is r-bp1zxszhcgatnx**** and the password is Password21, the command to verify the password is AUTH Password21.
  • If you use a custom account, enter the password in the user:password format. For example, if the username of the custom account is testaccount and the password is Rp829dlwa, the command to verify the password is AUTH testaccount:Rp829dlwa.
Note If you forget your password, you can reset it. For more information, see Change or reset the password.
recordcountThe amount of prepared data.
operationcountThe amount of data involved in the operation.
command_groupThe type of data that you want to test. In this test, the following types of data are tested in sequence:
  • String
  • Hash
  • List
  • Set
  • Zset
fieldcountThe number of fields or elements. To test strings, set this parameter to 1. To test other types of data, set this parameter to 10.
fieldlengthThe length of a value. Set this parameter based on the test requirements.
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.
INSERT Average LatencyThe average latency of write operations. Unit: µs.
INSERT 99th Percentile LatencyThe highest latency for the fastest 99% of write operations. Unit: µs. For example, if this parameter is set to 500 µs, 99% of the operations are processed within 500 µs.
READ AverageLatencyThe average latency of read operations. Unit: µs.
READ 99thPercentileLatencyThe highest latency for the fastest 99% of read operations. Unit: µs.
UPDATE AverageLatencyThe average latency of update operations. Unit: µs.
UPDATE 99thPercentileLatencyThe highest latency for the fastest 99% of update operations. Unit: µs.

Test results for data loading

Table 2. Strings
Value length (byte)QPSINSERT Average Latency (µs)INSERT 99th Percentile Latency (µs)
128134,478473687
256126,139504828
1,02499,7756381,051
2,04877,1308261,157
4,09660,6461,0501,534
Table 3. Hashes
Number of fields in a key Value length (byte)QPSINSERT Average Latency (µs)INSERT 99th Percentile Latency (µs)
10 12847,3531,3481,885
25646,7161,3662,181
1,02427,7592,2972,873
2,04816,6053,8334,923
Table 4. Lists
Number of elements in a keyValue length (byte)QPSINSERT Average Latency (µs)INSERT 99th Percentile Latency (µs)
1012864,9509791,310
25647,1571,3481,752
1,02426,7192,3863,457
2,04816,7143,8114,751
4,09610,1296,2797,891
Table 5. Sets
Number of members in a keyValue length (byte)QPSINSERT Average Latency (µs)INSERT 99th Percentile Latency (µs)
1012863,6701,0011,514
25644,7071,4272,129
1,02425,3752,5133,239
2,04814,3184,4515,619
4,0968,3787,6089,095
Table 6. Sorted sets
Number of elements in a keyValue length (byte)QPSINSERT Average Latency (µs)INSERT 99th Percentile Latency (µs)
1012840,2921,5852,469
25634,1681,8692,569
1,02421,3472,9893,905
2,04812,8684,9566,255
4,0967,8648,1019,599

Test results for Workload C

Table 7. Strings
Value length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)
128170,699362546
256163,829380565
1,024161,491386569
2,048130,189487729
4,096115,433548808
Table 8. Hashes
Number of fields in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)
10128 96,111662874
256 86,892733915
1,024 61,6081,0301,293
2,048 37,3341,6962,331
4,096 25,9432,4293,319
Table 9. Lists
Number of elements in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)
10128105,296604889
25697,047655890
1,02466,3849551,192
2,04835,7961,7692,461
4,09626,3142,3923,271
Table 10. Sets
Number of members in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)
1012897,825651896
25680,954787970
1,02459,9241,0601,313
2,04833,3561,9002,637
4,09623,6052,6773,723
Table 11. Sorted sets
Number of elements in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)
1012858,3801,0931,341
25656,2871,1331,390
1,02447,4681,3381,688
2,04830,0732,0962,783
4,09621,8502,8803,765

Test results for Workload A

Table 12. Strings
Value length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)UPDATE Average Latency (µs)UPDATE 99th Percentile Latency (µs)
128141,120451616450618
256137,551463617461618
1,024124,165516724508725
2,04892,652695881678871
4,09678,9948191,0427911,024
Table 13. Hashes
Number of fields in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)UPDATE Average Latency (µs)UPDATE 99th Percentile Latency (µs)
1012899,495646831633820
25688,235731985712966
1,02472,0138921,1598632,049
2,04845,7901,3791,8981,3542,821
4,09632,9121,8912,9311,9157,887
Table 14. Lists
Number of elements in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)UPDATE Average Latency (µs)UPDATE 99th Percentile Latency (µs)
1012871,6965917751,1851,383
25666,2946388001,2811,456
1,02453,4027911,0061,5811,865
2,04836,5191,2211,5812,2322,831
4,09628,3901,6182,1132,8033,777
Table 15. Sets
Number of members in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)UPDATE Average Latency (µs)UPDATE 99th Percentile Latency (µs)
1012866,3466407921,2821,445
25660,0107079931,4151,957
1,02445,3599331,1281,8582,073
2,04829,0271,5292,0212,8204,507
4,09621,4402,1442,7733,7265,095
Table 16. Sorted sets
Number of elements in a keyValue length (byte)QPSREAD Average Latency (µs)READ 99th Percentile Latency (µs)UPDATE Average Latency (µs)UPDATE 99th Percentile Latency (µs)
1012849,6958611,0501,7071,912
25648,0368911,0841,7631,970
1,02439,7951,0811,3862,1072,563
2,04828,4151,5971,9812,8553,589
4,09621,3172,2472,8213,6654,787