Redis Performance Measurement
Prerequisite
Section titled “Prerequisite”- Deploy nGrider Controller on EKS https://github.com/kloudbank/session-k8s/tree/main/dev/ngrinder/controller
- Deploy nGrider Agent on EKS https://github.com/kloudbank/session-k8s/tree/main/dev/ngrinder/agent
$ git clone https://github.com/kloudbank/session-k8s.git
$ cd session-k8s$ kubectl apply -k ./dev/ngrinder/controller$ kubectl apply -k ./dev/ngrinder/agent- EKS Cluster Monitoring via Prometheus and Grafana http://k8s-grafana-grafana-6380e9e544-711314603.ap-northeast-2.elb.amazonaws.com/?orgId=1
Redis-Benchmark
Section titled “Redis-Benchmark”A performance measurement tool that Redis provides itself for RedisCluster and Sentinel setups.
- aof:no
SET: 27932.96 requests per second, p50=0.783 msecGET: 27948.57 requests per second, p50=0.775 msecLPUSH: 27987.69 requests per second, p50=0.775 msecLPOP: 28538.81 requests per second, p50=0.775 msec- aof:yes, aofsync:everysec
SET: 33579.59 requests per second, p50=0.375 msecGET: 31289.11 requests per second, p50=0.399 msecLPUSH: 33355.57 requests per second, p50=0.375 msecLPOP: 33590.86 requests per second, p50=0.375 msec- aof:yes, aofsync:always
SET: 9087.60 requests per second, p50=5.655 msecGET: 31908.10 requests per second, p50=0.391 msecLPUSH: 8882.57 requests per second, p50=5.759 msecLPOP: 9192.87 requests per second, p50=5.599 msecnGrinder
Section titled “nGrinder”Developed by Naver, this is a stress test tool that can simultaneously run script generation / test execution / monitoring and result report generation. http://naver.github.io/ngrinder/
Environment
Section titled “Environment”- Test Architecture
- Conducted in a suitable environment that yields performance of at least 3000 TPS
- nGrinder Agent x2
- EBS Volume iops 3000
| Container | CPU | Memory |
|---|---|---|
| Spring Boot | 0.5 / 4 | 4Gi |
| nGrinder | 0.5 / 2 | 4Gi |
| MariaDB | 0.5 / 1.0 | 1Gi |
| Redis | 0.3 / 0.5 | 0.5Gi |
- Test Results can be viewed in the nGrinder Management Console http://k8s-sessiond-ngrinder-aa75db0c27-1345478526.ap-northeast-2.elb.amazonaws.com/

