redis_performance
Redis Server Performance
![]() |
![]() |
![]() |
---|
레디스 서버 성능 New
Redis-7과 8 성능 비교
Redis-8을 출시(2025년 5월 02일)하면서 아래 '막대 그래프 이미지'를 보면 성능이 이전 버전보다 매우 좋아진 것으로 발표했습니다. 그래서 benchmark를 사용해서 Redis-7과 Redis-8의 성능을 비교 확인해 보았습니다.

테스트 서버 Spec
H/W Model: Dell R230 Xeon E3-1230v6(3.5G/4코어)
CPU: Intel(R) Xeon(R) CPU E3-1230 v6 @ 3.50GHz, 4cores/8threads
Memory: 8G
OS: CentOS 7.5
C Compiler: gcc 8.3.1
CPU: Intel(R) Xeon(R) CPU E3-1230 v6 @ 3.50GHz, 4cores/8threads
Memory: 8G
OS: CentOS 7.5
C Compiler: gcc 8.3.1
Redis-7.2.7과 Redis-8.0.0 명령별 성능 비교
- 평균(입력): 입력 명령들 평균이 초당 114,500으로 Redis-7과 Redis-8이 거의 비슷했습니다.
- 평균(전체): 대량 조회 명령을 포함한 전체 평균은 초당 97,700으로 Redis-7과 Redis-8이 거의 비슷했습니다.
- 결론: (실무적인 관점에서) Redis-7과 Redis-8의 성능은 거의 차이나지 않습니다.
Commands | Redis-7.2.7 | Redis-8.0.0 | 비교 | SET | 115,473 | 116,414 | 101% |
---|---|---|---|
GET | 112,486 | 112,360 | 100% |
INCR | 116,144 | 116,279 | 100% |
LPUSH | 115,875 | 116,550 | 101% |
RPUSH | 115,473 | 116,279 | 101% |
LPOP | 116,144 | 112,233 | 97% |
RPOP | 116,009 | 116,414 | 100% |
SADD | 111,111 | 114,416 | 103% |
HSET | 115,607 | 115,607 | 100% |
SPOP | 112,613 | 112,867 | 100% |
ZADD | 113,250 | 114,943 | 101% |
ZPOPMIN | 112,486 | 113,507 | 101% |
LPUSH | 116,414 | 116,550 | 100% |
평균(입력) | 114,545 | 114,955 | 100% |
LRANGE_100 | 66,050 | 65,876 | 100% |
LRANGE_300 | 30,590 | 30,358 | 99% |
LRANGE_500 | 20,842 | 19,708 | 95% |
LRANGE_600 | 17,864 | 17,117 | 96% |
MSET | 115,473 | 116,009 | 100% |
XADD | 116,822 | 116,009 | 99% |
평균(전체) | 97,723 | 97,868 | 100% |
* 레디스는 거의 기본으로 설정(redis.conf)했고, Redis-benchmark도 기본으로 실행했습니다.
* Server io-threads 1, benchmark threads 1
Redis-7 io-threads 설정 성능 비교
Redis-6부터 클라이언트로부터 오는 명령 읽기(read)와 결과 내보내기(write)를 별도 스레드로 처리할 수 있습니다. redis.conf 관련 파라이터는 아래와 같습니다.
- io-threads 1: default 1, 설정할 경우 CPU 코어수 - 1, 8코어(스레드)인 경우 7로 설정.
- io-threads-do-reads no/yes: default no. 권장: yes
redis.conf 설명에 yes로 설정하는 것이 별로 도움이 되지 않는다고 적혀있으나 테스트 결과를 보면 yes로 설정해야 성능이 향상됩니다.
redis.conf: "Usually threading reads doesn't help much." (읽기는 별 도움이 되지 않습니다.)
테스트 Case
- Case1: server io-threads 1, io-threads-do-reads no, benchmark threads 1 -> 기본 설정 100%
- Case2: server io-threads 7, io-threads-do-reads no, benchmark threads 1 -> 성능이 떨어진다. 96%
- Case3: server io-threads 7, io-threads-do-reads no, benchmark threads 7 -> 성능이 떨어진다. 96%
- Case4: server io-threads 7, io-threads-do-reads yes, benchmark threads 7 -> 성능이 좋아진다. 116%
- 결론: 'io-threads'를 사용하면 성능이 조금 좋아진다. 하지만 서버 CPU를 400~500% 사용한다. 그리고 클라이언트도 스레드 개수를 맞추어야 하는 번거로움이 있어서 실무적으로 볼 때 굳이 사용할 필요는 없어 보인다.
Commands | Case1 (1/no/1) |
Case2 (7/no/1) |
비교1 | Case3 (7/no/7) |
비교2 | Case4 (7/yes/7) |
비교3 |
---|---|---|---|---|---|---|---|
SET | 115,473 | 114,811 | 99% | 99,800 | 86% | 132,979 | 115% |
GET | 112,486 | 110,865 | 99% | 132,979 | 118% | 132,979 | 118% |
INCR | 116,144 | 114,811 | 99% | 99,701 | 86% | 132,979 | 114% |
LPUSH | 115,875 | 115,741 | 100% | 99,502 | 86% | 132,979 | 115% |
RPUSH | 115,473 | 115,207 | 100% | 99,800 | 86% | 131,406 | 114% |
LPOP | 116,144 | 115,340 | 99% | 99,206 | 85% | 133,156 | 115% |
RPOP | 116,009 | 115,875 | 100% | 99,800 | 86% | 132,979 | 115% |
SADD | 111,111 | 111,483 | 100% | 99,800 | 90% | 132,979 | 120% |
HSET | 115,607 | 111,857 | 97% | 99,701 | 86% | 133,156 | 115% |
SPOP | 112,613 | 92,336 | 82% | 132,626 | 118% | 132,626 | 118% |
ZADD | 113,250 | 99,404 | 88% | 133,156 | 118% | 132,802 | 117% |
ZPOPMIN | 112,486 | 102,249 | 91% | 132,626 | 118% | 133,333 | 119% |
LPUSH | 116,414 | 115,340 | 99% | 99,108 | 85% | 132,802 | 114% |
평균(입력) | 114,545 | 110,409 | 96% | 109,831 | 96% | 132,858 | 116% |
LRANGE_100 | 66,050 | 65,574 | 99% | 49,875 | 76% | 56,850 | 86% |
LRANGE_300 | 30,590 | 30,722 | 100% | 26,575 | 87% | 24,907 | 81% |
LRANGE_500 | 20,842 | 20,825 | 100% | 15,941 | 76% | 16,611 | 80% |
LRANGE_600 | 17,864 | 17,606 | 99% | 13,753 | 77% | 13,305 | 74% |
MSET | 115,473 | 108,342 | 94% | 79,808 | 69% | 79,808 | 69% |
XADD | 116,822 | 99,701 | 85% | 99,800 | 85% | 99,602 | 85% |
평균(전체) | 97,723 | 93,584 | 96% | 90,187 | 92% | 106,223 | 109% |
Redis-8 io-threads 설정 성능 비교
'io-threads'가 크게 개선되었다. 그리고 관련 소스 코드가 networking.c에 있었는데 iothread.c 파일을 새로 만들어서 옮겼다.
- io-threads 1: default 1, 설정할 경우 CPU 코어수 - 1, 8코어(스레드)인 경우 7로 설정.
- io-threads-do-reads: Redis-8에서 이 항목이 없어졌다.
테스트 Case
- Case1: server io-threads 1, benchmark threads 1 -> 기본 설정 100%
- Case2: server io-threads 7, benchmark threads 1-> 성능이 떨어진다. 82%
- Case3: server io-threads 7, benchmark threads 7 -> 성능이 매우 좋아진다. 173%
- 결론: 'io-threads'를 사용하면 성능이 크게 좋아집니다. 클라이언트 스레드 개수를 맞추어야 하는 번거로움이 있지만 시도해 볼만합니다.
Commands | Case1 (1/1) | Case2 (7/1) | 비교1 | Case3 (7/7) | 비교2 |
---|---|---|---|---|---|
SET | 116,414 | 82,850 | 71% | 199,203 | 171% |
GET | 112,360 | 94,607 | 84% | 199,203 | 177% |
INCR | 116,279 | 95,057 | 82% | 197,239 | 170% |
LPUSH | 116,550 | 95,511 | 82% | 195,312 | 168% |
RPUSH | 116,279 | 94,967 | 82% | 197,239 | 170% |
LPOP | 112,233 | 96,899 | 86% | 196,850 | 175% |
RPOP | 116,414 | 94,877 | 81% | 198,807 | 171% |
SADD | 114,416 | 93,197 | 81% | 198,807 | 174% |
HSET | 115,607 | 95,147 | 82% | 198,020 | 171% |
SPOP | 112,867 | 94,787 | 84% | 199,203 | 176% |
ZADD | 114,943 | 93,371 | 81% | 199,203 | 173% |
ZPOPMIN | 113,507 | 95,511 | 84% | 199,601 | 176% |
LPUSH | 116,550 | 99,800 | 86% | 199,601 | 171% |
평균(입력) | 114,955 | 94,352 | 82% | 198,330 | 173% |
LRANGE_100 | 65,876 | 60,350 | 92% | 99,701 | 151% |
LRANGE_300 | 30,358 | 28,153 | 93% | 56,980 | 188% |
LRANGE_500 | 19,708 | 19,194 | 97% | 36,284 | 184% |
LRANGE_600 | 17,117 | 16,636 | 97% | 28,458 | 166% |
MSET | 116,009 | 98,232 | 85% | 132,979 | 115% |
XADD | 116,009 | 97,087 | 84% | 199,203 | 172% |
평균(전체) | 97,868 | 81,381 | 83% | 164,837 | 168% |
* 8코어 서버에서 io-threads 14로 설정하면 오히려 성능이 떨어집니다.
CPU 별 Redis 성능
CPU (Intel Xeon) | OS | SET | GET | 비교 |
---|---|---|---|---|
Platinum 8358 2.6GHz 2t | Red Hat 8.6 | 178,000 | 187,000 | 2024년 10월 |
Gold 5217 3.0GHz 32t | Red Hat 8.6 | 87,000 | 91,000 | 2023년 12월 |
Gold 5317 3.0GHz 8t | Red Hat 8.6 | 205,000 | 189,000 | 2024년 02월 |
Gold 5515+ 3.2GHz | Red Hat 8.10 | 205,338 | 185,873 | 2024년 11월 |
Gold 6138 2.0GHz 2t | CentOS 7.9 | 96,700 | 2022년 08월 | |
Gold 6230 2.1GHz 4t | Red Hat 8.4 | 132,626 | 130,378 | 2024년 11월 |
Gold 6244 3.6GHz 16t | Oracle Linux 8.4 | 166,000 | 2022년 06월 | |
Gold 6248R 3.0GHz 8t | Red Hat 8.4 | 103,500 | 2023년 11월 | |
Gold 6248R 3.0GHz 4t | Red Hat 7.8 | 150,000 | 2022년 02월 | |
Gold 6254 3.1GHz | Red Hat 6.99 | 100,000 | 2021년 03월 | |
Gold 6326 2.9GHz | Ubuntu22.04.5 | 130,000 | 125,000 | 2024년 11월 |
Gold 6346 3.1GHz 8t | Red Hat 8.6 | 220,000 | 195,000 | 2024년 04월 |
Gold 6348 2.6GHz 8t | Red Hat 8.4 | 195,848 | 2023년 04월 | |
Gold 6442Y | Red Hat 8.10 | 182,149 | 162,866 | 2025년 04월 |
Gold 6526Y 32t | Rocky Linux 9.5 | 192,307 | 186,219 | 2025년 02월 |
Silver 4108 1.8GHz 4t | Rocky Linux 9.4 | 51,500 | 56,400 | 2024년 06월 |
Silver 4208 2.1GHz 16t | CentOS 7.7 | 140,000 | 140,000 | 2021년 09월 |
Silver 4309Y 2.8GHz 16t | Rocky Linux 8.10 | 202,020 | 207,900 | 2024년 04월 |
E5-2623 v4 2.6GHz | Rocky Linux 8.5 | 83,000 | 91,000 | 2024년 09월 |
E5-2680 v4 2.4GHz 4t | CentOS 7.9 | 62,000 | 70,000 | 2024년 03월 |
ToastCloud Virtual Gen2 16t | CentOS 7.9 | 74,000 | 2024년 01월 | |
레디스 서버 성능 2
성능 테스트 서버 사양 Specification
Redis Server : Version 3.0.1
OS : CentOS 7
H/W Model: HP DL320e Gen8 v2
Processor : Intel Xeon E3-1231V3.3 3.4GHz
Main Memory: DDR3 8GB RAM
Disk 1: SSD 256GB
Disk 2: SATA3 1TB
OS : CentOS 7
H/W Model: HP DL320e Gen8 v2
Processor : Intel Xeon E3-1231V3.3 3.4GHz
Main Memory: DDR3 8GB RAM
Disk 1: SSD 256GB
Disk 2: SATA3 1TB
Redis-benchmark 기본 테스트
- 테스트 결과
- 테스트 결과를 보면 SET, INCR, LPUSH 같은 대표적인 명령들이 초당 26만회 정도 처리한다.
- Appendonly 여부와 상관없이 비슷한 성능이 나왔다.
Appendonly를 everysec로 설정해서 운영하면 성능에 별 영향이 없을것으로 판단된다. - Appendonly를 always 설정하면 초당 1200회 처리하는 것으로 나왔다.
Always로 하고 레디스를 사용하는 것은 고려하지 않는것이 좋을거 같다.
Case 1: Appendonly No
Case 2: Appendonly Yes, everysec, Disk: SSD
Case 3: Appendonly Yes, everysec, Disk: SATA3
Case 2: Appendonly Yes, everysec, Disk: SSD
Case 3: Appendonly Yes, everysec, Disk: SATA3
Commands | Case 1 | Case 2 | Case 3 | Remark |
---|---|---|---|---|
PING_INLINE | 207,468 | 208,333 | 217,864 | |
PING_BULK | 257,069 | 261,096 | 260,416 | |
SET | 260,416 | 263,852 | 266,666 | |
GET | 261,096 | 261,096 | 258,397 | |
INCR | 263,157 | 268,817 | 269,541 | |
LPUSH | 263,852 | 269,541 | 266,666 | |
LPOP | 261,780 | 268,817 | 268,096 | |
SADD | 264,550 | 265,957 | 267,379 | |
SPOP | 265,252 | 266,666 | 263,852 | |
평균(입력) | 262,872 | 266,392 | 265,800 | |
LRANGE_100 | 97,751 | 98,328 | 97,276 | first 100 elements |
LRANGE_300 | 37,078 | 36,873 | 36,941 | first 300 elements |
LRANGE_500 | 25,940 | 25,779 | 25,786 | first 450 elements |
LRANGE_600 | 19,924 | 19,952 | 19,813 | first 600 elements |
MSET | 208,768 | 161,550 | 168,350 | 10 keys |
평균(전체) | 185,797 | 183,936 | 184,064 |
Master-Slaves SET 테스트
- Master : appendonly no, rdb no
- Master -> Slave1 : appendonly no, rdb no
- Master -> Slave1 -> Slave2 : appendonly no, rdb no
- Master -> Slave1 -> Slave2 : Slave2 만 appendonly yes 로 설정, rdb no
- Master -> SlaveA1 : appendonly no, rdb no
-> SlaveB1 : appendonly no, rdb no - Master : 물리 메모리(RAM) 용량을 초과해서 Swaping 될때 성능이 1/4로 이하로 떨어지므로 메모리를 초과해서 사용하지 않도록 모니터링을 해야 하고, 성능이 떨어졌을때 Swaping 때문인지 확인해 봐야 한다.
- Swap 영역을 사용하게 되면 470MB RDB 파일 BGSAVE나 BGREWRITEAOF를 하는데도 상당한 시간이 소요된다.
260,416 requests per second
241,466 requests per second
226,730 requests per second
220,306 requests per second
200,154 requests per second
51,156 requests per second, 정상 수치 : 260,416
Data size에 따른 성능
- H/W: PowerEdge R230
- CPU: Intel(R) Xeon(R) CPU E3-1230 v6 @ 3.50GHz
- # src/redis-benchmark -p 6000 -t set -d 10
103519.66 requests per second <- aof on everysec - # src/redis-benchmark -p 6000 -t set -d 100
102880.66 requests per second <- aof on everysec - # src/redis-benchmark -p 6000 -t set -d 1000 -> 1k
94250.71 requests per second <- aof on everysec - # src/redis-benchmark -p 6000 -t set -d 10000 -> 10k
31486.14 requests per second <- aof on everysec
93196.65 requests per second <- aof no - # src/redis-benchmark -p 6000 -t set -d 100000 -> 100k
2329.97 requests per second <- aof on everysec
18786.40 requests per second <- aof no
21074.82 requests per second <- get - # src/redis-benchmark -p 6000 -t set -d 200000 -> 200k
1200.54 requests per second <- aof on everysec
8776.55 requests per second <- aof no
9367.68 requests per second <- get - # src/redis-benchmark -p 6000 -t set -d 300000 -> 300k
813.25 requests per second <- aof on everysec
6346.39 requests per second <- aof no
5862.35 requests per second <- get
CPU 별 benchmark test
- cat /proc/cpuinfo
- Intel Xeon(R) Gold 5220 2.20GHz -> 30,000 ops
CentOS 7.8, docker, Redis 5.0.9 - Intel Xeon(R) Gold 6226 2.7GHz -> 90,000 ops
RedHat 7.6, Redis 5.0.10 - Intel Xeon(R) Gold 6254 CPU @ 3.10GHz -> 100,000ops
RedHat 6.99 - Intel(R) Xeon(R) Silver 4215 CPU @ 2.50GHz -> 140,000ops
CentOS 7.6 - 2.0Gz, VM -> 50,000 ops
3.8GHz, Bare Metal -> 150,000 ops
CentOS 7 - 2.20GHz -> 100,000 ops
Bare Metal, Redis 5.0.10
Redis 성능

- 멀티 클라이언트 vs 레디스 서버 싱글 스레드
성능에 관한 글
- Redis.io에 성능에 관한 자세한 글 How fast is Redis?
- Redis 개발자 Salvatore가 2010년 9월 21일(화)에 올린 글 On Redis, Memcached, Speed, Benchmarks and The Toilet
- dormando가 2010년 9월 21일(화)에 올린 글 Redis VS Memcached (slightly better bench)
- Salvatore가 dormando 글에 대한 Update 글 2010년 9월 23일(목) An update on the Memcached/Redis benchmark
<< Architecture Overview | Redis Server Performance | Redis-cli >> |
---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.