example for hset and hget
Closed this issue · 1 comments
I would like to run memtier benchmark for hset and hget commands. where it sets a hash with hset and sets ttl to it and then reads it. Write rate should be double of read rates. How to use memtier for it? I tried to use different commands, but it didn't add more than one hash.
--command "hset example key%d %d" --command-key-pattern=R --command-ratio=1
Let's consider 100 bytes per field, 2 fields on each key, 1M keys, 64 concurrent client connections, as an example.
step 1 - load the data (pre-populaion) :
memtier_benchmark -n allkeys -d 100 --threads 1 --clients 1 --key-maximum 1000000 --hide-histogram --command "HSET __key__ field1 __value__ field2 __value__ " --command-key-pattern P --pipeline 10 -s <host> -p <port> -a <auth>
step 1.1 - confirm keyspace length:
redis-cli info keyspace
# Keyspace
db0:keys=1000000,expires=0,avg_ttl=0
step 2 - benchmark HGET:
doing random deterministic access of keys, during 10minutes :
(notice conns= threads x clients per thread, so 4 x 16=64)
memtier_benchmark --test-time 600 -d 100 --threads 4 --clients 16 --key-maximum 1000000 --hide-histogram --command "HGET __key__ field1 " --command-key-pattern R -s <host> -p <port> -a <auth> --json-out-file result.json --distinct-client-seed
I'm closing this issue given I believe it is answered above. feel free to reopen if you have any doubt.