SlideShare a Scribd company logo
1 of 69
Download to read offline
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Amazon OpenSearch Service Deep Dive
내부구조, 성능최적화 그리고 스케일링
김성일
Sr Analytics Specialist Solutions Architect
AWS
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Agenda
2
• Amazon OpenSearch Service
• Document, Index, Shard
• Index 디자인
• 적합한 Domain 구성 예측
• API 요청 핸들링
• 검색성능 최적화
• 인덱싱 최적화
• 기타 유용한 팁
• 스케일링
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Amazon OpenSearch Service
3
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates. 4
Amazon OpenSearch Service
• 대화형 로그 분석
• 실시간 애플리케이션 모니터링
• 웹사이트 검색
• 최신 버전의 OpenSearch와 19가지 버전의 Elasticsearch(1.5 ~ 7.10 버전)에 대한 지원
• OpenSearch Dashboards 및 Kibana 기반 시각화 기능(1.5 ~ 7.10 버전)을 제공합니다.
• 오픈소스
• Elasticsearch에서 파생된 분산 검색, 분석 제품군
https://opensearch.org/
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Document, Index, Shard
5
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Field
Document
{
"name": "John Smith",
"age": 42,
"confirmed": true,
"join_date": "2014-06-01",
"home": { "lat": 51.5, "lon": 0.1 },
"accounts": [
{ "type": "facebook", "id": "johnsmith" },
{ "type": "twitter", "id": "johnsmith" }
]
}
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index
=
Index
document
ID ID ID ID ID
ID ID ID ID ID
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
OpenSearch 구조
Index
Shard Shard Shard
Lucene
Index
Lucene
Index
Lucene
Index
Segment Segment Segment Segment Segment Segment
Document
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Shard - 배포
1
2 3
Primary Shard
여러 document가 들어있음 데이터 노드
Index
Shard Shard Shard
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Shard - 배포
1
2 3
Primary Shard
데이터 노드
Replica Shard
3
2
1
3
1
2
Replica Shard
PUT more-movies
{
“settings” : {
“Index” : {
“number_of_shards” : 3,
"number_of_replicas" : 2
}
}
}
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Shard - 고려사항
Shard를 고르게 배포하려면 Shard 수를 데이터 노드(또는 AZ)의 배수로 구성하면 좋습니다.
1 2 3 1 2
vs
number_of_shards : 3 number_of_shards : 2
가용성을 높이려면 AZ의 배수를 고려해서 Replica 수를 구성하면 좋습니다.
Availability
Zone
1
Availability
Zone
1
Availability
Zone
1
number_of_replicas : 2
vs
Availability
Zone
1
Availability
Zone
1
Availability
Zone
number_of_replicas : 1
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Index 디자인
12
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index - 패턴
Long-Term Retention Index
• 같은 Index에 소스 데이터를 저장
• 문서의 업데이트하거나 삭제가
필요한 경우가 많음
• movies
• website-contents
• Internal-docs
Rolling Index
• 인덱싱 기간 또는 보존 기간이 있고
계속적으로 흘러 들어오는 경우
• 오래된 Index는 보유 기간에 따라
Warm/Cold 계층으로
마이그레이션하거나 삭제 가능
• search-logs-2022
• iot-sensor-logs-2022-07
• weblogs-2022-07-30
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index - 사이즈 관리
사이즈 기반 로테이션
• 크기 추정 불가
• 삭제 요구사항 없음
• 동일한 Shard 크기 유지
• index-A-000000
• Index-A-000001
기간(시계열) 기반 로테이션
• 크기 추정 가능
• 삭제 요구사항 있음
• 기간 기준 검색 요구사항 있음
• index-A-2022-09-01
• Index-A-2022-09-02
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index – 로테이션 빈도에 따른 주의사항
매일마다 일정한 데이터 흐름 속도(양)으로 들어오더라도, 빈도에 따라 Shard 구성이 달라짐
만약, 일일 데이터 양이 30GB이고, Shard 사이즈를 50GB라 가정하면,
Daily rotate
• Primary Shard 수: 30GB* 1.1/50GB = 0.66 -> 1 Shard
Weekly rotate
• Primary Shard 수: 30GB* 1.1* 7일/50GB = 4.62 -> 5개 Shard
Monthly rotate
• Primary Shard 수: 30GB* 1.1 * 31일/50GB = 20.46 -> 21개 Shard
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
적합한 Domain 구성 예측
16
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Amazon OpenSearch Service Architecture
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Domain 구성 예측
스토리지 크기
Index 디자인/전략에 기반한 Shard 수
Shard와 스토리지에 기반한 vCPU/Memory
vCPU/Memory에 기반한 Data nodes (instanace type)
Data nodes에 기반한 Master nodes (instanace type)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Domain 구성 예측
스토리지 크기
Index 디자인/전략에 기반한 Shard 수
Shard와 스토리지에 기반한 vCPU/Memory
vCPU/Memory에 기반한 Data nodes (instanace type)
Data nodes에 기반한 Master nodes (instanace type)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Storage - Tiers
Data
Volume
Hot
Instance
+
Cache
Volume
Instance
+
S3 Bucket
+
S3 Bucket
UltraWarm Cold Storage
Cost: high
Low latency
Cost: low
Latency: high
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
UltraWarm 노드 Amazon Elasticsearch Service domain
Dashboard
Application Load
Balancer
Queries
Active
Master
Node
Backup
Master
Node
Backup
Master
Node
Hot Data
Node
Hot Data
Node
Hot Data
Node
Hot Data
Node
UltraWarm
Node
UltraWarm
Node
UltraWarm
Node
Amazon S3
POST _ultrawarm/migration/my-Index/_warm
POST _ultrawarm/migration/my-Index/_hot
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Cold Storage
• UltraWarm에서 액세스할 수 있는 Index 저장 영역
• 콜드 스토리지의 Index는 검색이 불가능
• 오랜 기간 동안 저렴하게 Index를 저장할 수 있음
• UltraWarm 노드에서 떼어내서 도메인의 스토리지 크기 제한에 관계없이 사용
• Index는 언제든지 UltraWarm 노드에 연결할 수 있음
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Storage 크기 예측
Data Volume
Hot
Instance
+
Cache Volume
Instance
+
Bucket
+
Bucket
UltraWarm Cold Storage
Source data size
x (1+ Overhead)
x (1+ Replicas)
÷ (1- OS 예약공간%)
÷ (1- Amazon
OpenSearch
Service
Overhead%)
Source data size
x (1+ Overhead)
× (1 + 0)
Source data size
x (1+ Overhead)
× (1 + 0)
OS 예약공간
• 노드 별 Storage 용량의 5% 확보
Amazon OpenSearch Service Overhead
• 노드 별 Storage 용량의 20% 확보 (최대 20GB)
• 500GB/3개 노드: MIN(20GB, 500GB x 0.2) x 3 = 60GB
• 50GB/30개 노드: MIN(20GB, 50GB x 0.2) x 30 = 300GB
0.1
2
0.05
0.2
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index overhead
일반적으로 오버헤드는 10% 정도
_cat/indices API
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Domain 구성 예측
스토리지 크기
Index 디자인/전략에 기반한 Shard 수
Shard와 스토리지에 기반한 vCPU/Memory
vCPU/Memory에 기반한 Data nodes (instanace type)
Data nodes에 기반한 Master nodes (instanace type)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Shard - 개수와 사이즈
Magic number?
• 작은 Shard가 너무 많으면 검색 성능 저하, 높은 Heap 사용률 등의 문제가 발생합니다.
• Shard 사이즈가 너무 커도 검색 성능이 저하됩니다.
• Long-Term Retention Index : 10GB - 30GB
• Rolling Index : 10GB - 50GB
• Index 생성 후에는 Shard 수를 수정할 수 없습니다.
• Long-Term Retention Index : 향후 데이터 증가 고려 필요
• Rolling Index : 향후 데이터 증가 고려 불필요
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Shard - 예측
Primary Shard의 수
= (source data + room for growth) x (1 + Indexing overhead) / size per Shard
<참고>
• 노드/AZ 수의 균형을 맞추면서 최종 Shard 수를 조정하는 것이 좋습니다.
• Primary Shard의 개수가 7과 같이 2나 3으로 나누어지지 않는 경우
• 배포할 가용 영역의 수에 맞춰서
• 8 (2AZ의 배수) 또는 9 (3AZ의 배수) 로 고르게 분산 시키는 것이 좋습니다.
PUT more-movies
{
“settings” : {
“Index” : {
“number_of_shards” : 3,
"number_of_replicas" : 2
}
}
}
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Shard - Primary Shard 수 계산
가정
• 매일마다 200 GB 씩 들어오는 로그성 데이터
• 각 Shard 크기는 30 GB 로 하려고 함
• 롤링 빈도
• 50GB를 초과하므로 매일마다 롤링
• 3 AZ에 3개의 데이터 노드가 분산되어 배포
계산 결과
• Primary Shard의 수: (200 GB + 0) x (1 + 0.1) / 30 GB x 1 day = 7
• 7 -> 6 (또는 9)
• Replica Shards
• 6 x 2 = 12 Shards per day (또는 9 x 2 = 18 Shards per day)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Domain 구성 예측
스토리지 크기
Index 디자인/전략에 기반한 Shard 수
Shard와 스토리지에 기반한 vCPU/Memory
vCPU/Memory에 기반한 Data nodes (instanace type)
Data nodes에 기반한 Master nodes (instanace type)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
vCPU 예측
• 일반적인 워크로드
• 클러스터에 할당할 vCPU 수는 Active Shard 수를 기반으로 합니다.
• 1.5 vCPU per Active Shard 할당
• 고부하 워크로드 (빈도가 높은 인덱싱 및 검색이 있는 데이터 분석 환경)
• 2 vCPU per 스토리지 100GB 할당
• 이 경우 Shard 크기는 50GB에 가까워야 합니다.
<참고> Active Shard?
• 인덱싱 요청과 빈번한 검색 요청을 처리하는 Shard
• 인덱싱 요청 : 직접 인덱싱하는데 사용하는 Primary Shard + Replica Shard 수
• 검색 요청 : Primary Shard 수만 포함
• 실제 필요한 vCPU는 쿼리 병렬도(QPS = Queries Per Second)에도 영향을 받음
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Memory 예측
일반적인 워크로드
• (Heap 영역에) 1GB per 20개 Shard.
고부하 워크로드 (빈도가 높은 인덱싱 및 검색이 있는 데이터 분석 환경)
• (Heap 영역에) 8GB per 스토리지 100GB
• 이 경우 Shard 크기는 50GB에 가까워야 합니다.
<참고>
• 노드에 실제 부여하는 메모리 : 필요한 Heap size * 2
• Amazon OpenSearch Service는 노드에 할당된 메모리의 절반을 Heap 영역으로 할당합니다.
• 기본 Heap size 제한은 32GB입니다.
• Amazon OpenSearch Service는 Heap size를 최대 128GB까지 늘릴 수 있는 Auto-Tune을 제공하지만
사용자가 제어할 수는 없습니다.
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Domain 구성 예측
스토리지 크기
Index 디자인/전략에 기반한 Shard 수
Shard와 스토리지에 기반한 vCPU/Memory
vCPU/Memory에 기반한 Data nodes (instanace type)
Data nodes에 기반한 Master nodes (instanace type)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Hot node 인스턴스 타입 선택
Generic
1:4 vCPU:memory
vCPU: 2 – 48
Memory: 8 – 192 GB
Disk: 10GB – 9TB
Networking: up to 20 Gbps
R6gd
Compute-optimized
1:2 vCPU:memory
vCPU: 2 - 48
Memory: 4 – 96 GB
Disk: 10 GB - 4.5 TB
Networking: up to 20 Gbps
Memory optimization
1:8 vCPU:memory
vCPU: 2 – 48
Memory: 16 – 384 GB
Disk: 10 GB – 12 TB
Networking: up to 20 Gbps
Memory optimization
1:8 vCPU:memory
vCPU: 2 – 64
Memory: 16 – 512 GB
Disk: 118 – 3800 GB
Networking: up to 25 Gbps
I/O optimization
vCPU: 2 – 64
Memory: 15.25 – 488 GB
Disk: 475 – 15200 GB
Networking: up to 25 Gbps
https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html
SSD-Backed EBS(gp3, gp2, io1) NVMe SSD
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Hot node 스토리지 선택
General Purpose
SSD
gp2 / gp3(recommended)
Provisioned IOPS
SSD
io1
Previous Generation
HDD
(not recommended)
magnetic
NVMe SSD
Instance store
EBS Instance Store
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
UltraWarm node 선택
-
Can
manage
up
to
20
TB
of
data
per
node
-
16
vCPU,
122
GiB
memory,
3.8
TiB
local
storage
-
Use
1,000
shards
per
node
as
a
guide
• 노드당 1.5 TB 까지 관리 가능
• 2 vCPU, 16 GB memory,
475 GB local storage
• 노드당 약 400 개 shard 가능
ultrawarm1.large.search
ultrawarm1.medium.search
• 노드당 20 TB 까지 관리 가능
• 16 vCPU, 122 GB memory,
3.8 TB local storage
• 노드당 약 1000 개 shard 가능
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Domain 구성 예측
스토리지 크기
Index 디자인/전략에 기반한 Shard 수
Shard와 스토리지에 기반한 vCPU/Memory
vCPU/Memory에 기반한 Data nodes (instanace type)
Data nodes에 기반한 Master nodes (instanace type)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Master node 선택
Instance Count Recommended minimum instance type
1 – 10 m5.large.search or m6g.large.search
10 – 30 c5.xlarge.search or c6g.xlarge.search
30 – 75 c5.2xlarge.search or c6g.2xlarge.search
75 - 200 r5.4xlarge.search or r6g.4xlarge.search
<참고>
• T2 인스턴스 유형 및 t3.small.search는 프로덕션 환경에서 권장되지 않습니다.
• 소모되는 리소스도 Index와 Shard의 수에 따라 달라지므로 CloudWatch 메트릭에서 실제 부하 상황을 확인하고
필요에 따라 도메인 크기를 확장합니다.
• 마스터 노드의 관리 작업은 분산되지 않으므로, "스케일 아웃"이 작동하지 않습니다.
• 다만, 가용성을 위해 3노드 구성을 권장합니다.
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Master node
Master
Eligible
Node-1
Master
Eligible
Node-2
Master
Eligible
Node-3
Master
Node
Master
Eligible
Node-2
Master
Eligible
Node-3
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Master node
Master
Node
Master
Eligible
Node-2
Master
Eligible
Node-3
Master
Eligible
Node-1
Master
Node
Master
Eligible
Node-3
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
API 요청 핸들링
40
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
API 요청 핸들링
Request Thread
Thread
Thread
Thread
Queue Thread Pool
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
API 요청 핸들링
Queue
Request
Thread Pool
Thread
Thread
Thread
Thread
Request
Request
Request
Request
Request
429(Too Many Requests)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Queue, Thread Pool, vCPU 상관관계
Queue와 Thread Pool은 각 API 유형에 개별적으로 할당
• Write (for Index, update, delete, bulk)
- Queue size: 10000 (Elasticsearch 7.8 or later. Previous size is 200)
- Thread pool size: The number of vCPUs
• Search (for count, search, suggest)
- Queue size: 1000
- Thread pool size: int ((the number of vCPUs x 3) / 2) +1
Thread Pool size는 노드에 할당된 vCPU에 따라 다릅니다.
• (vCPU를 추가하기 위해) 인스턴스 유형을 변경하면 API 동시성이 증가합니다.
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
검색성능 최적화
44
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
File system cache에 메모리 할당 늘리기
File System Cache
(Page Cache)
JVM Heap
(50% memory < 32 GB)
Indexing Buffer
(10% heap)
Shard Request Cache
(1% heap)
Node Query Cache
(10% heap)
Field Data Cache
(unbounded)
Disk
Segment
Segment
Segment
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Node Query Cache 활용
GET logs/_search
{
"query": {
"bool": {
"must": [
(…)
],
"filter": [
{
"range": {
"timestamp": {
"gte": "now-1d/m",
"lte": "now/m"
}
}
(…)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
필요한 경우 인스턴스 스토어 사용
Physical host
• 많은 양의 데이터를 검색하거나 집계할 때 높은 I/O 성능이 필요
• 인스턴스 스토어는 EBS보다 지연시간이 낮습니다.
• 높은 I/O 성능이 필요한 경우, 인스턴스 스토어가 있는 인스턴스 유형 사용
• EC2 공식 문서에서 각 인스턴스 유형에 대한 인스턴스 스토어의 성능을 확인
• 충분한 I/O 성능을 제공하는 적절한 인스턴스 유형을 선택
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
복잡한 Document 구조 피하기
• 중첩 필드 유형은 가능한 한 사용하지 마십시오
• 일반 필드 유형보다 검색 요청을 처리하는 데 몇 배 더 오래 걸릴 수 있습니다.
• 중첩 유형 아래에 여러 필드가 있고 해당 필드의 조합으로 검색해야 하는 경우
• copy_to를 사용하여 여러 필드를 결합하고 단일 필드로 복사합니다.
• 조인 필드 유형으로 부모-자식 관계를 최대한 사용하지 마십시오
• 일반 필드 유형보다 검색 요청을 처리하는 데 수백 배 더 오래 걸릴 수 있습니다.
• 1:N 부모-자식 관계 외에는 사용하지 않는 것을 권장합니다.
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
검색할 필드 수 줄이기
PUT users
{
"mappings": {
"properties": {
"full_name": {
"type": "text"
},
"first_name": {
"type": "keyword",
"copy_to": "full_name"
},
"last_name": {
"type": "keyword",
"copy_to": "full_name"
(…)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Term을 이용해서 범위 만들기
PUT index/_doc/1
{
"item": ”banana",
"price_krw": 4980
}
GET index/_search
{
"aggs": {
"price_ranges": {
"range": {
"field": "price_krw",
"ranges": [
{ "to": 10 },
{ "from": 10, "to": 100 },
{ "from": 100, "to": 1000 },
{ "from": 1000, "to": 5000 },
{ "from": 5000, "to": 10000 },
{ "from": 10000 }
]
(…)
GET index/_search
{
"aggs": {
"price_ranges": {
"terms": {
"field": "price_krw_range"
}
(…)
fast
slow
PUT index/_doc/1
{
"item": ”banana",
"price_krw": 4980,
"price_krw_range": "1000-5000"
}
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
목적에 따라 수치 데이터의 종류 선택
PUT index
{
"mappings": {
"properties": {
"product_id": {
"type": "keyword",
"fields": {
"numeric": {
"type": "integer"
}
}
}
}
}
}
(…)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
가능한 Script 피하기
Shard
Primary
Shard
Replica
node.master:false
node.data:true
node.ingest:true
Data node
Pipeline
Transformation and Transfer
Kinesis
Data Firehose
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index sorting
GET scores/_doc/_search
{
"track_total_hits": false,
"size": 3,
"sort": [
{ "Score": "desc" }
]
}
“Name”: “Player000001”, “Score”:10
“Name”: “Player000002”, “Score”:200
“Name”: “Player000003”, “Score”:50
“Name”: “Player9999999”, “Score”:300
“Name”: “Player9999999”, “Score”:300
“Name”: “Player000002”, “Score”:200
“Name”: “Player000003”, “Score”:50
“Name”: “Player000001”, “Score”:10
・・・
・・・
Skipping
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
큰 결과 값에는 페이징과 비동기 검색 활용
• OpenSearch는 단일 검색 요청에서 반환되는 문서 수에 제한이 있습니다.
• 기본 limit : 10,000개 문서
• index.max_result_window 업데이트
• 큰 Heap 메모리가 필요하고 vCPU 사용률 증가
• search_after, size & from과 함께 페이징을 사용하여
• API 실행당 검색되는 문서 수를 줄이기
• 비동기 검색 사용 고려
• 배치 프로세싱과 같이 오랫동안 실행되는 쿼리
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Index 롤업
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
인덱싱 최적화
56
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
_bulk API
POST _bulk
{ "index" : { "_index" : "more-movies", "_id" : "1" } }
{ "title" : "Back to the Future" }
{ "delete" : { "_index" : "more-movies", "_id" : "2" } }
{ "create" : { "_index" : "more-movies", "_id" : "3" } }
{ "title" : "Back to the Future Part III" }
{ "update" : {"_id" : "1", "_index" : "more-movies"} }
{ "doc" : {“director" : "Robert Lee Zemeckis"} }
"
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
새로고침 간격(Refresh interval) 조절
File System
Cache
(Page Cache)
JVM Heap
Indexing Buffer
(48 MB < 10% heap)
Disk
Segment Segment
refresh flush
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Replica 비활성화
1
1
Coordinating Stage
Primary Stage
Replica Stage
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
자동으로 생성되는 ID 사용
Formula:
• routing_factor = num_routing_shards / num_primary_shards
• shard_num = (hash(_routing) % num_routing_shards) / routing_factor
1
3
2
1
3
2 3
2
1
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
인덱싱과 검색 워크로드 분리
Domain 1
Domain 2
IndexA
IndexA
Replication
Indexing
Request
Search
Request
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
기타 유용한 팁
62
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
자동 튜닝(Auto-tune) 사용
Per-node
Evaluation
Cluster-
level
Evaluation
Decision
framework
Apply
optimizati
on
Deep
Telemetry
JVM Settings
• Heap size (up to 128 GiB)
• GC (change from CMS to G1GC*1)
• The size of the Young region
Cache
• Clear cache
• Field data cache size
• Shard request cache size
유지 관리 기간 중 블루/그린 배포로 반영
온라인으로 즉시 반영
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
워크로드에 따른 클러스터 분리
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
운영환경에서는 T2, T3 인스턴스를 피하십시오
• T2 및 T3의 경우 bootstrap.memory_lock이 false로 설정
• JVM에 할당된 메모리를 Swap-out 할 수 있음
• Full GC에서 Swap-out이 발생하면 Tread가 오랫동안 응답하지 않을 수 있음
• OOM을 막기위한 CircuitBreakerException 증가
• 다른 인스턴스에 비해 낮은 메모리 할당
• 지속적인 워크로드가 있는 환경에서는 T2 인스턴스 유형을 사용하지 않는 것이 좋습니다.
• CPUCreditBalance가 고갈되면 크레딧 보충이 유지되지 않음
• CPU 처리 성능이 항상 기준 성능으로 고정
• 속도 저하 및 오류와 같은 문제가 발생
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Data Stream 활용
Data streams
applog
.ds-applog-
000001
.ds-applog-
000002
.ds-applog-
000003
Indexing
Request
Search
Request
POST applog/_doc
{“message”: “hello”}
POST applog/_search
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
스케일링
67
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Scaling 전략
일반적으로 수직적 스케일링이 더 효과적
• 단일 노드가 커질수록 노드 장애 시 복구 시간이 증가
• 복구 비용과 성능 간의 Trade off
수평적 스케일링은 노드당 기능제한 대응에 효과적
• Storage 제한 (용량, IOPS, 처리량)
• Heap size 제한 (노드당 최대 32GB)
• Queue size 제한 (노드당 고정 값이 할당됨)
• 총 대역폭 - 최대 요청 페이로드 크기 (10MiB 또는
100MiB)
• Shard 수에 대한 소프트 제한 (노드당 Shard 1000개)
AWS DATA SPECIAL WEBINAR
© 2022, Amazon Web Services, Inc. or its affiliates.
Thank you!
© 2022, Amazon Web Services, Inc. or its affiliates.

More Related Content

What's hot

게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
Amazon Web Services Korea
 
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017
AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017
AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017
Amazon Web Services Korea
 

What's hot (20)

Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
 
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
 
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
 
Datadog을 활용한 Elastic Kubernetes Service(EKS)에서의 마이크로서비스 통합 가시성 - 정영석 시니어 세일즈 ...
Datadog을 활용한 Elastic Kubernetes Service(EKS)에서의 마이크로서비스 통합 가시성 - 정영석 시니어 세일즈 ...Datadog을 활용한 Elastic Kubernetes Service(EKS)에서의 마이크로서비스 통합 가시성 - 정영석 시니어 세일즈 ...
Datadog을 활용한 Elastic Kubernetes Service(EKS)에서의 마이크로서비스 통합 가시성 - 정영석 시니어 세일즈 ...
 
EMR 플랫폼 기반의 Spark 워크로드 실행 최적화 방안 - 정세웅, AWS 솔루션즈 아키텍트:: AWS Summit Online Ko...
EMR 플랫폼 기반의 Spark 워크로드 실행 최적화 방안 - 정세웅, AWS 솔루션즈 아키텍트::  AWS Summit Online Ko...EMR 플랫폼 기반의 Spark 워크로드 실행 최적화 방안 - 정세웅, AWS 솔루션즈 아키텍트::  AWS Summit Online Ko...
EMR 플랫폼 기반의 Spark 워크로드 실행 최적화 방안 - 정세웅, AWS 솔루션즈 아키텍트:: AWS Summit Online Ko...
 
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
 
실시간 스트리밍 분석 Kinesis Data Analytics Deep Dive
실시간 스트리밍 분석  Kinesis Data Analytics Deep Dive실시간 스트리밍 분석  Kinesis Data Analytics Deep Dive
실시간 스트리밍 분석 Kinesis Data Analytics Deep Dive
 
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트) IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
 
효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...
효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...
효과적인 NoSQL (Elasticahe / DynamoDB) 디자인 및 활용 방안 (최유정 & 최홍식, AWS 솔루션즈 아키텍트) :: ...
 
DMS와 SCT를 활용한 Oracle에서 Open Source DB로의 전환
DMS와 SCT를 활용한 Oracle에서 Open Source DB로의 전환DMS와 SCT를 활용한 Oracle에서 Open Source DB로의 전환
DMS와 SCT를 활용한 Oracle에서 Open Source DB로의 전환
 
Amazon Dynamo DB 활용하기 - 강민석 :: AWS Database Modernization Day 온라인
Amazon Dynamo DB 활용하기 - 강민석 :: AWS Database Modernization Day 온라인Amazon Dynamo DB 활용하기 - 강민석 :: AWS Database Modernization Day 온라인
Amazon Dynamo DB 활용하기 - 강민석 :: AWS Database Modernization Day 온라인
 
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
 
AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017
AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017
AWS 고객이 주로 겪는 운영 이슈에 대한 해법-AWS Summit Seoul 2017
 
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
 
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
 
대용량 트래픽을 처리하는 최적의 서버리스 애플리케이션 - 안효빈, 구성완 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
대용량 트래픽을 처리하는 최적의 서버리스 애플리케이션  - 안효빈, 구성완 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul 2021대용량 트래픽을 처리하는 최적의 서버리스 애플리케이션  - 안효빈, 구성완 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
대용량 트래픽을 처리하는 최적의 서버리스 애플리케이션 - 안효빈, 구성완 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
 
보안 사고 예방을 위한 주요 AWS 모범 사례 – 신은수, AWS 보안 담당 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
보안 사고 예방을 위한 주요 AWS 모범 사례 – 신은수, AWS 보안 담당 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집보안 사고 예방을 위한 주요 AWS 모범 사례 – 신은수, AWS 보안 담당 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
보안 사고 예방을 위한 주요 AWS 모범 사례 – 신은수, AWS 보안 담당 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
 
Amazon Aurora 100% 활용하기
Amazon Aurora 100% 활용하기Amazon Aurora 100% 활용하기
Amazon Aurora 100% 활용하기
 

Similar to Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링

강의 4. 데이터베이스:: AWSome Day Online Conference
강의 4. 데이터베이스:: AWSome Day Online Conference강의 4. 데이터베이스:: AWSome Day Online Conference
강의 4. 데이터베이스:: AWSome Day Online Conference
Amazon Web Services Korea
 
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
Amazon Web Services Korea
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Web Services Korea
 
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
Amazon Web Services Korea
 

Similar to Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링 (20)

나에게 맞는 AWS 데이터베이스 서비스 선택하기 :: 양승도 :: AWS Summit Seoul 2016
나에게 맞는 AWS 데이터베이스 서비스 선택하기 :: 양승도 :: AWS Summit Seoul 2016나에게 맞는 AWS 데이터베이스 서비스 선택하기 :: 양승도 :: AWS Summit Seoul 2016
나에게 맞는 AWS 데이터베이스 서비스 선택하기 :: 양승도 :: AWS Summit Seoul 2016
 
20130716 AWS Meister re:Generate - Amazon Redshift (Korean)
20130716 AWS Meister re:Generate - Amazon Redshift (Korean)20130716 AWS Meister re:Generate - Amazon Redshift (Korean)
20130716 AWS Meister re:Generate - Amazon Redshift (Korean)
 
스토리지 분야 신규 서비스 - 이창익, AWS 마이그레이션 스페셜리스트 :: AWS re:Invent re:Cap 2021
스토리지 분야 신규 서비스 - 이창익, AWS 마이그레이션 스페셜리스트 :: AWS re:Invent re:Cap 2021스토리지 분야 신규 서비스 - 이창익, AWS 마이그레이션 스페셜리스트 :: AWS re:Invent re:Cap 2021
스토리지 분야 신규 서비스 - 이창익, AWS 마이그레이션 스페셜리스트 :: AWS re:Invent re:Cap 2021
 
[Games on AWS 2019] AWS 사용자를 위한 만랩 달성 트랙 | Aurora로 게임 데이터베이스 레벨 업! - 김병수 AWS ...
[Games on AWS 2019] AWS 사용자를 위한 만랩 달성 트랙 | Aurora로 게임 데이터베이스 레벨 업! - 김병수 AWS ...[Games on AWS 2019] AWS 사용자를 위한 만랩 달성 트랙 | Aurora로 게임 데이터베이스 레벨 업! - 김병수 AWS ...
[Games on AWS 2019] AWS 사용자를 위한 만랩 달성 트랙 | Aurora로 게임 데이터베이스 레벨 업! - 김병수 AWS ...
 
AWS Summit Seoul 2023 | 오픈소스 데이터베이스로 탈 오라클! Why not?
AWS Summit Seoul 2023 | 오픈소스 데이터베이스로 탈 오라클! Why not?AWS Summit Seoul 2023 | 오픈소스 데이터베이스로 탈 오라클! Why not?
AWS Summit Seoul 2023 | 오픈소스 데이터베이스로 탈 오라클! Why not?
 
서버리스 기반 데이터베이스 모델링 및 운영 노하우 알아보기 - 변규현 SW 엔지니어, 당근마켓 / 김선형 CTO, 티클 :: AWS Sum...
서버리스 기반 데이터베이스 모델링 및 운영 노하우 알아보기 - 변규현 SW 엔지니어, 당근마켓 / 김선형 CTO, 티클 :: AWS Sum...서버리스 기반 데이터베이스 모델링 및 운영 노하우 알아보기 - 변규현 SW 엔지니어, 당근마켓 / 김선형 CTO, 티클 :: AWS Sum...
서버리스 기반 데이터베이스 모델링 및 운영 노하우 알아보기 - 변규현 SW 엔지니어, 당근마켓 / 김선형 CTO, 티클 :: AWS Sum...
 
AWS Summit Seoul 2023 | 잘나가는 애플리케이션 성능? 알맞은 스토리지로부터!
AWS Summit Seoul 2023 | 잘나가는 애플리케이션 성능? 알맞은 스토리지로부터!AWS Summit Seoul 2023 | 잘나가는 애플리케이션 성능? 알맞은 스토리지로부터!
AWS Summit Seoul 2023 | 잘나가는 애플리케이션 성능? 알맞은 스토리지로부터!
 
강의 4. 데이터베이스:: AWSome Day Online Conference
강의 4. 데이터베이스:: AWSome Day Online Conference강의 4. 데이터베이스:: AWSome Day Online Conference
강의 4. 데이터베이스:: AWSome Day Online Conference
 
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
빠르고 안전하게 간편한 AWS로 데이터 마이그레이션 하기::최유정 (AWS 솔루션즈아키텍트)
 
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
 
AWS 6월 웨비나 | AWS에서 MS SQL 서버 운영하기 (김민성 솔루션즈아키텍트)
AWS 6월 웨비나 | AWS에서 MS SQL 서버 운영하기 (김민성 솔루션즈아키텍트)AWS 6월 웨비나 | AWS에서 MS SQL 서버 운영하기 (김민성 솔루션즈아키텍트)
AWS 6월 웨비나 | AWS에서 MS SQL 서버 운영하기 (김민성 솔루션즈아키텍트)
 
효율적인 빅데이터 분석 및 처리를 위한 Glue, EMR 활용 - 김태현 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
효율적인 빅데이터 분석 및 처리를 위한 Glue, EMR 활용 - 김태현 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019효율적인 빅데이터 분석 및 처리를 위한 Glue, EMR 활용 - 김태현 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
효율적인 빅데이터 분석 및 처리를 위한 Glue, EMR 활용 - 김태현 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
 
[AWS Migration Workshop] SQL Server Performance on AWS
[AWS Migration Workshop]  SQL Server Performance on AWS[AWS Migration Workshop]  SQL Server Performance on AWS
[AWS Migration Workshop] SQL Server Performance on AWS
 
Cloud Native Aurora Serverless를 통한 Data Lake 구축 - 최유정 솔루션즈 아키텍트, AWS
Cloud Native Aurora Serverless를 통한 Data Lake 구축 - 최유정 솔루션즈 아키텍트, AWSCloud Native Aurora Serverless를 통한 Data Lake 구축 - 최유정 솔루션즈 아키텍트, AWS
Cloud Native Aurora Serverless를 통한 Data Lake 구축 - 최유정 솔루션즈 아키텍트, AWS
 
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
 
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트:: AWS Summit Online Korea 2020
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트::  AWS Summit Online Korea 2020천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트::  AWS Summit Online Korea 2020
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트:: AWS Summit Online Korea 2020
 
AWS 활용한 Data Lake 구성하기
AWS 활용한 Data Lake 구성하기AWS 활용한 Data Lake 구성하기
AWS 활용한 Data Lake 구성하기
 
워크로드에 적합한 최적의 클라우드 스토리지를 찾기 원하는 당신에게 - 김기현 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul ...
워크로드에 적합한 최적의 클라우드 스토리지를 찾기 원하는 당신에게 - 김기현 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul ...워크로드에 적합한 최적의 클라우드 스토리지를 찾기 원하는 당신에게 - 김기현 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul ...
워크로드에 적합한 최적의 클라우드 스토리지를 찾기 원하는 당신에게 - 김기현 AWS 솔루션즈 아키텍트 :: AWS Summit Seoul ...
 
AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론
 

More from Amazon Web Services Korea

More from Amazon Web Services Korea (20)

AWS Modern Infra with Storage Roadshow 2023 - Day 2
AWS Modern Infra with Storage Roadshow 2023 - Day 2AWS Modern Infra with Storage Roadshow 2023 - Day 2
AWS Modern Infra with Storage Roadshow 2023 - Day 2
 
AWS Modern Infra with Storage Roadshow 2023 - Day 1
AWS Modern Infra with Storage Roadshow 2023 - Day 1AWS Modern Infra with Storage Roadshow 2023 - Day 1
AWS Modern Infra with Storage Roadshow 2023 - Day 1
 
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
 
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
 
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
 
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
 
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
 
From Insights to Action, How to build and maintain a Data Driven Organization...
From Insights to Action, How to build and maintain a Data Driven Organization...From Insights to Action, How to build and maintain a Data Driven Organization...
From Insights to Action, How to build and maintain a Data Driven Organization...
 
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
 
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
 
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
 
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
 
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
 
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
 
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
 
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
 
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
 

Recently uploaded

Grid Layout (Kitworks Team Study 장현정 발표자료)
Grid Layout (Kitworks Team Study 장현정 발표자료)Grid Layout (Kitworks Team Study 장현정 발표자료)
Grid Layout (Kitworks Team Study 장현정 발표자료)
Wonjun Hwang
 
파일 업로드(Kitworks Team Study 유현주 발표자료 240510)
파일 업로드(Kitworks Team Study 유현주 발표자료 240510)파일 업로드(Kitworks Team Study 유현주 발표자료 240510)
파일 업로드(Kitworks Team Study 유현주 발표자료 240510)
Wonjun Hwang
 

Recently uploaded (6)

Grid Layout (Kitworks Team Study 장현정 발표자료)
Grid Layout (Kitworks Team Study 장현정 발표자료)Grid Layout (Kitworks Team Study 장현정 발표자료)
Grid Layout (Kitworks Team Study 장현정 발표자료)
 
오픈소스 위험 관리 및 공급망 보안 솔루션 'Checkmarx SCA' 소개자료
오픈소스 위험 관리 및 공급망 보안 솔루션 'Checkmarx SCA' 소개자료오픈소스 위험 관리 및 공급망 보안 솔루션 'Checkmarx SCA' 소개자료
오픈소스 위험 관리 및 공급망 보안 솔루션 'Checkmarx SCA' 소개자료
 
파일 업로드(Kitworks Team Study 유현주 발표자료 240510)
파일 업로드(Kitworks Team Study 유현주 발표자료 240510)파일 업로드(Kitworks Team Study 유현주 발표자료 240510)
파일 업로드(Kitworks Team Study 유현주 발표자료 240510)
 
도심 하늘에서 시속 200km로 비행할 수 있는 미래 항공 모빌리티 'S-A2'
도심 하늘에서 시속 200km로 비행할 수 있는 미래 항공 모빌리티 'S-A2'도심 하늘에서 시속 200km로 비행할 수 있는 미래 항공 모빌리티 'S-A2'
도심 하늘에서 시속 200km로 비행할 수 있는 미래 항공 모빌리티 'S-A2'
 
[OpenLAB] AWS reInvent를 통해 바라본 글로벌 Cloud 기술동향.pdf
[OpenLAB] AWS reInvent를 통해 바라본 글로벌 Cloud 기술동향.pdf[OpenLAB] AWS reInvent를 통해 바라본 글로벌 Cloud 기술동향.pdf
[OpenLAB] AWS reInvent를 통해 바라본 글로벌 Cloud 기술동향.pdf
 
클라우드 애플리케이션 보안 플랫폼 'Checkmarx One' 소개자료
클라우드 애플리케이션 보안 플랫폼 'Checkmarx One' 소개자료클라우드 애플리케이션 보안 플랫폼 'Checkmarx One' 소개자료
클라우드 애플리케이션 보안 플랫폼 'Checkmarx One' 소개자료
 

Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링

  • 1. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Amazon OpenSearch Service Deep Dive 내부구조, 성능최적화 그리고 스케일링 김성일 Sr Analytics Specialist Solutions Architect AWS
  • 2. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Agenda 2 • Amazon OpenSearch Service • Document, Index, Shard • Index 디자인 • 적합한 Domain 구성 예측 • API 요청 핸들링 • 검색성능 최적화 • 인덱싱 최적화 • 기타 유용한 팁 • 스케일링
  • 3. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Amazon OpenSearch Service 3
  • 4. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 4 Amazon OpenSearch Service • 대화형 로그 분석 • 실시간 애플리케이션 모니터링 • 웹사이트 검색 • 최신 버전의 OpenSearch와 19가지 버전의 Elasticsearch(1.5 ~ 7.10 버전)에 대한 지원 • OpenSearch Dashboards 및 Kibana 기반 시각화 기능(1.5 ~ 7.10 버전)을 제공합니다. • 오픈소스 • Elasticsearch에서 파생된 분산 검색, 분석 제품군 https://opensearch.org/
  • 5. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Document, Index, Shard 5
  • 6. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Field Document { "name": "John Smith", "age": 42, "confirmed": true, "join_date": "2014-06-01", "home": { "lat": 51.5, "lon": 0.1 }, "accounts": [ { "type": "facebook", "id": "johnsmith" }, { "type": "twitter", "id": "johnsmith" } ] }
  • 7. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index = Index document ID ID ID ID ID ID ID ID ID ID
  • 8. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. OpenSearch 구조 Index Shard Shard Shard Lucene Index Lucene Index Lucene Index Segment Segment Segment Segment Segment Segment Document
  • 9. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Shard - 배포 1 2 3 Primary Shard 여러 document가 들어있음 데이터 노드 Index Shard Shard Shard
  • 10. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Shard - 배포 1 2 3 Primary Shard 데이터 노드 Replica Shard 3 2 1 3 1 2 Replica Shard PUT more-movies { “settings” : { “Index” : { “number_of_shards” : 3, "number_of_replicas" : 2 } } }
  • 11. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Shard - 고려사항 Shard를 고르게 배포하려면 Shard 수를 데이터 노드(또는 AZ)의 배수로 구성하면 좋습니다. 1 2 3 1 2 vs number_of_shards : 3 number_of_shards : 2 가용성을 높이려면 AZ의 배수를 고려해서 Replica 수를 구성하면 좋습니다. Availability Zone 1 Availability Zone 1 Availability Zone 1 number_of_replicas : 2 vs Availability Zone 1 Availability Zone 1 Availability Zone number_of_replicas : 1
  • 12. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Index 디자인 12
  • 13. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index - 패턴 Long-Term Retention Index • 같은 Index에 소스 데이터를 저장 • 문서의 업데이트하거나 삭제가 필요한 경우가 많음 • movies • website-contents • Internal-docs Rolling Index • 인덱싱 기간 또는 보존 기간이 있고 계속적으로 흘러 들어오는 경우 • 오래된 Index는 보유 기간에 따라 Warm/Cold 계층으로 마이그레이션하거나 삭제 가능 • search-logs-2022 • iot-sensor-logs-2022-07 • weblogs-2022-07-30
  • 14. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index - 사이즈 관리 사이즈 기반 로테이션 • 크기 추정 불가 • 삭제 요구사항 없음 • 동일한 Shard 크기 유지 • index-A-000000 • Index-A-000001 기간(시계열) 기반 로테이션 • 크기 추정 가능 • 삭제 요구사항 있음 • 기간 기준 검색 요구사항 있음 • index-A-2022-09-01 • Index-A-2022-09-02
  • 15. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index – 로테이션 빈도에 따른 주의사항 매일마다 일정한 데이터 흐름 속도(양)으로 들어오더라도, 빈도에 따라 Shard 구성이 달라짐 만약, 일일 데이터 양이 30GB이고, Shard 사이즈를 50GB라 가정하면, Daily rotate • Primary Shard 수: 30GB* 1.1/50GB = 0.66 -> 1 Shard Weekly rotate • Primary Shard 수: 30GB* 1.1* 7일/50GB = 4.62 -> 5개 Shard Monthly rotate • Primary Shard 수: 30GB* 1.1 * 31일/50GB = 20.46 -> 21개 Shard
  • 16. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 적합한 Domain 구성 예측 16
  • 17. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Amazon OpenSearch Service Architecture
  • 18. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Domain 구성 예측 스토리지 크기 Index 디자인/전략에 기반한 Shard 수 Shard와 스토리지에 기반한 vCPU/Memory vCPU/Memory에 기반한 Data nodes (instanace type) Data nodes에 기반한 Master nodes (instanace type)
  • 19. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Domain 구성 예측 스토리지 크기 Index 디자인/전략에 기반한 Shard 수 Shard와 스토리지에 기반한 vCPU/Memory vCPU/Memory에 기반한 Data nodes (instanace type) Data nodes에 기반한 Master nodes (instanace type)
  • 20. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Storage - Tiers Data Volume Hot Instance + Cache Volume Instance + S3 Bucket + S3 Bucket UltraWarm Cold Storage Cost: high Low latency Cost: low Latency: high
  • 21. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. UltraWarm 노드 Amazon Elasticsearch Service domain Dashboard Application Load Balancer Queries Active Master Node Backup Master Node Backup Master Node Hot Data Node Hot Data Node Hot Data Node Hot Data Node UltraWarm Node UltraWarm Node UltraWarm Node Amazon S3 POST _ultrawarm/migration/my-Index/_warm POST _ultrawarm/migration/my-Index/_hot
  • 22. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Cold Storage • UltraWarm에서 액세스할 수 있는 Index 저장 영역 • 콜드 스토리지의 Index는 검색이 불가능 • 오랜 기간 동안 저렴하게 Index를 저장할 수 있음 • UltraWarm 노드에서 떼어내서 도메인의 스토리지 크기 제한에 관계없이 사용 • Index는 언제든지 UltraWarm 노드에 연결할 수 있음
  • 23. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Storage 크기 예측 Data Volume Hot Instance + Cache Volume Instance + Bucket + Bucket UltraWarm Cold Storage Source data size x (1+ Overhead) x (1+ Replicas) ÷ (1- OS 예약공간%) ÷ (1- Amazon OpenSearch Service Overhead%) Source data size x (1+ Overhead) × (1 + 0) Source data size x (1+ Overhead) × (1 + 0) OS 예약공간 • 노드 별 Storage 용량의 5% 확보 Amazon OpenSearch Service Overhead • 노드 별 Storage 용량의 20% 확보 (최대 20GB) • 500GB/3개 노드: MIN(20GB, 500GB x 0.2) x 3 = 60GB • 50GB/30개 노드: MIN(20GB, 50GB x 0.2) x 30 = 300GB 0.1 2 0.05 0.2
  • 24. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index overhead 일반적으로 오버헤드는 10% 정도 _cat/indices API
  • 25. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Domain 구성 예측 스토리지 크기 Index 디자인/전략에 기반한 Shard 수 Shard와 스토리지에 기반한 vCPU/Memory vCPU/Memory에 기반한 Data nodes (instanace type) Data nodes에 기반한 Master nodes (instanace type)
  • 26. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Shard - 개수와 사이즈 Magic number? • 작은 Shard가 너무 많으면 검색 성능 저하, 높은 Heap 사용률 등의 문제가 발생합니다. • Shard 사이즈가 너무 커도 검색 성능이 저하됩니다. • Long-Term Retention Index : 10GB - 30GB • Rolling Index : 10GB - 50GB • Index 생성 후에는 Shard 수를 수정할 수 없습니다. • Long-Term Retention Index : 향후 데이터 증가 고려 필요 • Rolling Index : 향후 데이터 증가 고려 불필요
  • 27. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Shard - 예측 Primary Shard의 수 = (source data + room for growth) x (1 + Indexing overhead) / size per Shard <참고> • 노드/AZ 수의 균형을 맞추면서 최종 Shard 수를 조정하는 것이 좋습니다. • Primary Shard의 개수가 7과 같이 2나 3으로 나누어지지 않는 경우 • 배포할 가용 영역의 수에 맞춰서 • 8 (2AZ의 배수) 또는 9 (3AZ의 배수) 로 고르게 분산 시키는 것이 좋습니다. PUT more-movies { “settings” : { “Index” : { “number_of_shards” : 3, "number_of_replicas" : 2 } } }
  • 28. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Shard - Primary Shard 수 계산 가정 • 매일마다 200 GB 씩 들어오는 로그성 데이터 • 각 Shard 크기는 30 GB 로 하려고 함 • 롤링 빈도 • 50GB를 초과하므로 매일마다 롤링 • 3 AZ에 3개의 데이터 노드가 분산되어 배포 계산 결과 • Primary Shard의 수: (200 GB + 0) x (1 + 0.1) / 30 GB x 1 day = 7 • 7 -> 6 (또는 9) • Replica Shards • 6 x 2 = 12 Shards per day (또는 9 x 2 = 18 Shards per day)
  • 29. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Domain 구성 예측 스토리지 크기 Index 디자인/전략에 기반한 Shard 수 Shard와 스토리지에 기반한 vCPU/Memory vCPU/Memory에 기반한 Data nodes (instanace type) Data nodes에 기반한 Master nodes (instanace type)
  • 30. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. vCPU 예측 • 일반적인 워크로드 • 클러스터에 할당할 vCPU 수는 Active Shard 수를 기반으로 합니다. • 1.5 vCPU per Active Shard 할당 • 고부하 워크로드 (빈도가 높은 인덱싱 및 검색이 있는 데이터 분석 환경) • 2 vCPU per 스토리지 100GB 할당 • 이 경우 Shard 크기는 50GB에 가까워야 합니다. <참고> Active Shard? • 인덱싱 요청과 빈번한 검색 요청을 처리하는 Shard • 인덱싱 요청 : 직접 인덱싱하는데 사용하는 Primary Shard + Replica Shard 수 • 검색 요청 : Primary Shard 수만 포함 • 실제 필요한 vCPU는 쿼리 병렬도(QPS = Queries Per Second)에도 영향을 받음
  • 31. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Memory 예측 일반적인 워크로드 • (Heap 영역에) 1GB per 20개 Shard. 고부하 워크로드 (빈도가 높은 인덱싱 및 검색이 있는 데이터 분석 환경) • (Heap 영역에) 8GB per 스토리지 100GB • 이 경우 Shard 크기는 50GB에 가까워야 합니다. <참고> • 노드에 실제 부여하는 메모리 : 필요한 Heap size * 2 • Amazon OpenSearch Service는 노드에 할당된 메모리의 절반을 Heap 영역으로 할당합니다. • 기본 Heap size 제한은 32GB입니다. • Amazon OpenSearch Service는 Heap size를 최대 128GB까지 늘릴 수 있는 Auto-Tune을 제공하지만 사용자가 제어할 수는 없습니다.
  • 32. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Domain 구성 예측 스토리지 크기 Index 디자인/전략에 기반한 Shard 수 Shard와 스토리지에 기반한 vCPU/Memory vCPU/Memory에 기반한 Data nodes (instanace type) Data nodes에 기반한 Master nodes (instanace type)
  • 33. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Hot node 인스턴스 타입 선택 Generic 1:4 vCPU:memory vCPU: 2 – 48 Memory: 8 – 192 GB Disk: 10GB – 9TB Networking: up to 20 Gbps R6gd Compute-optimized 1:2 vCPU:memory vCPU: 2 - 48 Memory: 4 – 96 GB Disk: 10 GB - 4.5 TB Networking: up to 20 Gbps Memory optimization 1:8 vCPU:memory vCPU: 2 – 48 Memory: 16 – 384 GB Disk: 10 GB – 12 TB Networking: up to 20 Gbps Memory optimization 1:8 vCPU:memory vCPU: 2 – 64 Memory: 16 – 512 GB Disk: 118 – 3800 GB Networking: up to 25 Gbps I/O optimization vCPU: 2 – 64 Memory: 15.25 – 488 GB Disk: 475 – 15200 GB Networking: up to 25 Gbps https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html SSD-Backed EBS(gp3, gp2, io1) NVMe SSD
  • 34. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Hot node 스토리지 선택 General Purpose SSD gp2 / gp3(recommended) Provisioned IOPS SSD io1 Previous Generation HDD (not recommended) magnetic NVMe SSD Instance store EBS Instance Store
  • 35. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. UltraWarm node 선택 - Can manage up to 20 TB of data per node - 16 vCPU, 122 GiB memory, 3.8 TiB local storage - Use 1,000 shards per node as a guide • 노드당 1.5 TB 까지 관리 가능 • 2 vCPU, 16 GB memory, 475 GB local storage • 노드당 약 400 개 shard 가능 ultrawarm1.large.search ultrawarm1.medium.search • 노드당 20 TB 까지 관리 가능 • 16 vCPU, 122 GB memory, 3.8 TB local storage • 노드당 약 1000 개 shard 가능
  • 36. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Domain 구성 예측 스토리지 크기 Index 디자인/전략에 기반한 Shard 수 Shard와 스토리지에 기반한 vCPU/Memory vCPU/Memory에 기반한 Data nodes (instanace type) Data nodes에 기반한 Master nodes (instanace type)
  • 37. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Master node 선택 Instance Count Recommended minimum instance type 1 – 10 m5.large.search or m6g.large.search 10 – 30 c5.xlarge.search or c6g.xlarge.search 30 – 75 c5.2xlarge.search or c6g.2xlarge.search 75 - 200 r5.4xlarge.search or r6g.4xlarge.search <참고> • T2 인스턴스 유형 및 t3.small.search는 프로덕션 환경에서 권장되지 않습니다. • 소모되는 리소스도 Index와 Shard의 수에 따라 달라지므로 CloudWatch 메트릭에서 실제 부하 상황을 확인하고 필요에 따라 도메인 크기를 확장합니다. • 마스터 노드의 관리 작업은 분산되지 않으므로, "스케일 아웃"이 작동하지 않습니다. • 다만, 가용성을 위해 3노드 구성을 권장합니다.
  • 38. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Master node Master Eligible Node-1 Master Eligible Node-2 Master Eligible Node-3 Master Node Master Eligible Node-2 Master Eligible Node-3
  • 39. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Master node Master Node Master Eligible Node-2 Master Eligible Node-3 Master Eligible Node-1 Master Node Master Eligible Node-3
  • 40. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. API 요청 핸들링 40
  • 41. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. API 요청 핸들링 Request Thread Thread Thread Thread Queue Thread Pool
  • 42. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. API 요청 핸들링 Queue Request Thread Pool Thread Thread Thread Thread Request Request Request Request Request 429(Too Many Requests)
  • 43. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Queue, Thread Pool, vCPU 상관관계 Queue와 Thread Pool은 각 API 유형에 개별적으로 할당 • Write (for Index, update, delete, bulk) - Queue size: 10000 (Elasticsearch 7.8 or later. Previous size is 200) - Thread pool size: The number of vCPUs • Search (for count, search, suggest) - Queue size: 1000 - Thread pool size: int ((the number of vCPUs x 3) / 2) +1 Thread Pool size는 노드에 할당된 vCPU에 따라 다릅니다. • (vCPU를 추가하기 위해) 인스턴스 유형을 변경하면 API 동시성이 증가합니다.
  • 44. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 검색성능 최적화 44
  • 45. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. File system cache에 메모리 할당 늘리기 File System Cache (Page Cache) JVM Heap (50% memory < 32 GB) Indexing Buffer (10% heap) Shard Request Cache (1% heap) Node Query Cache (10% heap) Field Data Cache (unbounded) Disk Segment Segment Segment
  • 46. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Node Query Cache 활용 GET logs/_search { "query": { "bool": { "must": [ (…) ], "filter": [ { "range": { "timestamp": { "gte": "now-1d/m", "lte": "now/m" } } (…)
  • 47. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 필요한 경우 인스턴스 스토어 사용 Physical host • 많은 양의 데이터를 검색하거나 집계할 때 높은 I/O 성능이 필요 • 인스턴스 스토어는 EBS보다 지연시간이 낮습니다. • 높은 I/O 성능이 필요한 경우, 인스턴스 스토어가 있는 인스턴스 유형 사용 • EC2 공식 문서에서 각 인스턴스 유형에 대한 인스턴스 스토어의 성능을 확인 • 충분한 I/O 성능을 제공하는 적절한 인스턴스 유형을 선택
  • 48. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 복잡한 Document 구조 피하기 • 중첩 필드 유형은 가능한 한 사용하지 마십시오 • 일반 필드 유형보다 검색 요청을 처리하는 데 몇 배 더 오래 걸릴 수 있습니다. • 중첩 유형 아래에 여러 필드가 있고 해당 필드의 조합으로 검색해야 하는 경우 • copy_to를 사용하여 여러 필드를 결합하고 단일 필드로 복사합니다. • 조인 필드 유형으로 부모-자식 관계를 최대한 사용하지 마십시오 • 일반 필드 유형보다 검색 요청을 처리하는 데 수백 배 더 오래 걸릴 수 있습니다. • 1:N 부모-자식 관계 외에는 사용하지 않는 것을 권장합니다.
  • 49. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 검색할 필드 수 줄이기 PUT users { "mappings": { "properties": { "full_name": { "type": "text" }, "first_name": { "type": "keyword", "copy_to": "full_name" }, "last_name": { "type": "keyword", "copy_to": "full_name" (…)
  • 50. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Term을 이용해서 범위 만들기 PUT index/_doc/1 { "item": ”banana", "price_krw": 4980 } GET index/_search { "aggs": { "price_ranges": { "range": { "field": "price_krw", "ranges": [ { "to": 10 }, { "from": 10, "to": 100 }, { "from": 100, "to": 1000 }, { "from": 1000, "to": 5000 }, { "from": 5000, "to": 10000 }, { "from": 10000 } ] (…) GET index/_search { "aggs": { "price_ranges": { "terms": { "field": "price_krw_range" } (…) fast slow PUT index/_doc/1 { "item": ”banana", "price_krw": 4980, "price_krw_range": "1000-5000" }
  • 51. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 목적에 따라 수치 데이터의 종류 선택 PUT index { "mappings": { "properties": { "product_id": { "type": "keyword", "fields": { "numeric": { "type": "integer" } } } } } } (…)
  • 52. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 가능한 Script 피하기 Shard Primary Shard Replica node.master:false node.data:true node.ingest:true Data node Pipeline Transformation and Transfer Kinesis Data Firehose
  • 53. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index sorting GET scores/_doc/_search { "track_total_hits": false, "size": 3, "sort": [ { "Score": "desc" } ] } “Name”: “Player000001”, “Score”:10 “Name”: “Player000002”, “Score”:200 “Name”: “Player000003”, “Score”:50 “Name”: “Player9999999”, “Score”:300 “Name”: “Player9999999”, “Score”:300 “Name”: “Player000002”, “Score”:200 “Name”: “Player000003”, “Score”:50 “Name”: “Player000001”, “Score”:10 ・・・ ・・・ Skipping
  • 54. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 큰 결과 값에는 페이징과 비동기 검색 활용 • OpenSearch는 단일 검색 요청에서 반환되는 문서 수에 제한이 있습니다. • 기본 limit : 10,000개 문서 • index.max_result_window 업데이트 • 큰 Heap 메모리가 필요하고 vCPU 사용률 증가 • search_after, size & from과 함께 페이징을 사용하여 • API 실행당 검색되는 문서 수를 줄이기 • 비동기 검색 사용 고려 • 배치 프로세싱과 같이 오랫동안 실행되는 쿼리
  • 55. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Index 롤업
  • 56. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 인덱싱 최적화 56
  • 57. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. _bulk API POST _bulk { "index" : { "_index" : "more-movies", "_id" : "1" } } { "title" : "Back to the Future" } { "delete" : { "_index" : "more-movies", "_id" : "2" } } { "create" : { "_index" : "more-movies", "_id" : "3" } } { "title" : "Back to the Future Part III" } { "update" : {"_id" : "1", "_index" : "more-movies"} } { "doc" : {“director" : "Robert Lee Zemeckis"} } "
  • 58. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 새로고침 간격(Refresh interval) 조절 File System Cache (Page Cache) JVM Heap Indexing Buffer (48 MB < 10% heap) Disk Segment Segment refresh flush
  • 59. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Replica 비활성화 1 1 Coordinating Stage Primary Stage Replica Stage
  • 60. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 자동으로 생성되는 ID 사용 Formula: • routing_factor = num_routing_shards / num_primary_shards • shard_num = (hash(_routing) % num_routing_shards) / routing_factor 1 3 2 1 3 2 3 2 1
  • 61. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 인덱싱과 검색 워크로드 분리 Domain 1 Domain 2 IndexA IndexA Replication Indexing Request Search Request
  • 62. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 기타 유용한 팁 62
  • 63. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 자동 튜닝(Auto-tune) 사용 Per-node Evaluation Cluster- level Evaluation Decision framework Apply optimizati on Deep Telemetry JVM Settings • Heap size (up to 128 GiB) • GC (change from CMS to G1GC*1) • The size of the Young region Cache • Clear cache • Field data cache size • Shard request cache size 유지 관리 기간 중 블루/그린 배포로 반영 온라인으로 즉시 반영
  • 64. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 워크로드에 따른 클러스터 분리
  • 65. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. 운영환경에서는 T2, T3 인스턴스를 피하십시오 • T2 및 T3의 경우 bootstrap.memory_lock이 false로 설정 • JVM에 할당된 메모리를 Swap-out 할 수 있음 • Full GC에서 Swap-out이 발생하면 Tread가 오랫동안 응답하지 않을 수 있음 • OOM을 막기위한 CircuitBreakerException 증가 • 다른 인스턴스에 비해 낮은 메모리 할당 • 지속적인 워크로드가 있는 환경에서는 T2 인스턴스 유형을 사용하지 않는 것이 좋습니다. • CPUCreditBalance가 고갈되면 크레딧 보충이 유지되지 않음 • CPU 처리 성능이 항상 기준 성능으로 고정 • 속도 저하 및 오류와 같은 문제가 발생
  • 66. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Data Stream 활용 Data streams applog .ds-applog- 000001 .ds-applog- 000002 .ds-applog- 000003 Indexing Request Search Request POST applog/_doc {“message”: “hello”} POST applog/_search
  • 67. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 스케일링 67
  • 68. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Scaling 전략 일반적으로 수직적 스케일링이 더 효과적 • 단일 노드가 커질수록 노드 장애 시 복구 시간이 증가 • 복구 비용과 성능 간의 Trade off 수평적 스케일링은 노드당 기능제한 대응에 효과적 • Storage 제한 (용량, IOPS, 처리량) • Heap size 제한 (노드당 최대 32GB) • Queue size 제한 (노드당 고정 값이 할당됨) • 총 대역폭 - 최대 요청 페이로드 크기 (10MiB 또는 100MiB) • Shard 수에 대한 소프트 제한 (노드당 Shard 1000개)
  • 69. AWS DATA SPECIAL WEBINAR © 2022, Amazon Web Services, Inc. or its affiliates. Thank you! © 2022, Amazon Web Services, Inc. or its affiliates.