使用YCSB进行MongoDB的性能测试
配置:
CPU:E3-1230 V2 2C@3.4GHz
内存:DDR3 1333 2GB
硬盘:samsung 750 EVO 120GB
YCSB配置文件:
workload=com.yahoo.ycsb.workloads.CoreWorkload recordcount=1000000 operationcount=1000000 insertstart=0 fieldcount=8 fieldlength=250 readallfields=true writeallfields=false fieldlengthdistribution=constant readproportion=1 updateproportion=0 insertproportion=0 readmodifywriteproportion=0 scanproportion=0 maxscanlength=1000 scanlengthdistribution=uniform insertorder=hashed requestdistribution=zipfian hotspotdatafraction=0.2 hotspotopnfraction=0.8 table=usertable measurementtype=histogram histogram.buckets=1000 timeseries.granularity=1000 threadcount=100
插入数据:
ycsb-0.12.0/bin/ycsb load mongodb -P ycsb-0.12.0/workloads/workload_own -s -p mongodb.url=mongodb://192.168.199.177:27017 > a.txt
htop:
iostat:
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 9.00 0.00 79.00 0.00 27.79 720.30 0.51 6.43 0.00 6.43 1.48 11.70 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 19.00 0.00 184.00 0.00 76.69 853.57 5.08 27.63 0.00 27.63 1.23 22.60 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 8.00 0.00 89.00 0.00 35.04 806.20 0.79 8.45 0.00 8.45 1.71 15.20 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 22.00 2.00 207.00 0.01 79.98 783.85 6.87 33.11 2.00 33.41 1.17 24.50 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 13.00 0.00 217.00 0.00 84.41 796.68 7.55 34.63 0.00 34.63 1.18 25.50 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 25.00 1.00 107.00 0.00 39.12 742.00 0.85 8.22 0.00 8.30 1.57 17.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 16.00 1.00 227.00 0.00 85.30 766.21 6.46 28.36 22.00 28.39 1.14 26.10 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 9.00 0.00 330.00 0.00 156.71 972.56 26.94 81.35 0.00 81.35 1.22 40.40
插入mongostat:
日志输出:
mongo client connection created with mongodb://192.168.199.177:27017 [OVERALL], RunTime(ms), 59241.0 [OVERALL], Throughput(ops/sec), 16880.201211998447 [TOTAL_GCS_Copy], Count, 2695.0 [TOTAL_GC_TIME_Copy], Time(ms), 4650.0 [TOTAL_GC_TIME_%_Copy], Time(%), 7.849293563579278 [TOTAL_GCS_MarkSweepCompact], Count, 8.0 [TOTAL_GC_TIME_MarkSweepCompact], Time(ms), 116.0 [TOTAL_GC_TIME_%_MarkSweepCompact], Time(%), 0.195810334059182 [TOTAL_GCs], Count, 2703.0 [TOTAL_GC_TIME], Time(ms), 4766.0 [TOTAL_GC_TIME_%], Time(%), 8.04510389763846 [CLEANUP], Operations, 100 [CLEANUP], AverageLatency(us), 28.85 [CLEANUP], LatencyVariance(us), 72853.24750000001 [CLEANUP], MinLatency(us), 0 [CLEANUP], MaxLatency(us), 2714 [CLEANUP], 95thPercentileLatency(us), 0 [CLEANUP], 99thPercentileLatency(us), 0
查询数据:
ycsb-0.12.0/bin/ycsb load mongodb -P ycsb-0.12.0/workloads/workload_own -s -p mongodb.url=mongodb://192.168.199.177:27017 > b.txt
htop:
iostat:
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 1.31 474.15 5.01 38.71 1.49 171.82 10.10 21.08 19.83 138.59 0.18 8.86 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6067.00 0.00 499.77 0.00 168.71 123.75 20.61 20.61 0.00 0.16 100.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6058.00 0.00 497.23 0.00 168.10 117.37 19.28 19.28 0.00 0.17 100.10 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6591.09 0.00 495.70 0.00 154.02 114.30 17.35 17.35 0.00 0.15 99.31 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6155.00 0.00 503.04 0.00 167.38 120.20 19.57 19.57 0.00 0.16 100.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6247.00 1.00 497.52 0.05 163.10 121.97 19.47 19.47 17.00 0.16 100.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6089.00 0.00 502.10 0.00 168.88 122.00 20.10 20.10 0.00 0.16 100.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.00 6260.00 0.00 500.91 0.00 163.88 119.76 19.12 19.12 0.00 0.16 100.10
mongostat:
日志输出:
mongo client connection created with mongodb://192.168.199.177:27017 [OVERALL], RunTime(ms), 102328.0 [OVERALL], Throughput(ops/sec), 9772.496286451411 [TOTAL_GCS_Copy], Count, 3672.0 [TOTAL_GC_TIME_Copy], Time(ms), 4880.0 [TOTAL_GC_TIME_%_Copy], Time(%), 4.768978187788289 [TOTAL_GCS_MarkSweepCompact], Count, 0.0 [TOTAL_GC_TIME_MarkSweepCompact], Time(ms), 0.0 [TOTAL_GC_TIME_%_MarkSweepCompact], Time(%), 0.0 [TOTAL_GCs], Count, 3672.0 [TOTAL_GC_TIME], Time(ms), 4880.0 [TOTAL_GC_TIME_%], Time(%), 4.768978187788289 [READ], Operations, 1000000 [READ], AverageLatency(us), 10112.674283 [READ], LatencyVariance(us), 2.9294985906238544E8 [READ], MinLatency(us), 106 [READ], MaxLatency(us), 467497 [READ], 95thPercentileLatency(us), 46000 [READ], 99thPercentileLatency(us), 57000 [READ], Return=OK, 1000000