일요일, 4월 2, 2023
Home Linux Redis 설치

Redis 설치

Redis 설치

CentOS 기준으로 작성되었습니다.

1. Redis Compile 필요 항목설치

2. 메모리 설정

Redis 구동시 TCP Backlog 경고시

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.

메모리 사용이 허용량을 넘아가게 될 경우에 대한 처리

3.TCP Backlog

Redis 구동시 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.

somaxconn은 ‘Socket Max Connection’의 약어로 최대 연결 개수를 뜻합니다. 리눅스의 경우 메모리가 128MB 보다 작을 경우 128이 기본이고, 클 경우 1024가 기본입니다.
동시에 너무 많은 요청이 올 경우, 예를 들어, somaxconn 값이 128일 경우 그 이상 요청이 오는 것에 대해서는 연결을 거부하게 됩니다.

4. THP

Redis 구동시 TCP Backlog 경고시

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.

Transparent Hug Pages (THP)는 대량의 메모리를 관리하기 위한 한 방법으로, 페이지 크기를 확대(2MB or 1GB)하여 사용하는 방법입니다. THP는 성능 개선을 목적으로하며,
대부분의 시스템 설정의 성능을 향상시키지만 DB와 같은 특정 상황에 대해서는 오히려 성능이 악화될 수 있습니다.

Redis는 실행 시 THP가 enabled 되어 있는 경우 경고 메시지를 출력하며, 해당 기능을 끄도록 제안하고 있습니다.
참조 : http://allthatlinux.com/dokuwiki/doku.php?id=thp_transparent_huge_pages_%EA%B8%B0%EB%8A%A5%EA%B3%BC_%EC%84%A4%EC%A0%95_%EB%B0%A9%EB%B2%95

  • Transparent Hug Pages 확인

해당 기능은 아래와 같은 명령을 수행하는 것으로 끌 수 있습니다.

시작시 마다 해당 명령이 수행되도록 하기 위해 /etc/rc.local 파일에 명령을 추가

5. redis 설치

  • ./install_server.sh

6.redis process 확인

7.redis log 확인

8.redis cli을 이용한 set, get 확인

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Time limit is exhausted. Please reload the CAPTCHA.

최신글

에픽게임즈 – Dandara: Trials of Fear Edition

억압받으며 종말의 위기에 처한 기이한 세계에서 Dandara는 세상을 바로잡기 위해 깨어났습니다. 신비한 생물과 끝없는...

인기글

Mac Address로 IP확인하기

Mac Address로 IP확인하기 도스창에서 arp -a 입력하시면 맥어드레스와 IP정보 조회가 가능합니다.

ubuntu SNMP 설치 및 설정

ubuntu SNMP 설치 및 설정 1.apt-get snmpd snmp rrdtool 2.snmpd.conf 백업 3.iostat-persist.pl 다운로드 4.snmpd.conf생성 5./etc/default/snmpd 수정 6.service snmpd restart 7.snmpwalk (snmp확인)

Asrock Rack X470D4U Ryzen VMWare ESXi 적용 리뷰

Asrock Rack X470D4U Ryzen VMWare ESXi 적용 리뷰 #1 제품 선택 배경  Ryzen ESXi 서버를 사용하는 목적은 가상시스템(윈도우10)에 GPU(GTX1060), USB PCI Expansion Card를 패스스루하여 거실의 LG Smart TV...

[이클립스] console 출력 제한 해제

이클립스 console 출력 제한 해제 1.limit console output 체크를 해제하시면됩니다.