본문 바로가기

리눅스

레디스 설치 후 경고 메시지 처리

반응형

레디스 설치 후 경고 메시지 처리(redis warning)

redis 로그

$ tail -f /var/log/redis/redis.log
...
30912:M 06 Aug 2021 11:33:33.677 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
30912:M 06 Aug 2021 11:33:33.677 # Server initialized
30912:M 06 Aug 2021 11:33:33.677 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

TCP backlog 경고

경고 메시지

WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

현재 설정 값 확인

sysctl -a | grep net.core.somaxconn
net.core.somaxconn = 128

설정 값 변경

sudo sysctl -w net.core.somaxconn=1024

영구적으로 적용

echo "net.core.somaxconn = 1024" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

현재 설정 값 확인

$ sysctl -a | grep net.core.somaxconn
net.core.somaxconn = 1024
728x90

overcommit_memory 경고

경고 메시지

WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

현재 설정 값 확인

sysctl -a | grep vm.overcommit_memory
vm.overcommit_memory = 0

설정 값 변경

sudo sysctl -w vm.overcommit_memory=1

영구적으로 적용

echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

현재 설정 값 확인

$ sysctl -a | grep vm.overcommit_memory
vm.overcommit_memory = 1

Transparent Huge Pages (THP) 경고

경고 메시지

WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. 
This will create latency and memory usage issues with Redis. 
To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

현재 설정 값 확인

cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never
cat /sys/kernel/mm/transparent_hugepage/defrag

설정 값 변경

echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag

영구적으로 적용

echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" | sudo tee -a /etc/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" | sudo tee -a /etc/rc.local
sudo chmod +x /etc/rc.local

현재 설정 값 확인

$ cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
cat /sys/kernel/mm/transparent_hugepage/defrag

 

참고URL

- https://www.kernel.org/doc/Documentation/vm/overcommit-accounting

- https://access.redhat.com/site/documentation/ko-KR/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/s-memory-transhuge.html

 

728x90
반응형