Redis Sorted Sets Benchmark

Overview

redis-zbench-go

Redis Sorted Sets Benchmark

Overview

This repo contains code to trigger load ( ZADD ) or query (ZRANGEBYLEX key min max) benchmarks, with/without transaction, with/without pipelining, and with diversified ways of controlling the per-key size and total keyspace length.

Install

Standalone binaries ( no Golang needed )

If you don't have go on your machine and just want to use the produced binaries you can download the following prebuilt bins:

OS Arch Link
Windows amd64 redis--go_windows_amd64.exe
Linux amd64 redis-zbench-go_linux_amd64
Linux arm64 redis-zbench-go_linux_arm64
Darwin amd64 redis-zbench-go_darwin_amd64
Darwin arm64 redis-zbench-go_darwin_arm64

Here's an example on how to use the above links:

# Fetch this repo
wget https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_linux_amd64

# change permissions
chmod 755 redis-zbench-go_linux_amd64

# give it a try 
./redis-zbench-go_linux_amd64 --help

Installation in a Golang env

The easiest way to get and install the benchmark utility with a Go Env is to use go get and then go install:

# Fetch this repo
go get github.com/filipecosta90/redis-zbench-go
cd $GOPATH/src/github.com/filipecosta90/redis-zbench-go
make

Usage of redis-zbench-go

To get a full grasp of the tool capabilities please check the --help output

$ ./redis-zbench-go --help
Usage of ./redis-zbench-go:
  -a string
        Password for Redis Auth.
  -c uint
        number of clients. (default 50)
  -d uint
        Data size of each sorted set element. (default 10)
  -debug int
        Client debug level.
  -h string
        Server hostname. (default "127.0.0.1")
  -key-elements-max uint
        Use zipfian random-sized items in the specified range (min-max). (default 10)
  -key-elements-min uint
        Use zipfian random-sized items in the specified range (min-max). (default 1)
  -mode load
        Bechmark mode. One of [load,query]. load will populate the db with sorted sets. `query` will run the zrangebylexscore command .
  -multi
        Run each command in multi-exec.
  -n uint
        Total number of requests. Only used in case of -mode=query (default 10000000)
  -p int
        Server port. (default 12000)
  -pipeline uint
        Redis pipeline value. (default 1)
  -r uint
        keyspace length. (default 1000000)
  -random-seed int
        random seed to be used. (default 12345)
  -rps int
        Max rps. If 0 no limit is applied and the DB is stressed up to maximum.

Sample output - 1M Keys keyspace, 100K issued commands, pipeline of 100 with transaction enabled, while querying at a limit of @10K RPS

Prepopulation

$ ./redis-zbench-go -mode load -r 1000000 -p 6379 
Total clients: 50. Commands per client: 20000 Total commands: 1000000
Using random seed: 12345
                 Test time                    Total Commands              Total Errors                      Command Rate           p50 lat. (msec)
                       18s [100.0%]                   1000000                         0 [0.0%]                   1370.82                      0.81      
#################################################
Total Duration 18.000 Seconds
Total Issued commands 1000000
Total Errors 0
Throughput summary: 55555 requests per second
Latency summary (msec):
          p50       p95       p99
        0.808     1.200     1.582

Querying with piepline of 100, and transction, @10K rps

$ ./redis-zbench-go  -mode query -p 6379 -pipeline 100 -c 10 -multi -rps 10000 -n 100000 -r 1000000
Total clients: 10. Commands per client: 10000 Total commands: 100000
Using random seed: 12345
                 Test time                    Total Commands              Total Errors                      Command Rate           p50 lat. (msec)
                        9s [100.0%]                    100000                         0 [0.0%]                   9095.29                      2.53      
#################################################
Total Duration 9.001 Seconds
Total Issued commands 100000
Total Errors 0
Throughput summary: 11110 requests per second
Latency summary (msec):
          p50       p95       p99
        2.529     3.509     6.083
#################################################
Printing reply histogram
Size: 0 Count: 51962. (% 51.96)
Size: 1 Count: 9774. (% 9.77)
Size: 2 Count: 5124. (% 5.12)
Size: 3 Count: 5276. (% 5.28)
Size: 4 Count: 5088. (% 5.09)
Size: 5 Count: 5152. (% 5.15)
Size: 6 Count: 4943. (% 4.94)
Size: 7 Count: 4694. (% 4.69)
Size: 8 Count: 4547. (% 4.55)
Size: 9 Count: 3440. (% 3.44)
--------------------------------------------------
Total processed replies 100000
Issues
  • iteration 1: load support

    iteration 1: load support

    sample run:

    ./redis-zbench-go -mode load -p 6379
    

    sample monitor:

    1620836504.202760 [0 127.0.0.1:45798] "ZADD" "zbench:197110" "0.982750" "tgrbrddfvr" "0.399122" "lwxumtqgea" "0.791812" "rfgbsovlrh" "0.928035" "djpufwsekn" "0.849254" "ryafvsqjas"
    1620836504.202774 [0 127.0.0.1:45774] "ZADD" "zbench:737098" "0.123524" "mfzlwrcjkr"
    1620836504.202779 [0 127.0.0.1:45860] "ZADD" "zbench:577103" "0.445228" "nbdlsovwkc"
    1620836504.202784 [0 127.0.0.1:45854] "ZADD" "zbench:837181" "0.342493" "khehyyowyo" "0.395914" "dsuhbwdhyx"
    1620836504.202791 [0 127.0.0.1:45836] "ZADD" "zbench:877147" "0.209063" "athnaihfas"
    1620836504.202797 [0 127.0.0.1:45816] "ZADD" "zbench:157150" "0.737548" "ltmlmhrxfl" "0.799316" "qtdxohtucs" "0.136205" "yrsadqodbo"
    1620836504.202806 [0 127.0.0.1:45852] "ZADD" "zbench:377107" "0.873844" "jonnnjoyhu" "0.674776" "haizumcggq" "0.965087" "npshzdbmxy" "0.971212" "haztktvfeh"
    1620836504.202817 [0 127.0.0.1:45814] "ZADD" "zbench:717156" "0.102659" "nrfknqxoyy" "0.318217" "kmxikxqzcn" "0.948921" "dwbwmxziwb" "0.764753" "cnfttceamk" "0.977405" "hozvqdymrm" "0.703648" "lbodrpebop" "0.031135" "vusitxthmz"
    
    
    enhancement 
    opened by filipecosta90 0