Redis GET
Section titled “Redis GET”- Calls a Spring Boot API that fetches the cached result of the MariaDB departments table (10 rows by default)
GET Method Call Result
Section titled “GET Method Call Result”| Condition | TPS (max cpu) | |||||
|---|---|---|---|---|---|---|
| vUser | rows | repl. | mariadb | redis | redis AOF everysec | redis AOF always |
| 1000 | 10 | 1 | 2600 (380m) | 3630 (90m) | 3600 (90m) | 3650 (90m) |
| 2000 | 10 | 1 | 2600 (400m) | 2860 (70m) | 3000 (80m) | 3090 (80m) |
| 3000 | 10 | 1 | 2210 (350m) | 2310 (60m) | 2440 (60m) | 2370 (60m) |
| 3000 | 10 | 2 | 3270 (480m) | 3310 (90m) | 3230 (120m) | 3300 (80m) |
| 1000 | 1000 | 1 | 180 (110m) | 1620 (130m) | 1560 (80m) | 1580 (80m) |
1. Mariadb Select Test
Section titled “1. Mariadb Select Test”| vUser | rows | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|---|
| 1000 | 10 | 2min | 1 | 2600 | 0.0% | |
| 2000 | 10 | 2min | 1 | 2600 | 0.0% | |
| 3000 | 10 | 2min | 1 | 2210 | 0.1% | Judged as a performance degradation zone |
| 3000 | 10 | 5min | 2 | 3270 | 0.0% | Pod scale-out, 2210 -> 3270 |
| 1000 | 1000 | 2min | 1 | 180 | 0.0% | rows increased, 2600 -> 180 |
2. Redis GET Test
Section titled “2. Redis GET Test”| vUser | rows | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|---|
| 1000 | 10 | 2min | 1 | 3630 | 0.0% | |
| 2000 | 10 | 2min | 1 | 2860 | 0.0% | |
| 3000 | 10 | 2min | 1 | 2310 | 0.9% | Judged as a performance degradation zone |
| 3000 | 10 | 5min | 2 | 3310 | 0.0% | Pod scale-out, 2310 -> 3320 |
| 1000 | 1000 | 2min | 1 | 1620 | 0.0% | rows increased, 3630 -> 1620 |
3. AOF Redis GET Test (fsync: everysec)
Section titled “3. AOF Redis GET Test (fsync: everysec)”| vUser | rows | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|---|
| 1000 | 10 | 2min | 1 | 3600 | 0.0% | |
| 2000 | 10 | 2min | 1 | 3000 | 0.0% | |
| 3000 | 10 | 2min | 1 | 2440 | 0.1% | Judged as a performance degradation zone |
| 3000 | 10 | 5min | 2 | 3230 | 0.0% | Pod scale-out, 2440 -> 3230 |
| 1000 | 1000 | 2min | 1 | 1560 | 0.0% | rows increased, 3600 -> 1560 |
4. AOF Redis GET Test (fsync: always)
Section titled “4. AOF Redis GET Test (fsync: always)”| vUser | rows | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|---|
| 1000 | 10 | 2min | 1 | 3650 | 0.0% | |
| 2000 | 10 | 2min | 1 | 3090 | 0.0% | |
| 3000 | 10 | 2min | 1 | 2370 | 0.1% | Judged as a performance degradation zone |
| 3000 | 10 | 5min | 2 | 3300 | 0.0% | Pod scale-out, 2370 -> 3300 |
| 1000 | 1000 | 2min | 1 | 1580 | 0.0% | rows increased, 3650 -> 1580 |
Redis SET
Section titled “Redis SET”- Calls an API that SETs data into Redis with the same shape as 1 row of the MariaDB departments table
POST Method Call Result
Section titled “POST Method Call Result”| Condition | TPS (max cpu) | ||||
|---|---|---|---|---|---|
| vUser | repl. | mariadb | redis | redis AOF everysec | redis AOF always |
| 1000 | 1 | 1550 (980m) | 3170 (150m) | 2410 (150m) | 2300 (70m) |
| 2000 | 1 | 1530 (980m) | 3270 (160m) | 2310 (130m) | 2200 (100m) |
| 3000 | 1 | 1370 (970m) | 2840 (160m) | 2100 (130m) | 1900 (90) |
| 3000 | 2 | 1940 (970m) | 3350 (220m) | 3260 (270m) | 3140 (180m) |
1. Mariadb Insert Test
Section titled “1. Mariadb Insert Test”| vUser | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|
| 1000 | 2min | 1 | 1550 | 0.0% | |
| 2000 | 2min | 1 | 1530 | 0.0% | |
| 3000 | 2min | 1 | 1370 | 1.0% | Judged as a performance degradation zone |
| 4000 | 2min | 1 | 1350 | 1.2% | |
| 3000 | 5min | 2 | 1940 | 0.1% | Pod scale-out, 1370 -> 1940 |
2. Redis SET Test
Section titled “2. Redis SET Test”| vUser | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|
| 1000 | 2min | 1 | 3170 | 0.0% | |
| 2000 | 2min | 1 | 3270 | 0.0% | |
| 3000 | 2min | 1 | 2840 | 0.1% | Judged as a performance degradation zone |
| 4000 | 2min | 1 | 2500 | 1.3% | |
| 3000 | 2min | 2 | 2300 | 0.1% | replicas=2 in the degradation zone with multiple pods, load distribution is delayed early in the run |
| 3000 | 5min | 2 | 3350 | 0.0% | Pod scale-out, 2840 -> 3350 |
3. AOF Redis SET Test (fsync: everysec)
Section titled “3. AOF Redis SET Test (fsync: everysec)”| vUser | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|
| 1000 | 2min | 1 | 2400 | 0.0% | |
| 2000 | 2min | 1 | 2310 | 0.1% | |
| 3000 | 2min | 1 | 2100 | 0.1% | Judged as a performance degradation zone |
| 4000 | 2min | 1 | 2700 | 1.3% | When errors occur, TPS measurement appears somewhat inaccurate |
| 6000 | 2min | 1 | 2700 | 2.6% | When errors occur, TPS measurement appears somewhat inaccurate |
| 3000 | 5min | 2 | 3260 | 0.0% | Pod scale-out, 2100 -> 3260 |
4. AOF Redis SET Test (fsync: always)
Section titled “4. AOF Redis SET Test (fsync: always)”| vUser | Threshold | Replicas | TPS | Err. | Comment |
|---|---|---|---|---|---|
| 1000 | 2min | 1 | 2300 | 0.0% | |
| 2000 | 2min | 1 | 2200 | 0.0% | |
| 3000 | 2min | 1 | 1900 | 0.2% | Judged as a performance degradation zone |
| 4000 | 2min | 1 | 2300 | 1.4% | When errors occur, TPS measurement appears somewhat inaccurate |
| 6000 | 2min | 2 | 2300 | 9.9% | When errors occur, TPS measurement appears somewhat inaccurate |
| 3000 | 5min | 2 | 3140 | 0.0% | Pod scale-out, 1900 -> 3140 |
AOF everysec vs always
Section titled “AOF everysec vs always”- See the Redis Persistence explanation http://redisgate.kr/redis/configuration/persistence.php
- Based on the benchmark above and the nGrinder load test results,
when the Redis instance’s resources stay stable, there is no significant performance difference even when persisting data
- To verify the performance difference during persistence, an extreme load test was conducted
Load Test
Section titled “Load Test”- Environment
- Resources minimized so that CPU is at 100% usage
- Increased the size of the existing SET data (1 row) by 100
- Increased so that a lot of memory can be used to persist data
- EBS Volume iops 3000 -> 100
| Container | appendfsync | CPU | Memory |
|---|---|---|---|
| redis-cache-aof | everysec | 0.1 / 0.1 | 4Gi |
| redis-cache-always | always | 0.1 / 0.1 | 4Gi |
-
Memory Usage
- The redis configured with everysec occupies roughly twice as much memory

