Testing Redis Performance Using memtier_benchmark
memtier_benchmark is a command-line tool developed by Redis Labs. It can generate traffic in various modes and supports Redis. 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.
This section describes how to use memtier-benchmark to test the performance of a DCS Redis instance when running command SET or GET in a high-concurrency scenario.
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. 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: If a parameter description of memtier_benchmark is returned, the installation is successful.
- Preparations
- 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; -d {datasize}: 32
- -s indicates the domain name or IP address of the instance.
- -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.
- Repeat 4 with different client connections to obtain the maximum QPS (Query per Second, number of read and write 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot