Using memtier_benchmark
This section describes how to use memtier_benchmark 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 Tool
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.
Downloading and Installing the Tool
CentOS 8.0 is used as an example.
- Preparations
- Install the tools required for compilation.
yum install -y automake
yum install -y make
yum install -y gcc-c++
yum install -y git
- Enable the PowerTools repository.
- Install the required dependencies.
yum install -y zlib-devel
yum install -y libmemcached-devel
yum install -y openssl-devel
- Install the tools required for compilation.
- Install the libevent library.
- Download, compile, and install the memtier_benchmark library.
- Create a folder in the root directory where the memtier_benchmark library will be stored.
- Download the memtier_benchmark source code.
git clone https://github.com/RedisLabs/memtier_benchmark.git
- Go to the directory where the source code is located.
- Compile the source code and generate the executable file memtier_benchmark.
autoreconf -ivf
./configure
make
- Install the tool in the system.
- Run the following command to check whether the installation is successful:
Test Procedure
- Create a DCS Redis instance.
- 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.
- Install memtier_benchmark on each ECS by referring to Downloading and Installing the Tool.
- Run the following test command on all ECSs:
memtier_benchmark -s {IP} -n {nreqs} -c {connect_number} -t 4 -d {datasize}
Run memtier_benchmark --cluster-mode -s {IP} -n {nreqs} -c {connect_number} -t 4 -d {datasize} for a Redis Cluster instance.
Reference values: -c {connect_number}: 200; -n {nreqs}: 10,000,000; -r {randomkeys}: 1,000,000; -d {datasize}: 32
- -t indicates the number of threads used in the benchmark test.
- -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.
- Repeat 4 with different client connections to obtain the maximum number of operations per second.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.