How to Perform Redis Benchmark?

Know how does your Redis perform, when it can break, throughput, data transfer rate, and more with the following brilliant tools.

Redis (Remote Dictionary Service) popularity and usage have gone up in the last few years.

Not just for enterprise applications but small to medium too. Even, you can usefor caching and performance is much better. If interested in learning Redis from scratch, then check out this.

As a developer or sysadmin for an enterprise application, you should be aware of performing benchmark to know your application performance and capacity. Redis benchmark is slightly different than the. The good news is, there are many free tools available so you can pick what works for you.

Ready to explore?

Redis-benchmark

Take advantage of Redis inbuilt benchmarking utility called redis-benchmark. Its included in Redis installation and can be executed by just typing redis-benchmark on UNIX. Its also available on Windows and executable is redis-benchmark.exe.

Let’s see the following examples.

Sending one million requests against 192.168.0.100

:~# redis-benchmark -h 192.168.0.100 -p 6379 -n 1000000====== PING_INLINE ====== 1000000 requests completed in 30.62 seconds 50 parallel clients 3 bytes payload keep alive: 161.85% <= 1 milliseconds99.55% <= 2 milliseconds99.93% <= 3 milliseconds99.96% <= 4 milliseconds99.98% <= 5 milliseconds99.99% <= 6 milliseconds99.99% <= 7 milliseconds100.00% <= 8 milliseconds100.00% <= 9 milliseconds100.00% <= 9 milliseconds32653.06 requests per second

1 million requests were completed in 30.62 seconds. Pay attention to the last line as well, ~32653 requests are served per second.

If you look at carefully the payload size is 3 bytes. That’s the default settings and to customize you can use -d parameter. The following test is for 100k requests with a 1mb payload.

:~# redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -d 1000000====== PING_INLINE ====== 100000 requests completed in 2.80 seconds 50 parallel clients 1000000 bytes payload keep alive: 173.19% <= 1 milliseconds99.95% <= 2 milliseconds100.00% <= 2 milliseconds35676.06 requests per second

Did you notice the parallel clients? Its 50 by default and to adjust, you can use -c parameter. Below example is for 200 clients.

:~# redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -d 1000000 -c 200====== PING_INLINE ====== 100000 requests completed in 3.77 seconds 200 parallel clients 1000000 bytes payload keep alive: 10.00% <= 1 milliseconds2.99% <= 2 milliseconds18.95% <= 3 milliseconds45.81% <= 4 milliseconds69.65% <= 5 milliseconds86.58% <= 6 milliseconds95.79% <= 7 milliseconds98.88% <= 8 milliseconds99.78% <= 9 milliseconds99.96% <= 10 milliseconds100.00% <= 10 milliseconds26532.24 requests per second

As you can see with 200 clients it took more time and processing also got slower. But, that’s expected and this helps to find the real-performance of application.

Not happy with Redis-benchmark tool? no worries, there are more as following.

Redis-cli

Just interested in the latency information?

Sure, you can use redis-cli shipped with the Redis server. You can execute with --latency parameter.

:~# redis-cli --latencymin: 0, max: 1, avg: 0.16 (1056 samples

By default, latency sample is every second but you can change with -i switch if needed.

Memtier Benchmark

by Redis Labs supports Redis and Memcache, both. It is an advanced benchmarking tool with various testing options such as following.

  • Test password protected Redis
  • Run the client in a cluster mode
  • Supply number of clients, requests, threads, data size,
  • Adjust the SET and GET ratio

and a lot more…

Here is a quick test report.

