SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Tech Planet 리뷰
Redis Session
From Line
charsyam@naver.com
시작하기 전에…
• 테크플래닛 2015에서 본 세션에 대한 리뷰입니다.
– 즉 제가 발표한 내용이 아닙니다.
• 해당 내용은 LINE 에서 발표해 주신 내용입니다.
• 강의자료는 여기서 보실 수 있습니다.
– http://readme.skplanet.com/wp-content/uploads/1-6-
%EC%84%9C%EC%9B%90%ED%95%84_LINE_LINE-Redis-
Clusters.pdf
목차
1. MaxMemory와 Dict Expand 이슈
2. CPU affinity
MaxMemory와 Dict Expand 이슈
Redis Dict 다시 살펴보기
Redis Dict – Redis 기본 자료 구조.
Redis Dict – Hash Table의 확장 #2
Redis Dict – Hash Table의 확장 #3
Redis Dict – Hash Table의 확장 #3
2배씩 늘어납니다.
zmalloc
zmalloc
• 그냥 일반적인 malloc(jemalloc, malloc, tcmalloc) 에 현재
메모리를 얼마나 할당하고 있는지 사용량만 저장함
• used_memory 변수가 증가됨.
freeMemoryIfNeeded
freeMemoryIfNeeded
• Redis 커맨드를 처리하는 processCommand 안에서
maxmemory 설정이 있으면 항상 해당 작업을 호출한다.
• used_memory + Need_memory < maxmemory 가 되도록
메모리 해제 정책에 따라서 메모리 해제를 진행함.
– 언제까지?
– 위의 공식이 성립할때까지…
다시 돌아가서…
아이템이 10억 개.
10억 * 4bytes * 2배
= 8,000,000,000
= 8G
메모리 8G가 갑자기 추가됩니다.
Maxmemory 가 12G 이고,
usedmemory 가 8G이면?
4G 정도를 free 해야한다.
시간이 얼마나 걸릴까?
실제로 저도 이런 이슈를
겪어보지는 못했습니다.
다만 원인은 이해가 갑니다.
앞의 내용 때문이죠.
해결책은?
LINE은 미리 시작 hash table 크기를
엄청 키워놓고 시작…
최상 위의 db[i].dict 을 dictExpand
를 통해서 미리 키워둔다.
CPU Affinity
NIC Interrupt CPU 와
Redis Process 가 명시적으로
할당되는 CPU를 따로 설정
High Load 상황에서 CPU Usage가
20~30% 까지도 차이가 남.
라인 규모로 Heavy 하게 쓸때
도움이 될듯.
Q & A

Mais conteúdo relacionado

Mais procurados

서버인프라 구축 입문 basis of composing server and infra
서버인프라 구축 입문 basis of composing server and infra서버인프라 구축 입문 basis of composing server and infra
서버인프라 구축 입문 basis of composing server and infra
Hwanseok Park
 
서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2
HyeonSeok Choi
 

Mais procurados (20)

Redis From 2.8 to 4.x(unstable)
Redis From 2.8 to 4.x(unstable)Redis From 2.8 to 4.x(unstable)
Redis From 2.8 to 4.x(unstable)
 
Redis From 2.8 to 4.x
Redis From 2.8 to 4.xRedis From 2.8 to 4.x
Redis From 2.8 to 4.x
 
Redis
RedisRedis
Redis
 
이것이 레디스다.
이것이 레디스다.이것이 레디스다.
이것이 레디스다.
 
