본문 바로가기
DATABASE/REDIS

REDIS는 왜 싱글스레드 일까?

by Rainbound-IT 2022. 6. 29.
반응형

우선 REDIS는 인메모리캐시를 위해 만들어 져서 메모리에 사용할땐 싱글스레드가 유용하다고 한다.

 

 

Redis가 단일 스레드인 4가지 이유

  1. CPU는 병목이 아님 : Redis의 모든 작업은 메모리 기반이며 CPU는 Redis의 병목이 아닙니다. 대부분의 경우 Redis의 병목 현상은 컴퓨터 메모리 또는 네트워크 대역폭의 크기일 가능성이 큽니다. 단일 스레드 Redis로 더 높은 성능을 원한다면 클러스터(다중 프로세스) 솔루션을 사용할 수 있습니다.
  2. 동시성 : 병렬 처리가 여러 클라이언트를 지원하는 유일한 전략은 아닙니다. Redis는 epoll및 이벤트 루프를 사용하여 동시성 전략을 구현하고 컨텍스트 전환 없이 많은 시간을 절약합니다.
  3. 구현하기 쉬움 : 다중 스레드 프로그램을 작성하는 것은 더 어려울 수 있습니다. 스레드에 대한 잠금 및 동기화 메커니즘을 추가해야 합니다.
  4. 간편한 배포 : 단일 스레드 응용 프로그램은 최소 단일 CPU 코어가 있는 모든 시스템에 배포할 수 있습니다.

 

 

Reference

 

https://dev.to/snj/why-redis-is-single-threaded-37p0

 

Why Redis is Single-Threaded

Redis is designed to run in a single thread, but the performance is excellent, why? 4 reaso...

dev.to

 

 

인 메모리 캐시라서

https://blog.katastros.com/a?ID=00750-d514be4d-94f6-4dd8-8d31-d45d8002478e 

 

Why is redis single threaded? - Katastros

//Todo Recently, a friend encountered a problem and found a blog on the Internet, so remember. However, I personally feel that this problem is really complicated to investigate, and it is related to the Reactor mode and I/O. Write a blog to discuss this is

blog.katastros.com

 

https://akasai.tistory.com/23

 

Redis가 싱글스레드인 이유?

Redis가 싱글스레드인 이유? | devlog.akasai 레디스의 대표적인 특징은 싱글스레드입니다. 왜 싱글스레드로 구성되었는지 알아보았습니다. 레디스가 싱글스레드인 이유? 레디스는 Event Loop(이벤트루

akasai.tistory.com

 

반응형

'DATABASE > REDIS' 카테고리의 다른 글

Redis 설치 윈도우 for window  (0) 2023.02.10
Redis 외부접속 허용  (0) 2022.08.08
AWS Elasticache Redis cli 통해 접속  (0) 2022.06.29
REDIS  (0) 2022.05.24
Redis 기본개념/구조  (0) 2021.08.27

댓글