:~# memtier_benchmark [RUN #1] Preparing benchmark client...[RUN #1] Launching threads now...[RUN #1 100%, 133 secs] 3 threads: 1993223 ops, 15083 (avg: 14877) ops/sec, 639.97KB/sec (avg: 631.04KB/sec), 13.30 (avg: 13.44) msec latenc[RUN #1 100%, 134 secs] 0 threads: 2000000 ops, 15083 (avg: 14911) ops/sec, 639.97KB/sec (avg: 632.52KB/sec), 13.30 (avg: 13.41) msec latency4 Threads50 Connections per thread10000 Requests per clientALL STATS=========================================================================Type Ops/sec Hits/sec Misses/sec Latency KB/sec -------------------------------------------------------------------------Sets 1354.30 --- --- 13.40200 104.30 Gets 13528.13 0.00 13528.13 13.41000 526.98 Waits 0.00 --- --- 0.00000 --- Totals 14882.43 0.00 13528.13 13.40900 631.28 Request Latency DistributionType <= msec Percent------------------------------------------------------------------------SET 0.055 0.00SET 0.063 0.00SET 0.110 0.00SET 0.140 0.00SET 0.160 0.00SET 0.170 0.00SET 0.180 0.00SET 0.210 0.01SET 0.230 0.01SET 0.280 0.01SET 0.300 0.01SET 0.360 0.01SET 0.440 0.01SET 0.460 0.01SET 0.480 0.01SET 0.510 0.01SET 0.570 0.01SET 0.590 0.01SET 0.610 0.01SET 0.630 0.01SET 0.640 0.02SET 0.670 0.02SET 0.680 0.02SET 0.710 0.02SET 0.730 0.02SET 0.740 0.02SET 0.750 0.02SET 0.760 0.02SET 0.770 0.02SET 0.780 0.02SET 0.790 0.02SET 0.820 0.02SET 0.840 0.02SET 0.850 0.03SET 0.870 0.03SET 0.880 0.03SET 0.900 0.03SET 0.930 0.03SET 0.940 0.03SET 0.950 0.03SET 0.960 0.03SET 0.970 0.03SET 1.000 0.03SET 1.100 0.04SET 1.200 0.05SET 1.300 0.06SET 1.400 0.07SET 1.500 0.08SET 1.600 0.08SET 1.700 0.09SET 1.800 0.10SET 1.900 0.10SET 2.000 0.11SET 2.100 0.12SET 2.200 0.12SET 2.300 0.13SET 2.400 0.14SET 2.500 0.16SET 2.600 0.18SET 2.700 0.21SET 2.800 0.24SET 2.900 0.25SET 3.000 0.26SET 3.100 0.27SET 3.200 0.28SET 3.300 0.28SET 3.400 0.29SET 3.500 0.30SET 3.600 0.32SET 3.700 0.35SET 3.800 0.37SET 3.900 0.39SET 4.000 0.42SET 4.100 0.45SET 4.200 0.48SET 4.300 0.52SET 4.400 0.55SET 4.500 0.59SET 4.600 0.63SET 4.700 0.68SET 4.800 0.73SET 4.900 0.77SET 5.000 0.82SET 5.100 0.88SET 5.200 0.93SET 5.300 0.99SET 5.400 1.06SET 5.500 1.12SET 5.600 1.18SET 5.700 1.25SET 5.800 1.33SET 5.900 1.40SET 6.000 1.47SET 6.100 1.56SET 6.200 1.64SET 6.300 1.73SET 6.400 1.81SET 6.500 1.92SET 6.600 2.00SET 6.700 2.10SET 6.800 2.21SET 6.900 2.32SET 7.000 2.44SET 7.100 2.57SET 7.200 2.69SET 7.300 2.80SET 7.400 2.95SET 7.500 3.09SET 7.600 3.24SET 7.700 3.37SET 7.800 3.52SET 7.900 3.68SET 8.000 3.84SET 8.100 4.02SET 8.200 4.17SET 8.300 4.34SET 8.400 4.49SET 8.500 4.65SET 8.600 4.84SET 8.700 5.03SET 8.800 5.20SET 8.900 5.38SET 9.000 5.59SET 9.100 5.78SET 9.200 6.01SET 9.300 6.22SET 9.400 6.45SET 9.500 6.72SET 9.600 7.05SET 9.700 7.35SET 9.800 7.66SET 9.900 7.99SET 10.000 10.29SET 11.000 17.47SET 12.000 39.07SET 13.000 62.05SET 14.000 76.14SET 15.000 83.95SET 16.000 88.77SET 17.000 91.73SET 18.000 93.54SET 19.000 94.82SET 20.000 95.90SET 21.000 96.80SET 22.000 97.62SET 23.000 98.26SET 24.000 98.74SET 25.000 99.07SET 26.000 99.31SET 27.000 99.49SET 28.000 99.65SET 29.000 99.71SET 30.000 99.76SET 31.000 99.82SET 32.000 99.86SET 33.000 99.89SET 34.000 99.91SET 35.000 99.93SET 36.000 99.96SET 37.000 99.97SET 38.000 99.98SET 39.000 99.99SET 40.000 99.99SET 41.000 99.99SET 42.000 100.00SET 43.000 100.00SET 45.000 100.00SET 46.000 100.00---GET 0.053 0.00GET 0.054 0.00GET 0.055 0.00GET 0.067 0.00GET 0.068 0.00GET 0.076 0.00GET 0.082 0.00GET 0.086 0.00GET 0.100 0.00GET 0.110 0.00GET 0.120 0.00GET 0.130 0.00GET 0.140 0.00GET 0.150 0.00GET 0.160 0.00GET 0.170 0.00GET 0.190 0.00GET 0.200 0.00GET 0.210 0.00GET 0.220 0.00GET 0.230 0.00GET 0.240 0.00GET 0.250 0.00GET 0.270 0.00GET 0.280 0.00GET 0.290 0.00GET 0.300 0.00GET 0.320 0.00GET 0.330 0.00GET 0.340 0.00GET 0.350 0.01GET 0.360 0.01GET 0.380 0.01GET 0.400 0.01GET 0.430 0.01GET 0.440 0.01GET 0.460 0.01GET 0.470 0.01GET 0.480 0.01GET 0.500 0.01GET 0.510 0.01GET 0.520 0.01GET 0.530 0.01GET 0.540 0.01GET 0.550 0.01GET 0.560 0.01GET 0.580 0.01GET 0.590 0.01GET 0.600 0.01GET 0.610 0.01GET 0.620 0.01GET 0.630 0.01GET 0.640 0.01GET 0.650 0.01GET 0.660 0.01GET 0.670 0.01GET 0.680 0.01GET 0.690 0.01GET 0.700 0.01GET 0.710 0.01GET 0.720 0.01GET 0.730 0.01GET 0.740 0.01GET 0.750 0.01GET 0.760 0.01GET 0.770 0.01GET 0.780 0.01GET 0.790 0.01GET 0.800 0.01GET 0.810 0.01GET 0.820 0.01GET 0.830 0.01GET 0.840 0.01GET 0.850 0.02GET 0.860 0.02GET 0.870 0.02GET 0.880 0.02GET 0.890 0.02GET 0.900 0.02GET 0.910 0.02GET 0.920 0.02GET 0.930 0.02GET 0.940 0.02GET 0.950 0.02GET 0.960 0.02GET 0.970 0.02GET 0.980 0.02GET 0.990 0.02GET 1.000 0.02GET 1.100 0.02GET 1.200 0.03GET 1.300 0.04GET 1.400 0.04GET 1.500 0.05GET 1.600 0.05GET 1.700 0.05GET 1.800 0.06GET 1.900 0.06GET 2.000 0.07GET 2.100 0.07GET 2.200 0.08GET 2.300 0.09GET 2.400 0.09GET 2.500 0.11GET 2.600 0.13GET 2.700 0.16GET 2.800 0.18GET 2.900 0.20GET 3.000 0.20GET 3.100 0.21GET 3.200 0.21GET 3.300 0.22GET 3.400 0.24GET 3.500 0.25GET 3.600 0.26GET 3.700 0.28GET 3.800 0.31GET 3.900 0.33GET 4.000 0.36GET 4.100 0.39GET 4.200 0.43GET 4.300 0.46GET 4.400 0.49GET 4.500 0.53GET 4.600 0.57GET 4.700 0.61GET 4.800 0.65GET 4.900 0.69GET 5.000 0.73GET 5.100 0.78GET 5.200 0.83GET 5.300 0.89GET 5.400 0.95GET 5.500 1.01GET 5.600 1.08GET 5.700 1.14GET 5.800 1.21GET 5.900 1.30GET 6.000 1.37GET 6.100 1.45GET 6.200 1.54GET 6.300 1.62GET 6.400 1.71GET 6.500 1.80GET 6.600 1.90GET 6.700 1.99GET 6.800 2.10GET 6.900 2.21GET 7.000 2.33GET 7.100 2.45GET 7.200 2.56GET 7.300 2.67GET 7.400 2.80GET 7.500 2.94GET 7.600 3.08GET 7.700 3.22GET 7.800 3.36GET 7.900 3.51GET 8.000 3.66GET 8.100 3.83GET 8.200 3.99GET 8.300 4.17GET 8.400 4.32GET 8.500 4.49GET 8.600 4.67GET 8.700 4.84GET 8.800 5.00GET 8.900 5.18GET 9.000 5.37GET 9.100 5.58GET 9.200 5.78GET 9.300 6.00GET 9.400 6.25GET 9.500 6.53GET 9.600 6.82GET 9.700 7.11GET 9.800 7.41GET 9.900 7.77GET 10.000 10.13GET 11.000 17.36GET 12.000 39.32GET 13.000 62.21GET 14.000 76.31GET 15.000 83.98GET 16.000 88.82GET 17.000 91.71GET 18.000 93.50GET 19.000 94.77GET 20.000 95.84GET 21.000 96.76GET 22.000 97.58GET 23.000 98.22GET 24.000 98.73GET 25.000 99.07GET 26.000 99.32GET 27.000 99.51GET 28.000 99.66GET 29.000 99.73GET 30.000 99.78GET 31.000 99.83GET 32.000 99.87GET 33.000 99.90GET 34.000 99.92GET 35.000 99.94GET 36.000 99.96GET 37.000 99.97GET 38.000 99.98GET 39.000 99.99GET 40.000 99.99GET 41.000 99.99GET 42.000 100.00GET 43.000 100.00GET 44.000 100.00GET 45.000 100.00GET 46.000 100.00GET 47.000 100.00---:~#

I doubt if you can install this on Windows but for sure on UNIX distro like RHEL/CentOS, Ubuntu/Debian, MacOS, etc. It is free to give a try to experience.

RDBTools

Available as CLI and GUI, both.is a cross-platform tool and aims to help in improving application performance. Talking about specific to benchmarking, it got memory analysis feature which allows to investigate memory usage, key analysis, identify memory leaks and recommend to lower the memory usage.

You can view real-time performance and perform all sorts of administrative tasks through the GUI.

Conclusion

I hope the above tools help you to perform Redis benchmarking so you know the application performance.