Redis – Benchmarks

  • Post author:
  • Post category:Redis
  • Post comments:0 Comments

Redis benchmark is the utility to check the performance of Redis by running n commands simultaneously.

Syntax

Following is the basic syntax of Redis benchmark.

redis-benchmark [option] [option value] 

Example

Following example checks Redis by calling 100000 commands.

redis-benchmark -n 100000  

PING_INLINE: 141043.72 requests per second 
PING_BULK: 142857.14 requests per second 
SET: 141442.72 requests per second 
GET: 145348.83 requests per second 
INCR: 137362.64 requests per second 
LPUSH: 145348.83 requests per second 
LPOP: 146198.83 requests per second 
SADD: 146198.83 requests per second 
SPOP: 149253.73 requests per second 
LPUSH (needed to benchmark LRANGE): 148588.42 requests per second 
LRANGE_100 (first 100 elements): 58411.21 requests per second 
LRANGE_300 (first 300 elements): 21195.42 requests per second 
LRANGE_500 (first 450 elements): 14539.11 requests per second 
LRANGE_600 (first 600 elements): 10504.20 requests per second 
MSET (10 keys): 93283.58 requests per second 

Following is a list of available options in Redis benchmark.

Sr.NoOptionDescriptionDefault Value
1-hSpecifies server host name127.0.0.1
2-pSpecifies server port6379
3-sSpecifies server socket
4-cSpecifies the number of parallel connections50
5-nSpecifies the total number of requests10000
6-dSpecifies data size of SET/GET value in bytes2
7-k1=keep alive, 0=reconnect1
8-rUse random keys for SET/GET/INCR, random values for SADD
9-pPipeline <numreq> requests1
10-hSpecifies server host name
11-qForces Quiet to Redis. Just shows query/sec values
12–csvOutput in CSV format
13-lGenerates loop, Run the tests forever
14-tOnly runs the comma-separated list of tests
15-IIdle mode. Just opens N idle connections and wait

Example

Following example shows the multiple usage options in Redis benchmark utility.

redis-benchmark -h 127.0.0.1 -p 6379 -t set,lpush -n 100000 -q  

SET: 146198.83 requests per second 
LPUSH: 145560.41 requests per second 

Leave a Reply