Owner
filipe oliveira
Performance Engineer at RedisLabs; Open Source Contributor;
filipe oliveira
Redis-benchmark - Simple get, mget and pipelined get benchmark.

redis-benchmark Simple get, mget and pipelined get benchmark. Usage git clone https://github.com/Ali-A-A/redis-benchmark.git cd ./redis-benchmark dock

Ali Abbasi Alaei 0 Dec 31, 2021
Golang client for redislabs' ReJSON module with support for multilple redis clients (redigo, go-redis)

Go-ReJSON - a golang client for ReJSON (a JSON data type for Redis) Go-ReJSON is a Go client for ReJSON Redis Module. ReJSON is a Redis module that im

Nitish Malhotra 264 May 11, 2022
Redis client Mock Provide mock test for redis query

Redis client Mock Provide mock test for redis query, Compatible with github.com/go-redis/redis/v8 Install Confirm that you are using redis.Client the

null 108 May 10, 2022
GoBigdis is a persistent database that implements the Redis server protocol. Any Redis client can interface with it and start to use it right away.

GoBigdis GoBigdis is a persistent database that implements the Redis server protocol. Any Redis client can interface with it and start to use it right

Riccardo 5 Apr 27, 2022
redis client implement by golang, inspired by jedis.

godis redis client implement by golang, refers to jedis. this library implements most of redis command, include normal redis command, cluster command,

piaohao 103 Apr 25, 2022
High-performance framework for building redis-protocol compatible TCP servers/services

Redeo The high-performance Swiss Army Knife for building redis-protocol compatible servers/services. Parts This repository is organised into multiple

Black Square Media 413 May 7, 2022
Go client for Redis

Redigo Redigo is a Go client for the Redis database. Features A Print-like API with support for all Redis commands. Pipelining, including pipelined tr

null 9.1k May 14, 2022
Type-safe Redis client for Golang

Redis client for Golang ❤️ Uptrace.dev - distributed traces, logs, and errors in one place Join Discord to ask questions. Documentation Reference Exam

null 14.3k May 11, 2022
Go Redis Client

xredis Built on top of github.com/garyburd/redigo with the idea to simplify creating a Redis client, provide type safe calls and encapsulate the low l

Raed Shomali 18 Jan 23, 2022
Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)

gokv Simple key-value store abstraction and implementations for Go Contents Features Simple interface Implementations Value types Marshal formats Road

Philipp Gillé 426 May 11, 2022
godis - an old Redis client for Go

godis Implements a few database clients for Redis. There is a stable client and an experimental client, redis and exp, respectively. To use any of the

Simon Zimmermann 86 Apr 16, 2022
Google Go Client and Connectors for Redis

Go-Redis Go Clients and Connectors for Redis. The initial release provides the interface and implementation supporting the (~) full set of current Red

Joubin Houshyar 441 Apr 16, 2022
Redis client library for Go

go-redis go-redis is a Redis client library for the Go programming language. It's built on the skeleton of gomemcache. It is safe to use by multiple g

Alexandre Fiori 45 Jul 15, 2020
Type-safe Redis client for Golang

Redis client for Golang ❤️ Uptrace.dev - distributed traces, logs, and errors in one place Join Discord to ask questions. Documentation Reference Exam

null 14.2k May 8, 2022
Use Redis' MONITOR to draw things in a terminal

Redis Top Redistop uses MONITOR to watch Redis commands and shows per command and per host statistics. Because MONITOR streams back all commands, its

Factory 28 Mar 22, 2022
Examples and code to assign a name to your MongoDB, MySQL, PostgreSQL, RabbitMQ, and redis connection.

your connection deserves a name ?? When your app interacts with an external system, assign a name to the connection. An external system in this contex

Andy Grunwald 25 Feb 15, 2022
redis protocol server for go.

redigosrv what redis server侧的golang版本实现。 why 作为后端RD,你开发的,维护的最多的应该就是你的server,作为服务的提供方来说,想要和客户端进行有效的交互,首先要要能理解信息的含义,因此一套通信协议是必须的。 为什么选择redis协议,应用层有很多成熟的

Saner 7 Nov 30, 2021
A Golang implemented Redis Server and Cluster.

Godis is a golang implementation of Redis Server, which intents to provide an example of writing a high concurrent middleware using golang.

finley 1.9k May 17, 2022
Schema based, typed Redis caching/memoize framework for Go

cacheme - Redis Caching Framework For Go English | 中文 Statically Typed - 100% statically typed using code generation. Scale Efficiently - thundering h

null 19 Mar 21, 2022