Soumettre la recherche
Mettre en ligne
Count min sketch
•
Télécharger en tant que PPTX, PDF
•
2 j'aime
•
2,140 vues
DaeMyung Kang
Suivre
count min sketch
Lire moins
Lire la suite
Technologie
Signaler
Partager
Signaler
Partager
1 sur 26
Télécharger maintenant
Recommandé
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
Ji-Woong Choi
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Henning Jacobs
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
Massive service basic
Massive service basic
DaeMyung Kang
Introduction to Redis
Introduction to Redis
Arnab Mitra
Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용
흥배 최
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기
Brian Hong
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
OSSCube
Recommandé
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
Ji-Woong Choi
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Henning Jacobs
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
Massive service basic
Massive service basic
DaeMyung Kang
Introduction to Redis
Introduction to Redis
Arnab Mitra
Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용
흥배 최
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기
Brian Hong
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
OSSCube
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Amazon Web Services
How to build massive service for advance
How to build massive service for advance
DaeMyung Kang
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
Heungsub Lee
In-memory OLTP storage with persistence and transaction support
In-memory OLTP storage with persistence and transaction support
Alexander Korotkov
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
Azul Systems Inc.
How to Design Indexes, Really
How to Design Indexes, Really
Karwin Software Solutions LLC
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
confluent
MongoDB at Baidu
MongoDB at Baidu
Mat Keep
Deep Dive into Apache Kafka
Deep Dive into Apache Kafka
confluent
Introduction to Apache Storm
Introduction to Apache Storm
Tiziano De Matteis
Multiplayer Game Sync Techniques through CAP theorem
Multiplayer Game Sync Techniques through CAP theorem
Seungmo Koo
The PostgreSQL Query Planner
The PostgreSQL Query Planner
Command Prompt., Inc
How is Kafka so Fast?
How is Kafka so Fast?
Ricardo Paiva
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
Brian Hong
webservice scaling for newbie
webservice scaling for newbie
DaeMyung Kang
Caching solutions with Redis
Caching solutions with Redis
George Platon
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
강 민우
MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術
yoku0825
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
InfraEngineer
Redis
Redis
DaeMyung Kang
Ansible
Ansible
DaeMyung Kang
Contenu connexe
Tendances
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Amazon Web Services
How to build massive service for advance
How to build massive service for advance
DaeMyung Kang
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
Heungsub Lee
In-memory OLTP storage with persistence and transaction support
In-memory OLTP storage with persistence and transaction support
Alexander Korotkov
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
Azul Systems Inc.
How to Design Indexes, Really
How to Design Indexes, Really
Karwin Software Solutions LLC
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
confluent
MongoDB at Baidu
MongoDB at Baidu
Mat Keep
Deep Dive into Apache Kafka
Deep Dive into Apache Kafka
confluent
Introduction to Apache Storm
Introduction to Apache Storm
Tiziano De Matteis
Multiplayer Game Sync Techniques through CAP theorem
Multiplayer Game Sync Techniques through CAP theorem
Seungmo Koo
The PostgreSQL Query Planner
The PostgreSQL Query Planner
Command Prompt., Inc
How is Kafka so Fast?
How is Kafka so Fast?
Ricardo Paiva
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
Brian Hong
webservice scaling for newbie
webservice scaling for newbie
DaeMyung Kang
Caching solutions with Redis
Caching solutions with Redis
George Platon
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
강 민우
MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術
yoku0825
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
InfraEngineer
Tendances
(20)
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
Deep Dive on Amazon EBS Elastic Volumes - March 2017 AWS Online Tech Talks
How to build massive service for advance
How to build massive service for advance
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
In-memory OLTP storage with persistence and transaction support
In-memory OLTP storage with persistence and transaction support
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How to Design Indexes, Really
How to Design Indexes, Really
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
MongoDB at Baidu
MongoDB at Baidu
Deep Dive into Apache Kafka
Deep Dive into Apache Kafka
Introduction to Apache Storm
Introduction to Apache Storm
Multiplayer Game Sync Techniques through CAP theorem
Multiplayer Game Sync Techniques through CAP theorem
The PostgreSQL Query Planner
The PostgreSQL Query Planner
How is Kafka so Fast?
How is Kafka so Fast?
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
webservice scaling for newbie
webservice scaling for newbie
Caching solutions with Redis
Caching solutions with Redis
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
[IGC 2017] 펄어비스 민경인 - Mmorpg를 위한 voxel 기반 네비게이션 라이브러리 개발기
MySQLを割と一人で300台管理する技術
MySQLを割と一人で300台管理する技術
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
Plus de DaeMyung Kang
Redis
Redis
DaeMyung Kang
Ansible
Ansible
DaeMyung Kang
Why GUID is needed
Why GUID is needed
DaeMyung Kang
How to use redis well
How to use redis well
DaeMyung Kang
The easiest consistent hashing
The easiest consistent hashing
DaeMyung Kang
How to name a cache key
How to name a cache key
DaeMyung Kang
Integration between Filebeat and logstash
Integration between Filebeat and logstash
DaeMyung Kang
Data Engineering 101
Data Engineering 101
DaeMyung Kang
How To Become Better Engineer
How To Become Better Engineer
DaeMyung Kang
Kafka timestamp offset_final
Kafka timestamp offset_final
DaeMyung Kang
Kafka timestamp offset
Kafka timestamp offset
DaeMyung Kang
Data pipeline and data lake
Data pipeline and data lake
DaeMyung Kang
Redis acl
Redis acl
DaeMyung Kang
Coffee store
Coffee store
DaeMyung Kang
Scalable webservice
Scalable webservice
DaeMyung Kang
Number system
Number system
DaeMyung Kang
Internet Scale Service Arichitecture
Internet Scale Service Arichitecture
DaeMyung Kang
Bloomfilter
Bloomfilter
DaeMyung Kang
Redis From 2.8 to 4.x(unstable)
Redis From 2.8 to 4.x(unstable)
DaeMyung Kang
Redis From 2.8 to 4.x
Redis From 2.8 to 4.x
DaeMyung Kang
Plus de DaeMyung Kang
(20)
Redis
Redis
Ansible
Ansible
Why GUID is needed
Why GUID is needed
How to use redis well
How to use redis well
The easiest consistent hashing
The easiest consistent hashing
How to name a cache key
How to name a cache key
Integration between Filebeat and logstash
Integration between Filebeat and logstash
Data Engineering 101
Data Engineering 101
How To Become Better Engineer
How To Become Better Engineer
Kafka timestamp offset_final
Kafka timestamp offset_final
Kafka timestamp offset
Kafka timestamp offset
Data pipeline and data lake
Data pipeline and data lake
Redis acl
Redis acl
Coffee store
Coffee store
Scalable webservice
Scalable webservice
Number system
Number system
Internet Scale Service Arichitecture
Internet Scale Service Arichitecture
Bloomfilter
Bloomfilter
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.x
Count min sketch
1.
Count Min Sketch 대충
이해하기 charsyam@naver.com
2.
Count 를 위한
확률적 자료구조
3.
IP가 100만개 정도
되는데 Count를 해야 한다면?
4.
IP 개수에 따른
메모리 할당 양 개수 메모리(Redis 에서 계산) 10000 1.64MB 100000 8.69MB 1000000 77.49MB 2000000 123.64MB IP 개수가 늘어날 수록 메모리 사용량도 늘어난다.
5.
IP는 특정 IP
들이 많을까? 다들 동일한 횟수로 접근할까?
6.
TOP(K)의 Count가 정확해야할
때 Count Min Sketch가 유리
7.
근사한 Count 값을
구하는 것이 목적 계산 시간과 메모리를 적게 사용한다.
8.
필요한 값 d =
몇 개의 hash 함수를 쓸 것인가? w = 메모리 공간을 얼마나 쓸 것인가?
9.
Count Min Sketch 0
1 2 3 4 5 Hash 1 0 0 0 0 0 0 Hash 2 0 0 0 0 0 0 Hash 3 0 0 0 0 0 0 Hash 4 0 0 0 0 0 0 w : 사용하고자 하는 메모리 공간 d 할당되는 메모리는 w * d * 변수크기 만큼 사용된다.
10.
Hash 는 어떤
hash라도 가능 Hash % w 값으로 나오는 값을 사용
11.
Example 1.1.1.1 2.2.2.2 3.3.3.3
4.4.4.4 5.5.5.5 6.6.6.6 Hash 1 1 2 1 3 5 4 Hash 2 5 4 3 5 1 3 Hash 3 2 4 5 1 0 2 Hash 4 1 2 2 3 0 4 다음과 같은 해시결과가 나온다고 하자.
12.
Example 그리고 다음과 같은
데이터셋이 있다고 가정한다. 1.1.1.1 2.2.2.2 1.1.1.1 3.3.3.3 1.1.1.1
13.
Example : 1.1.1.1 0
1 2 3 4 5 Hash 1 0 1 0 0 0 0 Hash 2 0 0 0 0 0 1 Hash 3 0 0 1 0 0 0 Hash 4 0 1 0 0 0 0 Hash1(1.1.1.1) = 1 Hash2(1.1.1.1) = 5 Hash3(1.1.1.1) = 2 Hash4(1.1.1.1) = 1 나온 해시 값의 자리를 1 증가시킨다.
14.
Example : 2.2.2.2 0
1 2 3 4 5 Hash 1 0 1 1 0 0 0 Hash 2 0 0 0 0 1 1 Hash 3 0 0 1 0 1 0 Hash 4 0 1 1 0 0 0 Hash1(2.2.2.2) = 2 Hash2(2.2.2.2) = 4 Hash3(2.2.2.2) = 4 Hash4(2.2.2.2) = 2 나온 해시 값의 자리를 1 증가시킨다.
15.
Example : 1.1.1.1 0
1 2 3 4 5 Hash 1 0 2 1 0 0 0 Hash 2 0 0 0 0 1 2 Hash 3 0 0 2 0 1 0 Hash 4 0 2 1 0 0 0 Hash1(1.1.1.1) = 1 Hash2(1.1.1.1) = 5 Hash3(1.1.1.1) = 2 Hash4(1.1.1.1) = 1 나온 해시 값의 자리를 1 증가시킨다.
16.
Example : 3.3.3.3 0
1 2 3 4 5 Hash 1 0 3 1 0 0 0 Hash 2 0 0 0 1 1 2 Hash 3 0 0 2 0 1 1 Hash 4 0 2 2 0 0 0 Hash1(3.3.3.3) = 1 Hash2(3.3.3.3) = 3 Hash3(3.3.3.3) = 5 Hash4(3.3.3.3) = 2 나온 해시 값의 자리를 1 증가시킨다.
17.
Example : 1.1.1.1 0
1 2 3 4 5 Hash 1 0 4 1 0 0 0 Hash 2 0 0 0 1 1 3 Hash 3 0 0 3 0 1 1 Hash 4 0 3 2 0 0 0 Hash1(1.1.1.1) = 1 Hash2(1.1.1.1) = 5 Hash3(1.1.1.1) = 2 Hash4(1.1.1.1) = 1 나온 해시 값의 자리를 1 증가시킨다.
18.
이제 1.1.1.1 의
개수를 세어보자 0 1 2 3 4 5 Hash 1 0 4 1 0 0 0 Hash 2 0 0 0 1 1 3 Hash 3 0 0 3 0 1 1 Hash 4 0 3 2 0 0 0 Hash1(1.1.1.1) = 1 Hash2(1.1.1.1) = 5 Hash3(1.1.1.1) = 2 Hash4(1.1.1.1) = 1 각 자리의 값 (hash1, 1) = 4, (hash2, 5) = 3, (hash3, 2) = 3, (hash4, 1) = 3 즉 4, 3, 3, 3 중에서 가장 작은 MIN 값은 3 이므로 1.1.1.1의 개수는 3이 된다.
19.
이제 3.3.3.3 의
개수를 세어보자 0 1 2 3 4 5 Hash 1 0 4 1 0 0 0 Hash 2 0 0 0 1 1 3 Hash 3 0 0 3 0 1 1 Hash 4 0 3 2 0 0 0 Hash1(3.3.3.3) = 1 Hash2(3.3.3.3) = 3 Hash3(3.3.3.3) = 5 Hash4(3.3.3.3) = 2 각 자리의 값 (hash1, 1) = 4, (hash2, 3) = 1, (hash3, 5) = 1, (hash4, 2) = 2 즉 4, 1, 1, 2 중에서 가장 작은 MIN 값은 1 이므로 3.3.3.3의 개수는 1이 된다.
20.
W가 10000이고 d
가 4라면 4 * 10000 * 4 해서 160kb 정도만 메모리를 사용 160kb 와 77.49MB 중에 큰 것은?
21.
Count Min Sketch
는 해시의 충돌을 감안하고 고정된 크기에서 특정 값의 개수를 근사치로 구하는 방법
22.
Count Min Sketch 실제
값 <= 근사치 값 이 성립한다. (해시 충돌이 일어나면 다른 것의 값이 더해질 수 있으므로)
23.
w와 d를 늘리면
좀 더 충돌이 줄어드므로 에러 값이 줄어든다.
24.
근사값이지만, 운이 나쁘면
튀는 값이 위의 원리로 나올 수도 있다.
25.
여러 해시값 들
중에 가장 적은 값을 가지 고 있는 해시의 값이 자신의 근사값이 됨.
26.
감사합니다.
Télécharger maintenant