일요일, 9월 24, 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는 세상을 바로잡기 위해 깨어났습니다. 신비한 생물과 끝없는...

인기글

Java 정규표현식으로 문자, 숫자, 특수문자의 조합 패턴 체크

Java 정규표현식으로 문자, 숫자, 특수문자의 조합 패턴 체크

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...

DB접속정보 암호화 Spring 및 프로퍼티 설정

DB접속정보 암호화 Spring 및 프로퍼티 설정 Spring으 DataSource이용하다보면 DB 접속 User, password를 설정화일에 그대로 노출되는 경우가 보안에 너무 취약하게 됩니다. jasypt 을 이용하여 password부분 암호화에 대하여 설명하겠습니다. 1. 다운로드 http://www.jasypt.org/download.html에서...

Tomcat 인스턴스 여러개 실행하기

1.tomcat 7 다운로드 tomcat 7 다운로드 2.압축해제 아래의 경로에 압축해제 E:Serverapache-tomcat-7.0.63 3.tomcat 인스턴스 #1 생성 E:Serverinstanceai001에 E:Serverapache-tomcat-7.0.63아래의 conf , logs, temp, work 폴더를 복사합니다. 4.E:Serverinstanceai001bin start, stop bat생성 E:Serverinstanceai001bin 아래의 폴더에 start.bat, stop.bat 생성 start.bat...