• Stars
    star
    904
  • Rank 50,534 (Top 1.0 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NoSQL Redis and Memcache traffic generation and benchmarking tool.

memtier_benchmark

GitHub GitHub release (latest SemVer) codecov

memtier_benchmark is a command line utility developed by Redis (formerly Garantia Data Ltd.) for load generation and bechmarking NoSQL key-value databases. It offers the following:

  • Support for both Redis and Memcache protocols (text and binary)
  • Multi-threaded multi-client execution
  • Multiple configuration options, including:
  • Read:Write ratio
  • Random and sequential key name pattern policies
  • Random or ranged key expiration
  • Redis cluster
  • TLS support
  • ...and much more

Read more at:

Getting Started

Prerequisites

The following libraries are required for building:

  • libevent 2.0.10 or newer.
  • libpcre 8.x.
  • OpenSSL (unless TLS support is disabled by ./configure --disable-tls).

The following tools are required

  • autoconf
  • automake
  • pkg-config
  • GNU make
  • GCC C++ compiler

CentOS 6.x

On a CentOS 6.x system, use the following to install prerequisites:

# yum install autoconf automake make gcc-c++
# yum install pcre-devel zlib-devel libmemcached-devel libevent-devel openssl-devel

CentOS 6.4 ships with older versions of libevent, which must be manually built and installed as follows:

To download, build and install libevent-2.0.21:

$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
$ tar xfz libevent-2.0.21-stable.tar.gz
$ pushd libevent-2.0.21-stable
$ ./configure
$ make
$ sudo make install
$ popd

The above steps will install into /usr/local so it does not confict with the distribution-bundled versions. The last step is to set up the PKG_CONFIG_PATH so configure can find the newly installed library.

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}

Then proceed to follow the build instructions below.

Ubuntu/Debian

On Ubuntu/Debian distributions, simply install all prerequisites as follows:

# apt-get install build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev libssl-dev

macOS

To build natively on macOS, use Homebrew to install the required dependencies:

$ brew install autoconf automake libtool libevent pkg-config [email protected]

When running ./configure, if it fails to find libssl it may be necessary to tweak the PKG_CONFIG_PATH environment variable:

PKG_CONFIG_PATH=/usr/local/opt/[email protected]/lib/pkgconfig ./configure

Building and installing

After downloading the source tree, use standard autoconf/automake commands:

$ autoreconf -ivf
$ ./configure
$ make
$ sudo make install

Testing

The project includes a basic set of integration tests.

Integration tests

Integration tests are based on RLTest, and specific setup parameters can be provided to configure tests and topologies (OSS standalone and OSS cluster). By default the tests will be ran for all common commands, and with OSS standalone setup.

To run all integration tests in a Python virtualenv, follow these steps:

$ mkdir -p .env
$ virtualenv .env
$ source .env/bin/activate
$ pip install -r tests/test_requirements.txt
$ ./tests/run_tests.sh

To understand what test options are available simply run:

$ ./tests/run_tests.sh --help

Using Docker

Use available images on Docker Hub:

# latest stable release
$ docker run --rm redislabs/memtier_benchmark:latest --help

# master branch edge build
$ docker run --rm redislabs/memtier_benchmark:edge --help

Or, build locally:

$ docker build -t memtier_benchmark .
$ docker run --rm memtier_benchmark --help

Using Docker Compose

$ docker-compose -f docker-compose.memcached.yml up --build

or

$ docker-compose -f docker-compose.redis.yml up --build

Using memtier_benchmark

See the included manpage or run:

$ memtier_benchmark --help

for command line options.

Cluster mode

Connections

When using the cluster-mode option, each client opens one connection for each node. So, when using a large number of threads and clients, the user must verify that he is not limited by the maximum number of file descriptors.

Using sequential key pattern

When there is an asymmetry between the Redis nodes and user set the --requests option, there may be gaps in the generated keys.