- The redis configured with everysec occupies roughly twice as much memory
-
AOF Redis SET Test
| vUser | Threshold | Replicas | TPS | Memory(max) | Err. | Comment |
|---|---|---|---|---|---|---|
| 1000 | 10min | 1 | 999 | 1747Mi | 0.0% | |
| 1000 | 10min | 1 | 618 | 1028Mi | 2.0% | Many errors occurred (7,228 / 359,730) |
- Comparison of Benchmark vs suitable-environment test vs load test results
- In the Redis Benchmark Test that does not go over the network, everysec write performance is superior
- In measurements over a container-to-container network such as the Spring Boot API, no significant difference is observed
| Persitence | appendfsync | TPS (B/M) | TPS (suitable) | TPS (load) |
|---|---|---|---|---|
| Redis AOF | everysec | 33579 | 2400 | 999 |
| Redis AOF | always | 9087 | 2300 | 618 |
Additional Test
Section titled “Additional Test”- Killing the Redis instance during nGrinder performance measurement
Test Result
Section titled “Test Result”- After TPS stabilized at 1:40, Redis was killed to force Pod Self Healing
- At the kill moment, Spring Boot raised “java.io.IOException: Connection reset by peer” | During the suitable performance measurement, nothing notable occurred
| Container | fsync | vUser | Threshold | Replicas | TPS | Err |
|---|---|---|---|---|---|---|
| Redis | off | 1000 | 3min | 1 | 2700 | 0.1% |
| Redis | everysec | 1000 | 3min | 1 | 2700 | 0.1% |
| Redis | always | 1000 | 3min | 1 | 2600 | 0.1% |
-
Redis appendonly off, see container cpu usage : a self-healing instance is created within 10 seconds and resumes processing data

-
Redis appendonly off, see TPS : recovers to a stable TPS level within 10 seconds

Backup> When EBS Volume Mount fails and Self-Healing is delayed
Section titled “Backup> When EBS Volume Mount fails and Self-Healing is delayed”- With the current EBS gp3 type volume, Multi Attach is not possible, so when the deploy node changes the volume may not attach right away
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 21s default-scheduler Successfully assigned app-dev/redis-cache-always-7d6db7c847-hjh7j to ip-10-0-0-10.example.compute.internal Warning FailedAttachVolume 22s attachdetach-controller Multi-Attach error for volume "pvc-00000000-0000-0000-0000-000000000000" Volume is already used by pod(s) redis-cache-always-7d6db7c847-9l54t Normal SuccessfulAttachVolume 6s attachdetach-controller AttachVolume.Attach succeeded for volume "pvc-00000000-0000-0000-0000-000000000000"