Backend/Redis

Redis 커넥션 풀

findmypiece 2021. 4. 15. 17:22
728x90

SpringBoot 기반 Redis 예제를 서칭하다보면 application.yml 에 아래와 같이 구성정보를 설정하는 경우를 볼 수 있다.

spring:
  redis:
    host: localhost
    port: 6379
    lettuce: 
      pool:
        max-active: 10
        max-idle: 10
        min-idle: 2

그런데 lettuce.pool 설정은 사실 의미없는 설정이다. Redis 자체는 싱글스레드 기반이기 때문에 여러 커넥션을 사용한다고 해도 성능이 좋아지지 않기 때문이다. 공식 문서를 보면 Redis 커넥션 풀링은 트랜잭션을 사용할때만 제한적으로 사용된다고 되어 있다.

 

참고
lettuce.io/core/release/reference/index.html#connection-pooling.is-connection-pooling-necessary
github.com/spring-projects/spring-boot/issues/14196
728x90

'Backend > Redis' 카테고리의 다른 글

Redis Cluster 동작방식  (0) 2021.04.28
redis 옵션 정리  (0) 2021.04.27
Redis 구성 방법  (0) 2021.04.27
맥북 redis-cli 설치 및 명령어 정리  (0) 2021.04.15
Redis null 값 캐싱하지 않기  (0) 2021.04.15