DevOps

Redis 설치 유의사항 - Slow clocksource - redis-server --check-system

IT오이시이 2025. 7. 21. 11:24
728x90

 

Redis 설치 유의사항 - Slow clocksource - redis-server --check-system 

redis-server --check-system 명령 실행 시 나타난 경고 메시지와 관련하여 주요 내용을 요약하면 다음과 같습니다.

 

1. Slow clocksource 경고

 
text
Slow system clocksource detected. Current clocksource: kvm-clock. Available clocksources: kvm-clock hpet acpi_pm. Run 'echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource' as root to change clocksource. To make permanent, set 'clocksource=' kernel command line parameter.

 

의미

  • 현재 시스템이 사용하는 클록소스(kvm-clock)가 느려서 Redis 성능 저하를 야기할 수 있음.
  • 클록소스는 CPU의 시간 측정 기준이 되는데, 느린 클록소스는 Redis의 타임스탬프 계산 및 내부 지연 측정에 악영향.
  • Redis는 내부 타이머와 이벤트 처리에서 정확하고 빠른 클록소스 사용을 권장함.

 

권장 조치

  • 실시간 변경: 
    bash
    sudo bash -c 'echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource'
  •  
  • 재부팅 후 영구 적용:
    부팅 커널 파라미터에 clocksource=tsc 추가

 

 

2. 기타 시스템 점검 결과

  • [xen-clocksource]...OK
    Xen 가상화 환경 관련 시계소스 정상
  • [overcommit]...OK
    메모리 오버커밋 설정 이상 없음
  • [THP]...OK
    Transparent HugePages 상태 양호 (비활성화 권장 상태 등)

 

3. 배경 및 참고

  • 느린 클록소스는 CPU의 시간 측정 정확도를 떨어뜨려 Redis가 명령 처리 시간, 만료 체크 등에서 지연이 생길 수 있음7.
  • Redis는 CPU 바인딩, eviction 처리 집중 시 CPU 점유율 급등 등 다양한 요소로 지연이 생기는데,
    느린 시계소스가 더해지면 내부 타이밍이 부정확해지고 장애나 성능 저하 유발 가능24.
  • 시계소스 변경 후에는 Redis 재시작 권장.

 

4. 요약

문제원인 및 효과권장 해결책

 

문제점  원인 증상 해결책
느린 클록소스 경고 현재 kvm-clock이 느림 클록소스를 tsc로 변경 (echo tsc > ...)
영향 Redis 명령 처리 시간 측정 부정확, 지연 발생 가능 커널 파라미터에 clocksource=tsc 추가해 부팅시 적용
 

필요하면 시계소스 변경과 관련한 구체적인 시스템 명령 및 설정 방법도 안내해 드릴 수 있습니다.

 

 
소스 확인
  1. https://www.openmymind.net/Redis-SlowLog-and-DEL-surprisingly-bad-performance/
  2. https://about.gitlab.com/blog/how-we-diagnosed-and-resolved-redis-latency-spikes/
  3. https://last9.io/blog/redis-metrics-monitoring/
  4. https://www.alibabacloud.com/blog/is-your-redis-slowing-down-part-1-determining-slowdown_600187
  5. https://charsyam.wordpress.com/2016/08/08/%EC%9E%85-%EA%B0%9C%EB%B0%9C-redis-%EC%9D%98-slowlog%EB%8A%94-%EC%96%B4%EB%96%BB%EA%B2%8C-%EC%B8%A1%EC%A0%95%EB%90%98%EB%8A%94%EA%B0%80/
  6. https://changelog.hypernode.com/experimental-changes-redis-sessions-aws-performance/
  7. https://github.com/redis/redis/issues/10604
  8. https://usavps.com/blog/109761/
  9. https://www.geraldvillorente.com/diving-deep-redis-slowlog-vs-redis-monitor
728x90
반응형