Also, the ratio and the key generator is per client (and not connection). In this case, setting the ratio to 1:1 does not guarantee 100% hits because the keys spread to different connections/nodes.

Full latency spectrum analysis

For distributions that are non-normal, such as the latency, many “basic rules” of normally distributed statistics are violated. Instead of computing just the mean, which tries to express the whole distribution in a single result, we can use a sampling of the distribution at intervals -- percentiles, which tell you how many requests actually would experience that delay.

When used for normally distributed data, the samples are usually taken at regular intervals. However, since the data does not obey to a normal distribution it would be very expensive to keep equally spaced intervals of latency records while enabling large value ranges. We can apply algorithms that can calculate a good approximation of percentiles at minimal CPU and memory cost, such as t-digest or HdrHistogram. On memtier_benchmark we’ve decided to use the HdrHistogram due to its low memory footprint, high precision, zero allocation during the benchmark and constant access time.

By default Memtier will output the 50th, 99th, and 99.9th percentiles. They are the latency thresholds at which 50%, 99%, and 99.9% of commands are faster than that particular presented value. To output different percentiles you should use the --print-percentiles option followed by the comma separated list of values ( example: --print-percentiles 90,99,99.9,99.99 ).

Saving the full latency spectrum

To save the full latencies you should use the --hdr-file-prefix option followed by the prefix name you wish the filenames to have. Each distinct command will be saved into two different files - one in .txt (textual format) and another in .hgrm (HistogramLogProcessor format). The textual format can be hard to analyze solely, but you can use an online formatter to generate visual histograms from it. The .hgrm format will be later added as input to Redislabs mbdirector to enable visualization of time-domain results.

Sample Visual Feel of the full latency spectrum using an online formatter: alt text

More Repositories

1

redis-cluster-proxy

A proxy for Redis clusters.
C
994
star
2

spark-redis

A connector for Spark that allows reading and writing to/from Redis cluster
Scala
939
star
3

redisraft

A Redis Module that make it possible to create a consistent Raft cluster from multiple Redis instances.
C
819
star
4

redis-enterprise-k8s-docs

Python
154
star
5

geo.lua

A helper library for Redis geospatial indices
Lua
146
star
6

redis-quartz

A Quartz Scheduler JobStore that uses Redis for persistent storage.
Java
144
star
7

redis-lua-debugger

A Redis Lua script for debugging Redis Lua scripts
Lua
88
star
8

raft

C implementation of the Raft Consensus protocol, BSD licensed
C
68
star
9

spark-redis-ml

A spark package for loading Spark ML models to Redis-ML
Scala
63
star
10

redislabs-docs

Source for docs.redis.com (Redis Enterprise, Redis Cloud, RedisInsight, and more).
Python
63
star
11

redis-recommend

Simple Redis Go recommendation engine
Go
61
star
12

redis-migrate

Small utility for interactively migrating a bunch of redis servers to another bunch of redis servers.
Python
59
star
13

sentinel_tunnel

A local proxy server for discovering and to Redis via Sentinel
Go
45
star
14

redis-microservices-for-dummies

Sample application described in Redis Microservices for Dummies
Python
35
star
15

terraform-provider-rediscloud

Terraform Redis Cloud Provider: Deploy, update, and manage Redis Cloud databases as code through HashiCorp Terraform
Go
30
star
16

redis-fs

Distributed in memory filesystem
Python
26
star
17

triemap

C implementation of a compressed trie lookup map
C
21
star
18

bmemcached-cli

memcached command line interface with SASL (binary protocol) support
Python
20
star
19

redis-webcli

A tiny Flask app to provide access to Redis through a web form.
Python
17
star
20

redis-for-dummies

JavaScript
16
star
21

ReSearch

Redis search and indexing in Java
Java
15
star
22

lua-redimension

Redis multi-dimensional query library in Lua
Lua
14
star
23

rediscloud-node-sample

Redis Cloud on Express Sample
HTML
14
star
24

redislabs-helm

Helm charts for Redis Enterprise
Smarty
13
star
25

