How to simulate a stress test for an update-intensive workload?
HBSDLJZ opened this issue · 1 comments
How to simulate a stress test for an update-intensive workload?
@HBSDLJZ you can produce the expected scenario using two steps.
1st step ( pre-populate the data ). Example of 1M keys with default size of 32B :
$ memtier_benchmark --ratio 1:0 --key-pattern P:P --hide-histogram --key-maximum 1000000 --key-minimum 1
Writing results to stdout
[RUN #1] Preparing benchmark client...
[RUN #1] Launching threads now...
[RUN #1 100%, 6 secs] 0 threads: 2000000 ops, 285912 (avg: 291027) ops/sec, 21.24MB/sec (avg: 21.62MB/sec), 0.70 (avg: 0.69) msec latency
4 Threads
50 Connections per thread
10000 Requests per client
ALL STATS
============================================================================================================================
Type Ops/sec Hits/sec Misses/sec Avg. Latency p50 Latency p99 Latency p99.9 Latency KB/sec
----------------------------------------------------------------------------------------------------------------------------
Sets 290807.15 --- --- 0.68734 0.65500 1.34300 2.36700 22119.77
Gets 0.00 0.00 0.00 --- --- --- --- 0.00
Waits 0.00 --- --- --- --- --- --- ---
Totals 290807.15 0.00 0.00 0.68734 0.65500 1.34300 2.36700 22119.77
confirmation you have data fully loaded:
$ redis-cli info keyspace
# Keyspace
db0:keys=1000000,expires=0,avg_ttl=0
2nd step ( update heavy benchmark ). you change alter the write/read ratio via --ratio :. like explained in the --help
:
--ratio=RATIO Set:Get ratio (default: 1:10)
So. let's assume that 99% of your requests will be writes and 1% will be reads. Simulate via --ratio 99:1
Example of a 30seconds run:
$ memtier_benchmark --ratio 99:1 --test-time 30 --hide-histogram --key-maximum 1000000 --key-minimum 1
Writing results to stdout
[RUN #1] Preparing benchmark client...
[RUN #1] Launching threads now...
[RUN #1 100%, 30 secs] 0 threads: 9413125 ops, 311448 (avg: 313753) ops/sec, 23.11MB/sec (avg: 23.29MB/sec), 0.64 (avg: 0.64) msec latency
4 Threads
50 Connections per thread
30 Seconds
ALL STATS
============================================================================================================================
Type Ops/sec Hits/sec Misses/sec Avg. Latency p50 Latency p99 Latency p99.9 Latency KB/sec
----------------------------------------------------------------------------------------------------------------------------
Sets 310623.93 --- --- 0.63756 0.60700 1.23900 2.06300 23626.03
Gets 3134.27 3134.27 0.00 0.63697 0.60700 1.23900 2.03100 223.11
Waits 0.00 --- --- --- --- --- --- ---
Totals 313758.20 3134.27 0.00 0.63756 0.60700 1.23900 2.06300 23849.15
As you can see above, on average, per second we made 310K writes and 3K reads.
I believe the above is enough for you to simulate an update heavy benchmark. Closing this issue. If you still have doubts please re-open it.