MEMTIER_BENCHMARK(1)
π¦ memtier_benchmark β the manual, but make it make sense π¦
okay bestie, welcome to MEMTIER_BENCHMARK(1) β the user-commands girlies. this is the whole page, every flag, every default, nothing skipped. grab a strawberry drink π and let's go.
β¨ NAME β¨
memtier_benchmark β the NoSQL benchmark tool. that's it, that's the name, no cap.
πΈ SYNOPSIS πΈ
memtier_benchmark [options]
literally just the command and then options. iconic behavior honestly.
π DESCRIPTION π
it's a memcache / redis NoSQL traffic generator and performance benchmarking tool. think of it as the gym buddy that makes your server do cardio and then tells you how sweaty it got π
π Connection and General Options:
-h,--host=ADDRβ the server address (default:localhost). yes she's got two meanings for-hon this page, we'll get there, don't come for her π-s,--server=ADDRβ literally the same thing as--host. twin energy.-p,--port=PORTβ the server port (default:6379)-S,--unix-socket=SOCKETβ UNIX Domain socket name (default:none)-4,--ipv4β force IPv4 address resolution.-6,--ipv6β force IPv6 address resolution.-P,--protocol=PROTOCOLβ which protocol to use (default:redis). the other supported protocols areresp2,resp3,memcache_textandmemcache_binary. when you use one ofresp2orresp3, the redis protocol version gets set via theHELLOcommand. cute, right?-a,--authenticate=CREDENTIALSβ authenticate with the creds you give. a simple password is what's used formemcache_textand Redis <= 5.x. you can specify<USER>:<PASSWORD>formemcache_binaryor Redis 6.x or newer with ACL user support π-u,--uri=URIβ server URI in the formatredis://user:password@host:port/dbnum. user, password and dbnum are all optional. for authentication without a username, use usernamedefault. for TLS, use the schemeredissπ--tlsβ enable SSL/TLS transport security--cert=FILEβ use the specified client certificate for TLS--key=FILEβ use the specified private key for TLS--cacert=FILEβ use the specified CA certs bundle for TLS--tls-skip-verifyβ skip verification of the server certificate (yes, she's trusting, be careful)--tls-protocolsβ specify the tls protocol version to use, comma delemited (their spelling, not mine π«Ά). use a combination of'TLSv1','TLSv1.1','TLSv1.2'and'TLSv1.3'.--sni=STRINGβ add an SNI header-x,--run-count=NUMBERβ how many full-test iterations to perform-D,--debugβ print debug output--cluster-modeβ run the client in cluster mode--transactionβ treat one full rotation of--commandentries as a transactional unit (likeWATCH/GET/MULTI/SETEX/EXEC/UNWATCH). every__key__in a rotation resolves to the same key (taken from the first keyed command's--command-key-pattern), so all the keyed commands hit one key and one slot: theWATCHguards the key theSETEXwrites and the unit runs withoutCROSSSLOTerrors β no hash-tag needed. this same-key behavior applies in every mode, so it also works against a single endpoint fronting a sharded backend (e.g. a Redis Enterprise proxy) where keyed commands have to share a slot. in--cluster-modeit additionally pins the whole rotation to the owning shard connection so the keyless commands (MULTI/EXEC/UNWATCH) stay with the keyed ones. caveat bestie: keep the literal text around__key__(including any{tag}) identical across keyed commands; differing affixes still hash to different slots. requires at least one--command.--pipeline> 1 is supported: in--cluster-modeeach rotation is sent contiguously on its pinned connection, so multiple whole transactions can be in flight without interleavingMULTI/EXEC. note: if--reconnect-on-errortriggers mid-rotation, the interrupted rotation's stats will be inaccurate (server-sideWATCH/MULTIstate is lost on reconnect). π
this one's a whole saga, I know. read it twice, it's giving "final boss of flags".
-h,--helpβ display this help. (yes.-hagain. she contains multitudes.)-v,--versionβ display version information
π Results Output Options:
-o,--out-file=FILEβ name of the output file (default:stdout)--json-out-file=FILEβ name of the JSON output file; if it's not set, nothing gets printed to json--client-stats=FILEβ produce a per-client stats file--hdr-file-prefix=FILEβ prefix of the HDR Latency Histogram output files; if it's not set, latency histogram files won't be saved--show-configβ print the detailed configuration before running--hide-histogramβ don't print the detailed latency histogram--print-percentilesβ specify which percentiles info to print on the results table (by default it prints percentiles:50,99,99.9)--print-all-runsβ when performing multiple test iterations, print and save results for all iterations β¨--realtime-latenciesβ replace the periodic single-line progress output with a per-tick block: line 1 = throughput + miss ratio, then one or more latency lines carrying the percentiles configured by--print-percentiles(immediate and overall, side-by-side). it redraws in place on a TTY; it appends cleanly when stderr is redirected to a file.--command-stats-breakdown=command|lineβ how to group command statistics in the output (default:command).command: aggregate by command name (first word, e.g.,SET,GET).line: show each command line separately.--command-miss-tracking=auto|offβ track per-key cache misses for arbitrary commands (default:auto).auto: enable for commands with a known reply shape (GET,MGET,HGET,HMGET,GETEX,EXISTS, ...).off: disable;mb.jsonwill not contain per-arbitrary-command Hits/Misses fields.--miss-rate-threshold=PERCENTAGEβ warn when the miss rate exceeds this percentage (default:1.0). accepts fractional values, e.g.0.5for half a percent.0warns on any miss.--cpu-warn-threshold=PERCENTAGEβ warn when a memtier worker thread's CPU exceeds this percentage of a core (default:95.0), indicating memtier itself may be the bottleneck and results may be unreliable.0warns on any CPU usage.--statsd-host=HOSTβ StatsD server hostname to send real-time metrics to (default:none, disabled)--statsd-port=PORTβ StatsD server UDP port (default:8125)--statsd-prefix=PREFIXβ prefix for StatsD metric names (default:memtier)--statsd-run-label=LABELβ label for this benchmark run, used to distinguish runs in dashboards (default:default)--graphite-port=PORTβ Graphite HTTP port for event annotations (default:8080for host access; use80when running inside the Docker network)--prometheus-port=PORTβ serve Prometheus metrics on this port at/metrics(default: disabled;0= ephemeral port)--prometheus-bind-addr=ADDRβ numeric IPv4/IPv6 address to bind the Prometheus exporter to (default:127.0.0.1; hostnames not supported π«)--prometheus-run-label=KEY=VALUEβ add a constant label to every Prometheus metric (repeatable; max16)--prometheus-latency-buckets=LISTβ comma-separated, strictly ascending latency histogram bounds in seconds (default: built-in 26-bound list). bounds closer than 1% of their value collapse to the same histogram slot and are rejected π
π§ͺ Test Options:
-n,--requests=NUMBERβ number of total requests per client (default:10000). use'allkeys'to run on the entire key-range π--rate-limiting=NUMBERβ the max number of requests to make per second from an individual connection (default is unlimited rate). if you use--rate-limitingand enter a very large rate that can't be met, memtier will do as many requests as possible per second.-c,--clients=NUMBERβ number of clients per thread (default:50)-t,--threads=NUMBERβ number of threads (default:4)--test-time=SECSβ number of seconds to run the test--clients-start=NUMBERβ starting number of clients per thread for staircase ramp-up. must be less than--clients. requires--clients-stepand--step-duration. π--clients-step=NUMBERβ number of clients to add per step in staircase ramp-up.--step-duration=SECSβ duration in seconds of each step before adding more clients.--ratio=RATIOβ Set:Get ratio (default:1:10)--pipeline=NUMBERβ number of concurrent pipelined requests (default:1)--reconnect-interval=NUMβ number of requests after which re-connection is performed--reconnect-on-errorβ enable automatic reconnection on connection errors (default: disabled)--max-reconnect-attempts=NUMβ maximum number of reconnection attempts (default:0, unlimited)--reconnect-backoff-factor=NUMβ backoff factor for reconnection delays (default:0, no backoff)--retry-on-errorβ resend a request when the server returns a transient error or the connection drops mid-flight. excludes permanent errors (WRONGTYPE,NOAUTH,NOPERM, syntax/argcount/unknown-command). default: disabled.--max-retries=Nβ maximum retries per request when--retry-on-erroris set.-1= unlimited (default),0= disable retries even with the master switch on,N>0 = bounded.MOVED/ASKredirects count toward this.--retry-backoff-ms=NUMβ delay between retries in milliseconds (default:0, immediate).--retry-backoff-factor=NUMβ exponential multiplier applied toretry-backoff-mson each successive retry (default:0, constant backoff).--retry-on=LISTβ restrict retries to error-status prefixes in this comma list (e.g.LOADING,BUSY,TRYAGAIN). default: retry everything not classified as permanent.--max-retry-queue=NUMβ hard cap on per-connection retry queue depth. when full, the pipeline stops accepting new work until the queue drains. default:0(auto =max(pipeline * 4, 64)).--failed-keys-file=PATHβ append every request that ultimately fails (retries exhausted or permanent error) as CSV:timestamp,command,key,status,retries. off by default. the benchmark continues if the file is unwritable. π«Ά--connection-timeout=SECSβ connection timeout in seconds,0to disable (default:0)--connection-stage-timeout=SECSβ abort with exit code2if no thread reaches steady state within SECS, or if connection-setup failures (AUTH/HELLO/SELECT/CLUSTER SLOTS/-ERRduring initial probe) persist for SECS without a successful handshake. this bounds the startup phase;--test-timestill bounds the steady-state run. default:30,0disables the supervisor.--thread-conn-start-min-jitter-micros=NUMβ minimum jitter in microseconds between connection creation (default:0)--thread-conn-start-max-jitter-micros=NUMβ maximum jitter in microseconds between connection creation (default:0)
and that's part one, bestie β more coming, don't go anywhere π
--multi-key-get=NUMβ turns on multi-key get commands, up toNUMkeys at once (default:0= off). In cluster mode the keys get probed straight out of the key space so every key in one batch routes to the same shard (and no, you don't need a hash-tag prefix π ).--select-db=DBβ the DB number to select, for when you're testing a redis server.--distinct-client-seedβ gives each client its own different random seed. no more twinning β¨--randomizeβ seeds the random off the timestamp (default is just a constant value, so yes, this one makes your runs actually differ).
π― Arbitrary command
--command=COMMANDβ drop in a command to send, wrapped in quotes. every command you specify runs with its own ratio and key-pattern options. like, for real for real:
--command="set __key__ 5" --command-ratio=2 --command-key-pattern=G
and if you wanna use a generated key or object, you plug in:
__key__β use a key generated from Key Options.__data__β use data generated from Object Options.
--command-ratioβ how many times the command is sent in sequence (default:1).--command-key-patternβ the key pattern for the command (default:R):Gfor Gaussian distribution.Rfor uniform Random.Zfor zipf distribution (this one limits keys to positive).Sfor Sequential.Pfor Parallel (that's Sequential where each client has a subset of the key-range).
--monitor-input=FILEβ reads commands from a RedisMONITORoutput file π«Ά. you can reference commands as__monitor_line1__,__monitor_line2__, etc., and use__monitor_line@__to select commands from the file. by default the selection is sequential β switch it up with--monitor-pattern=Rfor random. example time:
--monitor-input=monitor.txt --command="__monitor_line1__"
--monitor-pattern=S|Rβ the pattern for picking monitor commands (default:Sfor Sequential).S= Sequential selection.R= Random selection. pick your fighter β¨--scan-incremental-iterationβ enables SCAN cursor iteration mode π. when you use it with--command="SCAN 0 [MATCH pattern] [COUNT count] [TYPE type]", it automatically follows the cursor that comes back in each SCAN response. it sendsSCAN 0 ...first, thenSCAN <cursor> ...until the cursor comes back as0, then it restarts. requires--pipeline 1. stats get reported separately forSCAN 0andSCAN <cursor>β love that for us.--scan-incremental-max-iterations=NUMBERβ max number of continuation SCANs per iteration cycle (default:0, which means follow the cursor until it returns0).--command-is-readβ flags the preceding--commandas a read operation for--read-preferencerouting (it's a per-command override, iykyk).
π Read Preference Options
--read-preference=MODEβ which node class gets the read commands (default:primary). the modes:primaryβ all reads go to the master/primary node.secondaryβ all reads go to replica nodes only.secondaryPreferredβ replicas preferred; fall back to primary.nearestβ EWMA-based selection: seed cold replicas round-robin until warm, then route reads to the lowest-EWMA endpoint among warm replicas (the primary may participate if it has accumulated samples).
--read-server=HOST:PORTβ the replica endpoint for standalone (non-cluster) mode. it's repeatable; each occurrence adds one replica endpoint. IPv6 addresses can be written as[::1]:6380. NOTE: this is parsed but read dispatch is currently cluster-only β peep the README "Read Preference" section π.--replica-clients=Nβ connections per replica per client thread (default:0= inherit--clients). heads up: parsed but not yet wired β again, see the README "Read Preference" section.--replicas-per-shard=Kβ cap on replicas used per shard (default:0= all). also parsed but not yet wired, same README situation.--read-preference-fallback=MODEβ what to do when the target node class is unavailable (default:error). the options:errorβ return an error.queueβ (reserved; currently treated aserrorβ request queuing not yet implemented) π.primaryβ fall back silently to the primary.
π Object Options
-d,--data-size=SIZEβ object data size in bytes (default:32).--data-offset=OFFSETβ the actual size of the value will bedata-size + data-offset, and it'll useSETRANGE/GETRANGE(default:0).-R,--random-dataβ says the data should be randomized π².--data-size-range=RANGEβ use random-sized items in the specified range (min-max).--data-size-list=LISTβ use sizes from a weight list, formatted likesize1:weight1,..sizeN:weightN.--data-size-pattern=R|Sβ use this alongsidedata-size-range. when it's set toR, a random size from the defined data sizes gets used; when it's set toS, the defined data sizes are evenly distributed across the key range, see--key-maximum(defaultR).--expiry-range=RANGEβ use random expiry values from the specified range β°.
β¨ Imported Data Options
--data-import=FILEβ read object data from a file.--data-verifyβ enable data verification once the test is complete β .--verify-onlyβ only perform--data-verify, without any other test.--generate-keysβ generate keys for imported objects π.--no-expiryβ ignore expiry info in the imported data.
π Key Options
--key-prefix=PREFIXβ prefix for keys (default:"memtier-").--key-minimum=NUMBERβ key ID minimum value (default:0).--key-maximum=NUMBERβ key ID maximum value (default:10000000).--key-pattern=PATTERNβ the Set:Get pattern (default:R:R):Gfor Gaussian distribution.Rfor uniform Random.Zfor zipf distribution (limits keys to positive).Sfor Sequential.Pfor Parallel (that's Sequential where each client has a subset of the key-range).
--key-stddevβ the standard deviation used in the Gaussian distribution (default is the key range / 6).--key-medianβ the median point used in the Gaussian distribution (default is the center of the key range).--key-zipf-expβ the exponent used in the zipf distribution, limited to (0, 5). higher exponents mean higher concentration in the top keys (default is1β though ngl, any number >2 seems insane π).
β³ WAIT Options
--wait-ratio=RATIOβ the Set:Wait ratio (default is no WAIT commands at all β1:0).--num-slaves=RANGEβ WAIT for a random number of slaves in the specified range.--wait-timeout=RANGEβ WAIT for a random number of milliseconds in the specified range (normal distribution with the center in the middle of the range).
π COPYRIGHT
Copyright Β© 2011-2026 Redis Ltd. πΈ
This is free software. You may redistribute copies of it under the terms of the GNU General Public License http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the extent permitted by law β like, none, bestie, read the fine print π«Ά.
and that's the whole page, periodt π this was memtier_benchmark v=2.5.2 sha=... from October 2026 β go slay some benchmarks for me π
β¨
π¦ where this page comes from
- nixpkgs unstable: memtier-benchmark 2.5.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms