1. 数据测试50%read,50%update1. 1 参数设置1.2 参数说明2. YCSB测试2.1 load阶段2.2 run阶段2.3 结果2.3.1 100W单线程2.3.2 100W四线程2.3.2 100W16线程
1. 数据测试50%read,50%update
1. 1 参数设置
编辑测试文件
workload_cassandra
测试100W条数据,单线程、4线程、16线程,修改threadcount =1,4,16
# YCSB参数 recordcount = 1000000 operationcount = 1000000 workload = site.ycsb.workloads.CoreWorkload readproportion = 0.5 updateproportion = 0.5 insertproportion = 0 scanproportion = 0 requestdistribution = zipfian threadcount = 4 readallfields = true # Cassanra参数 hosts = 192.168.92.159,192.168.92.160,192.168.92.161 port = 9042 cassandra.keyspace = ycsb cassandra.readconsistencylevel = QUORUM cassandra.writeconsistencylevel = QUORUM cassandra.maxconnections = 100 cassandra.connecttimeoutmillis = 1000000000 cassandra.readtimeoutmillis = 1000000000
- Tips📢📢📢
- hosts = 192.168.92.159,192.168.92.160,192.168.92.161后面不要有空格,有会报错
ycsb参数
cassandra参数
1.2 参数说明
# Yahoo! Cloud System Benchmark # Workload A: Update heavy workload # Application example: Session store recording recent actions # Read/update ratio: 50/50 # Default data size: 1 KB records (10 fields, 100 bytes each, plus key) # Request distribution: zipfian recordcount = 1000(表示load和run操作中,使用的YCSB实例记录数) operationcount = 1000(表示load和run操作中,使用的YCSB实例操作数) workload = com.yahoo.ycsb.workloads.CoreWorkload(要使用的工作负载类) readproportion = 0.5(默认是0.95,表示的是进行read的操作占所有操作的比例) updateproportion = 0.5(默认是0.05,表示的是进行update的操作占所有操作的比例) insertproportion = 0(默认是0,表示的是进行insert的操作占所有操作的比例) scanproportion = 0(默认是0,表示的是进行scan的操作占所有操作的比例) requestdistribution = zipfian(默认是uniform,应该使用什么分布来选择要操作的记录:uniform均匀, zipfian, hotspot, sequential, exponential 和 latest) threadcount = 2(默认值是1,表示YCSB客户端线程数) readallfields = true(默认值是1,应该读取读取所有字段(true),只读取一个(false))
2. YCSB测试
2.1 load阶段
bin/ycsb.sh load cassandra-cql -P ./data_record/workloada_cassandra -p columnfamily=test_table -s > ./data_record/load_16threads.txt
2.2 run阶段
bin/ycsb.sh run cassandra-cql -P ./data_record/workloada_cassandra -p columnfamily=test_table -s > ./data_record/run_16threads.txt
2.3 结果
2.3.1 100W单线程
- load大概33分钟
- run大概33分钟
[OVERALL], RunTime(ms), 2003402 [OVERALL], Throughput(ops/sec), 499.15094424384125 [TOTAL_GCS_G1_Young_Generation], Count, 2410 [TOTAL_GC_TIME_G1_Young_Generation], Time(ms), 2990 [TOTAL_GC_TIME_%_G1_Young_Generation], Time(%), 0.14924613232890852 [TOTAL_GCS_G1_Old_Generation], Count, 0 [TOTAL_GC_TIME_G1_Old_Generation], Time(ms), 0 [TOTAL_GC_TIME_%_G1_Old_Generation], Time(%), 0.0 [TOTAL_GCs], Count, 2410 [TOTAL_GC_TIME], Time(ms), 2990 [TOTAL_GC_TIME_%], Time(%), 0.14924613232890852 [READ], Operations, 500720 [READ], AverageLatency(us), 2148.0499940086274 [READ], MinLatency(us), 839 [READ], MaxLatency(us), 78975 [READ], 95thPercentileLatency(us), 3361 [READ], 99thPercentileLatency(us), 4499 [READ], Return=OK, 500720 [CLEANUP], Operations, 1 [CLEANUP], AverageLatency(us), 2237440.0 [CLEANUP], MinLatency(us), 2236416 [CLEANUP], MaxLatency(us), 2238463 [CLEANUP], 95thPercentileLatency(us), 2238463 [CLEANUP], 99thPercentileLatency(us), 2238463 [UPDATE], Operations, 499280 [UPDATE], AverageLatency(us), 1843.2053276718475 [UPDATE], MinLatency(us), 718 [UPDATE], MaxLatency(us), 36319 [UPDATE], 95thPercentileLatency(us), 2869 [UPDATE], 99thPercentileLatency(us), 3913 [UPDATE], Return=OK, 499280
2.3.2 100W四线程
- load大概10分钟
- run大概10分钟
[OVERALL], RunTime(ms), 589489 [OVERALL], Throughput(ops/sec), 1696.384495724263 [TOTAL_GCS_G1_Young_Generation], Count, 725 [TOTAL_GC_TIME_G1_Young_Generation], Time(ms), 1204 [TOTAL_GC_TIME_%_G1_Young_Generation], Time(%), 0.20424469328520126 [TOTAL_GCS_G1_Old_Generation], Count, 0 [TOTAL_GC_TIME_G1_Old_Generation], Time(ms), 0 [TOTAL_GC_TIME_%_G1_Old_Generation], Time(%), 0.0 [TOTAL_GCs], Count, 725 [TOTAL_GC_TIME], Time(ms), 1204 [TOTAL_GC_TIME_%], Time(%), 0.20424469328520126 [READ], Operations, 500397 [READ], AverageLatency(us), 2614.141987262114 [READ], MinLatency(us), 744 [READ], MaxLatency(us), 184959 [READ], 95thPercentileLatency(us), 4727 [READ], 99thPercentileLatency(us), 6931 [READ], Return=OK, 500397 [CLEANUP], Operations, 4 [CLEANUP], AverageLatency(us), 564564.25 [CLEANUP], MinLatency(us), 3 [CLEANUP], MaxLatency(us), 2258943 [CLEANUP], 95thPercentileLatency(us), 2258943 [CLEANUP], 99thPercentileLatency(us), 2258943 [UPDATE], Operations, 499603 [UPDATE], AverageLatency(us), 2066.139596839891 [UPDATE], MinLatency(us), 625 [UPDATE], MaxLatency(us), 197759 [UPDATE], 95thPercentileLatency(us), 3727 [UPDATE], 99thPercentileLatency(us), 5559 [UPDATE], Return=OK, 499603
2.3.2 100W16线程
- load大概2分钟
- run大概2分钟
[OVERALL], RunTime(ms), 173600 [OVERALL], Throughput(ops/sec), 5760.3686635944705 [TOTAL_GCS_G1_Young_Generation], Count, 348 [TOTAL_GC_TIME_G1_Young_Generation], Time(ms), 982 [TOTAL_GC_TIME_%_G1_Young_Generation], Time(%), 0.565668202764977 [TOTAL_GCS_G1_Old_Generation], Count, 0 [TOTAL_GC_TIME_G1_Old_Generation], Time(ms), 0 [TOTAL_GC_TIME_%_G1_Old_Generation], Time(%), 0.0 [TOTAL_GCs], Count, 348 [TOTAL_GC_TIME], Time(ms), 982 [TOTAL_GC_TIME_%], Time(%), 0.565668202764977 [READ], Operations, 499535 [READ], AverageLatency(us), 2967.8904280981315 [READ], MinLatency(us), 765 [READ], MaxLatency(us), 1328127 [READ], 95thPercentileLatency(us), 5447 [READ], 99thPercentileLatency(us), 10103 [READ], Return=OK, 499535 [CLEANUP], Operations, 16 [CLEANUP], AverageLatency(us), 142424.1875 [CLEANUP], MinLatency(us), 2 [CLEANUP], MaxLatency(us), 2279423 [CLEANUP], 95thPercentileLatency(us), 344 [CLEANUP], 99thPercentileLatency(us), 2279423 [UPDATE], Operations, 500465 [UPDATE], AverageLatency(us), 2425.5168033728633 [UPDATE], MinLatency(us), 574 [UPDATE], MaxLatency(us), 779263 [UPDATE], 95thPercentileLatency(us), 4327 [UPDATE], 99thPercentileLatency(us), 8439 [UPDATE], Return=OK, 500465