vault-plugin-database-redis-enterprise

HashiCorp Vault Plugins for Redis Enterprise
Go
13
star
26

rmtest

redis module unit tests with python (deprecated) please see RLTest
Python
12
star
27

redis-watch

home of the open source Redis Watch - a newsletter about Everything and Anything Redis
12
star
28

eredis

Embedded Redis experiment
C
10
star
29

redis-stream

Exposes Redis stream through the command line
C
10
star
30

gkemarketplace

Python
9
star
31

mbdirector

Memtier benchmark front-end
Python
8
star
32

redis-pipeline

Non blocking pipelined python client for redis and redis protocol parser.
Python
6
star
33

luascript

Easy Lua Handling
Java
6
star
34

jedis-ml

Add Redis-ML commands to Jedis
Java
6
star
35

memcache_populator

Python script for populating a memcahed sever from GarantiaData exported CSV files.
Python
6
star
36

pubsub-sub-bench

Redis Pub/Sub Subscriber Workload generator
Go
5
star
37

docker-library-redis

Shell
5
star
38

engineering-blog

Redis Labs Engineering Blog
HTML
5
star
39

gesher

K8s Admission control proxy
Go
5
star
40

rediscloud-openshift-quickstart

A Ruby and Redis-Cloud hosted redis bootstrap for RedHat's OpenShift cloud.
Ruby
5
star
41

redis-java-complex-benchmark

This benchmark stress redis with unionstore command
Java
4
star
42

rmr

POC Redis Module MapReduce operations
C
4
star
43

rediscloud-java-sample

Redis Cloud on Play Sample
HTML
4
star
44

redis-edge-azure-iot

JavaScript
4
star
45

redis-enterprise-azure

Automated Redis Enterprise Pack (a.k.a RP or a.k.a RLEC) test env deployment to Azure
Shell
4
star
46

rediscloud-ruby-sinatra-sample

Redis Cloud on Sinatra Sample
HTML
4
star
47

rgm

C
3
star
48

redis-ee-docker

Docker-based Redis Enterprise cluster infrastructure
Shell
3
star
49

rediscloud-go-api

Go SDK for Redis Enterprise Cloud Pro
Go
3
star
50

java-high-availability-test

this java program check recovery and also data consistency to redis.
Java
3
star
51

redis_extensions

C
3
star
52

redismodules.com

The repository of redismodules.com
Python
2
star
53

crdbmemcalc

CRDB/Redis memory calculator for synthetic datasets
Python
2
star
54

memcachedcloud-node-sample

Memcached Cloud on Express Sample
HTML
2
star
55

memcachedcloud-openshift-quickstart

A Ruby app using Memcahced Cloud Service on Red Hat's OpenShift
Ruby
2
star
56

rmnotify

A library for key and event space Notifications for Redis Modules
C
2
star
57

mkdocs-versions-menu

An MkDocs plugin that generates a versions menu for the mkdocs-material theme.
Python
2
star
58

rmadm

Python
2
star
59

spark-redis-blockstore

Apache spack off heap cache block manager over redis - see https://github.com/RedisLabs/spark-redis
Scala
2
star
60

memcachedcloud-php-sample

Memcached Cloud on PHP Sample
PHP
1
star
61

memcachedcloud-ruby-sinatra-sample

Memcached cloud on Sinatra Sample
HTML
1
star
62

memcachedcloud-django-sample

Memcached Cloud on Django Sample
Python
1
star
63

testing-workshop

Rust
1
star
64

rsctl

Command line control utility for RediSearch on RedisLabs Enterprise Cluster
Python
1
star
65

rediscloud-php-sample

Redis Cloud on PHP Sample
PHP
1
star
66

DockerHub

Docker Hub for Redis Enterprise and OSS Modules
Shell
1
star
67

rediscloud-django-sample

Redis Cloud on Django Sample
Python
1
star
68

pulumi-rediscloud

Redis Cloud Pulumi Resource Provider
Go
1
star