Introduction

This document describes how to test the performance of DCS Redis instances. For example, you can test how fast a specific instance responds to high-concurrency SET or GET operations.

Test Tools

  • redis-benchmark

    The Redis client includes redis-benchmark, a performance testing utility that simulates N clients concurrently sending M query requests.

    Usage of redis-benchmark:

    redis-benchmark [-h {host}] [-p {port}] [-c {clients}] [-n {requests}> [-k {boolean}]
  • memtier_benchmark

    memtier_benchmark is a command-line tool developed by Redis Labs. It can generate traffic in various modes and supports both Redis and Memcached.

    This tool provides multiple options and reporting features that can be easily used through the CLI.

    For details, visit https://github.com/RedisLabs/memtier_benchmark.

Test Procedure

  1. Create a DCS Redis instance.
  2. Create three ECSs and configure the same AZ, VPC, subnet, and security group for the ECSs and the instance.

    Only one ECS is required for testing on a single-node or master/standby instance.

  3. Install redis-benchmark and memtier_benchmark on each ECS.

    • Installing redis-benchmark
      $ wget http://download.redis.io/releases/redis-5.0.8.tar.gz 
      $ tar xzf redis-5.0.8.tar.gz  
      $ cd redis-5.0.8/src 
      $ make  
    • Installing memtier_benchmark
      cd $HOME && \
      apt-get update && \
      apt-get install -y build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev redis-tools && \
      wget https://github.com/RedisLabs/memtier_benchmark/archive/1.2.17.zip && \
      unzip 1.2.17.zip && \
      cd memtier_benchmark-1.2.17 && \
      autoreconf -ivf && \
      ./configure && \
      make && \
      make install && \
      cd $HOME && \
      rm -rf 1.2.17.zip memtier_benchmark-1.2.17

  4. Run the test commands simultaneously on all ECSs.

    ./redis-benchmark -h {IP} -p {Port} -a {password} -n {nreqs} -r {randomkeys} -c {connect_number} -d {datasize} -t {command}
    ./memtier_benchmark --cluster-mode --ratio=(1:0 and 0:1)-s {IP} -n {nreqs}  -c {connect_number}  -t 4 -d {datasize}

    Reference values: -c {connect_number}: 200; -n {nreqs}: 10,000,000; -r {randomkeys}: 1,000,000; -d {datasize}: 32

    • -t indicates the command to run, such as SET or GET.
    • -c indicates the number of client connections.
    • -d indicates the size of a single data record in bytes.
    • -n indicates the number of test packets.
    • -r indicates the number of random keys.

  5. Repeat Step 4 with different client connections to obtain the maximum number of operations per second.
  6. The sum of operations per second of all the three ECSs indicates the performance of the instance specification.

    To test on a Redis Cluster instance, launch two benchmark tools on each ECS.

Test Metric

Queries per second (QPS), which is the number of commands processed per second.