[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster
 
Redis edu 1
Redis edu 1Redis edu 1
Redis edu 1
 
Redis
RedisRedis
Redis
 
Redis edu 4
Redis edu 4Redis edu 4
Redis edu 4
 
[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석
[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석
[스마트스터디]모바일 애플리케이션 서비스에서의 로그 수집과 분석
 
Node Js와 Redis를 사용한 구조화된 데이터
Node Js와 Redis를 사용한 구조화된 데이터Node Js와 Redis를 사용한 구조화된 데이터
Node Js와 Redis를 사용한 구조화된 데이터
 
서버/인프라를 지탱하는 기술
서버/인프라를 지탱하는 기술서버/인프라를 지탱하는 기술
서버/인프라를 지탱하는 기술
 
서버인프라 구축 입문 basis of composing server and infra
서버인프라 구축 입문 basis of composing server and infra서버인프라 구축 입문 basis of composing server and infra
서버인프라 구축 입문 basis of composing server and infra
 
서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2
 
분산저장시스템 개발에 대한 12가지 이야기
분산저장시스템 개발에 대한 12가지 이야기분산저장시스템 개발에 대한 12가지 이야기
분산저장시스템 개발에 대한 12가지 이야기
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
 
HTTP 완벽가이드 7장 캐시
HTTP 완벽가이드 7장 캐시HTTP 완벽가이드 7장 캐시
HTTP 완벽가이드 7장 캐시
 
[252] 증분 처리 플랫폼 cana 개발기
[252] 증분 처리 플랫폼 cana 개발기[252] 증분 처리 플랫폼 cana 개발기
[252] 증분 처리 플랫폼 cana 개발기
 
About memcached
About memcachedAbout memcached
About memcached
 
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
 
다중성 확보, 시스템 안정화
다중성 확보, 시스템 안정화다중성 확보, 시스템 안정화
다중성 확보, 시스템 안정화
 

Semelhante a Techplanetreview redis

Memcached의 확장성 개선
Memcached의 확장성 개선Memcached의 확장성 개선
Memcached의 확장성 개선
NAVER D2
 
Domain driven design ch3
Domain driven design ch3Domain driven design ch3
Domain driven design ch3
HyeonSeok Choi
 
HTML5 스펙 소개
HTML5 스펙 소개HTML5 스펙 소개
HTML5 스펙 소개
Toby Yun
 
Introduction to scalability
Introduction to scalabilityIntroduction to scalability
Introduction to scalability
polabear
 
NET 최선단 기술에 의한 고성능 웹 애플리케이션
NET 최선단 기술에 의한 고성능 웹 애플리케이션NET 최선단 기술에 의한 고성능 웹 애플리케이션
NET 최선단 기술에 의한 고성능 웹 애플리케이션
흥배 최
 

Semelhante a Techplanetreview redis (20)

서버 아키텍처 이해를 위한 프로세스와 쓰레드
서버 아키텍처 이해를 위한 프로세스와 쓰레드서버 아키텍처 이해를 위한 프로세스와 쓰레드
서버 아키텍처 이해를 위한 프로세스와 쓰레드
 
Memcached의 확장성 개선
Memcached의 확장성 개선Memcached의 확장성 개선
Memcached의 확장성 개선
 
실전 DataSnap!
실전 DataSnap!실전 DataSnap!
실전 DataSnap!
 
Web Analytics at Scale with Elasticsearch @ naver.com - Part 1
Web Analytics at Scale with Elasticsearch @ naver.com - Part 1Web Analytics at Scale with Elasticsearch @ naver.com - Part 1
Web Analytics at Scale with Elasticsearch @ naver.com - Part 1
 
Domain driven design ch3
Domain driven design ch3Domain driven design ch3
Domain driven design ch3
 
[2010 네이트 앱스토어 개발자 세미나] 앱스 제작 사례 (2) 소셜게임 서버 구성 전략
[2010 네이트 앱스토어 개발자 세미나] 앱스 제작 사례 (2) 소셜게임 서버 구성 전략[2010 네이트 앱스토어 개발자 세미나] 앱스 제작 사례 (2) 소셜게임 서버 구성 전략
[2010 네이트 앱스토어 개발자 세미나] 앱스 제작 사례 (2) 소셜게임 서버 구성 전략
 
if kakao dev 2019_Ground X_Session 04
if kakao dev 2019_Ground X_Session 04if kakao dev 2019_Ground X_Session 04
if kakao dev 2019_Ground X_Session 04
 
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
SQL-on-Hadoop with Apache Tajo,  and application case of SK TelecomSQL-on-Hadoop with Apache Tajo,  and application case of SK Telecom
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
 
요즘 웹 배포
요즘 웹 배포요즘 웹 배포
요즘 웹 배포
 
HTML5 스펙 소개
HTML5 스펙 소개HTML5 스펙 소개
HTML5 스펙 소개
 
스프링 데이터 레디스 엘라스틱 발표자료
스프링 데이터 레디스 엘라스틱 발표자료스프링 데이터 레디스 엘라스틱 발표자료
스프링 데이터 레디스 엘라스틱 발표자료
 
[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning
 
MariaDB Other Features
MariaDB Other FeaturesMariaDB Other Features
MariaDB Other Features
 
김찬웅_그룹웨어에 새 에너지를_NDC15
김찬웅_그룹웨어에 새 에너지를_NDC15김찬웅_그룹웨어에 새 에너지를_NDC15
김찬웅_그룹웨어에 새 에너지를_NDC15
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
[오픈소스컨설팅]Performance Tuning How To
[오픈소스컨설팅]Performance Tuning How To[오픈소스컨설팅]Performance Tuning How To
[오픈소스컨설팅]Performance Tuning How To
 
Introduction to scalability
Introduction to scalabilityIntroduction to scalability
Introduction to scalability
 
NET 최선단 기술에 의한 고성능 웹 애플리케이션
NET 최선단 기술에 의한 고성능 웹 애플리케이션NET 최선단 기술에 의한 고성능 웹 애플리케이션
NET 최선단 기술에 의한 고성능 웹 애플리케이션
 
메이븐 기본 이해
메이븐 기본 이해메이븐 기본 이해
메이븐 기본 이해
 
클린코드 9, 10장
클린코드 9, 10장클린코드 9, 10장
클린코드 9, 10장
 

Mais de DaeMyung Kang

Mais de DaeMyung Kang (20)

Count min sketch
Count min sketchCount min sketch
Count min sketch
 
Ansible
AnsibleAnsible
Ansible
 
Why GUID is needed
Why GUID is neededWhy GUID is needed
Why GUID is needed
 
How to use redis well
How to use redis wellHow to use redis well
How to use redis well
 
The easiest consistent hashing
The easiest consistent hashingThe easiest consistent hashing
The easiest consistent hashing
 
How to name a cache key
How to name a cache keyHow to name a cache key
How to name a cache key
 
Integration between Filebeat and logstash
Integration between Filebeat and logstash Integration between Filebeat and logstash
Integration between Filebeat and logstash
 
How to build massive service for advance
How to build massive service for advanceHow to build massive service for advance
How to build massive service for advance
 
Massive service basic
Massive service basicMassive service basic
Massive service basic
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101
 
How To Become Better Engineer
How To Become Better EngineerHow To Become Better Engineer
How To Become Better Engineer
 
Kafka timestamp offset_final
Kafka timestamp offset_finalKafka timestamp offset_final
Kafka timestamp offset_final
 
Kafka timestamp offset
Kafka timestamp offsetKafka timestamp offset
Kafka timestamp offset
 
Data pipeline and data lake
Data pipeline and data lakeData pipeline and data lake
Data pipeline and data lake
 
Redis acl
Redis aclRedis acl
Redis acl
 
Coffee store
Coffee storeCoffee store
Coffee store
 
Scalable webservice
Scalable webserviceScalable webservice
Scalable webservice
 
Number system
Number systemNumber system
Number system
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbie
 
Internet Scale Service Arichitecture
Internet Scale Service ArichitectureInternet Scale Service Arichitecture
Internet Scale Service Arichitecture
 

Techplanetreview redis