Más contenido relacionado La actualidad más candente (20) Similar a 진화하는 CloudFront 의 이해와 글로벌 서비스 활용 - 안수일 시니어 솔루션즈 아키텍트, GS NEOTEK :: AWS Summit Seoul 2019 (20) Más de Amazon Web Services Korea (20) 진화하는 CloudFront 의 이해와 글로벌 서비스 활용 - 안수일 시니어 솔루션즈 아키텍트, GS NEOTEK :: AWS Summit Seoul 20191. S U M M I T
S E O U L
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
진화하는 CloudFront의 이해와
글로벌 서비스 활용
안수일
Solutions Architect
GS네오텍
3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDN (Contents Delivery Network)
진화하는 Amazon CloudFront
Amazon CloudFront 활용
GS네오텍 WiseN 서비스
본 강연에서 다룰 내용
4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cache
자주 엑세스하는 데이터나 프로그램 명령을
반복해서 검색하지 않고도
즉각 사용할 수 있도록 저장해두는 영역
6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Contents 서비스에서의 Cache
Cache Server ORIGIN
Contents 응답
Contents 요청
Cache
Hit
Cache
Miss
Contents 응답
Contents 요청
원본 Contents
Contents 응답
Contents 요청
7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
≒CDN
8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDN
전 세계에 전략적으로 배치된
대규모 서버 네트워크를 이용하여
지리적으로 가장 가까운 Edge로부터 Contents를 전송
(Contents Delivery Network)
9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why do we need CDN?
Last Mile Middle Mile First Mile
• 트래픽은 거리가 멀수록 / 데이터 양이 많을수록 전송 지연
• 대부분의 속도 저하는 Middle Mile 구간에서 발생
Internet
ORIGIN
10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDN (Contents Delivery Network)
10ms
CDN
(Amazon CloudFront)
90ms
지리적으로 가까운~
100ms
CDN X 아주 먼 !!!
ORIGIN
11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront
• AWS 고가용성 글로벌 CDN 서비스
• Static Contents 캐싱
• Dynamic Contents 전송 성능 개선
• Contents 보호 : 무료SSL 및 Custom SSL 지원
• Contents 보안/제어 : Signed URL, Signed Cookie
• Origin 장애 조치 지원 : Origin Group
• S3 업로드 가속 기능
Amazon CloudFront
(CDN Service)
“콘텐츠 전송 네트워크(CDN)”
13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront : Global Infra
29개국 / 65개 도시 / 166개 Edge (155개 Edge Location & 11개 Regional Edge Caches)
• 대규모 / 고성능 Super Pop Architecture
14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Global Backbone
• Region, Edge 간 전용회선
• 이중화된 100GBE 네트워크
• 모든 AWS 리전 간 트래픽은
Amazon Global Backbone을
사용하도록 설계
15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
서울↔유럽 데이터 전송 성능 비교
Ireland ClientSeoul Region
Internet
10MB 전송시 평균 12.8초 소요 (6.25 Mbps)
Amazon S3 Direct
Public Internet
10MB 전송시 5초 소요 (16 Mbps)
AWS Backbone Public Internet
Amazon
CloudFront
Amazon S3
• Origin : Seoul Region Amazon S3 ↔ Client : Ireland
• Amazon S3 직접 연결 VS Amazon CloudFront 연결
• 10MB 파일의 1st 다운로드 성능 비교
16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Static Contents Delivery
90ms
Cache를 이용한 빠르고 안전한 Static Contents 전송
Amazon
CloudFront
.
.
.
10ms
Cache
Hit
AWS Cloud
Origin
Static Contents
- 일정한 형태.
- 원본 그대로.
2번째 사용자
1번째 사용자
Cache
Miss
10ms
17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic Contents Delivery ?
400ms
TTL=0
Amazon
CloudFront
400ms①
②
③
400ms
400ms
???
Dynamic Contents
- 수시 변경
- 같은 요청→다른 결과
* 최신 Contents
AWS Cloud
Origin
18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic Contents Delivery
전체 응답 시간 = DNS Lookup + TCP Connection + Time To First Byte + Contents Download
DNS Lookup 서버연결 최초응답 Contents 다운로드
Request
• 요청자 – Edge간 연결 시 최적의 Edge연결
• Origin과의 지속적인 연결 유지
• Edge – Region 간 모니터링으로 최적화된 네트워크
• Gzip 압축 사용
Dynamic Contents
전송 성능 향상
Dynamic Contents 어떻게 ?
19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic Contents Delivery
100ms
AWS Cloud
VPC
Amazon
EC2
Dynamic Contents
Elastic Load
Balancing
(ELB)
2번째 사용자
400ms
400ms
1번째 사용자
Origin 연결 유지 : 일반적인 서버 연결 ( TCP 3Way Handshake Connection)
20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic Contents Delivery
AWS Cloud
VPC
Amazon
EC2
Dynamic Contents
Elastic Load
Balancing
(ELB)
10ms
2번째 사용자
130ms
90ms
Amazon
CloudFront
Keep Alive
Connection
Keep Alive Connection 을 통한 연결 설정 시간 단축
400ms
1번째 사용자
21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GZIP 압축
Gzip 압축 기능 : 최대 80%의 속도, 비용 개선
• 1KB ~ 10MB 크기의 파일 압축
• 웹 페이지 로딩 속도 개선
• 콘텐츠 다운로드 시간 단축
• 데이터 전송 비용 절감
Header 포워딩
Accept-
Encoding
: gzip
HTTP
Amazon
CloudFront Origin
22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Origin Selection
/*.* (DEFAULT)
/images/*
/*.css
ORIGIN A: Web Server
ORIGIN B : Images
GET http://www.example.com/do?login to ORIGIN A
GET http://www.example.com/images/logo.jpg to ORIGIN B
GET http://www.example.com/css/main.css to ORIGIN C
ORIGIN C : CSS
Path Pattern Matching
단일 배포에서 여러 Origin의 Contents를 처리
Amazon
CloudFront
23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cross-Origin Resource Sharing
원본 리소스 쉐어링을 통해 같은 도메인에서 서비스
www.example1.com
www.example2.com
www.example.com/ex1
www.example.com/ex2
Amazon
EC2
Amazon
S3
Origin
원본 리소스 쉐어링
Amazon
CloudFront
24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Origin Group
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
404 Not Found
403 Forbidden
• Origin Group 내에 2개의 Origin 설정
• Primary Origin 장애 감지 시 Secondary
Origin 에서 서비스 제공
• 장애 조치 기준 코드 선택 가능
Origin 장애 조치 지원
25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SSL (Secure Sockets Layer) 지원
Amazon
CloudFront
HTTPS
https://ssl.mydomain.com
Amazon
EC2
Dynamic Contents
Elastic Load
Balancing
(ELB)
SSL 인증서 : 데이터 변조 및 정보 유출 방지를 위한 사용
SSL 인증서Browser
진위여부확인
SSL 인증서
HTTP
26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Signed URL , Signed Cookie 사용
배포되는 Contents에 대한 보호 및 세부 제어
인증서버
인증요청
인증
Signature전달
Amazon
CloudFront
URL인증
• Policy
• Signature
• Key-Pair-Id
Signed URL
Signed URL : 일반 Contents, RTMP서비스
Signed Cookie : HLS 서비스
AWS Cloud
Origin
27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront + Amazon S3
• 가장 손쉬운 구성으로 Static Contents 를 제공
• Contents File 을 S3 Bucket 에 무제한으로 저장 가능
• Storage 공간 계획 및 할당 필요 X
• Static Contents를 분리하여 서버 비용 절약
Amazon
CloudFront
Amazon S3과금 0$
29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon S3 업로드 가속
Amazon S3 업로드 가속 (S3 Transfer Acceleration)
PUT/POST
업로드 가속
Write
Amazon S3 Amazon
CloudFront
일반 S3 EndPoint : BUCKET_NAME.s3.amazonaws.com
가속 S3 EndPoint : BUCKET_NAME.s3-accelerate.amazonaws.com
30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront + Amazon EC2
Dynamic Contents 전송
• Dynamic Contents 전송을 위한 웹서버(Custom Origin) 구성
• Dynamic Contents 전송 최적화 기능 활용
Amazon
EC2
Dynamic Contents
Elastic Load
Balancing
(ELB)
Amazon
CloudFront
과금 0$
31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront + Amazon Route53
GEO Location을 활용한 Multi CDN 활용
GLOBAL CHINA
Amazon
CloudFront
Local(China)
CDN
Amazon
Route53
32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront + Amazon Media Service
Media Contents 전송 지원
Amazon
CloudFront
LIVE
VOD
VOD Source
AWS Elemental
MediaConvert
Amazon
S3
Amazon
S3
Transcoding
Transcoded
Media Origin
Content
Delivery
Media
upload
Live Source
AWS Elemental
MediaLive
AWS Elemental
MediaStore
Ingest
Encode
Stream
Content
Delivery
33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda@edge
• CloudFront의 Edge에서 Lambda를 실행→ HTTP 호출에 대한 맞춤형 Contents 제공
• Lambda 배포 후 사용가능하며, 최종 사용자와 가장 가까운 Edge에서 실행
• 원하는 목적에 따라 CloudFront의 이벤트에 대한 응답으로 Edge의 전/후 시점에서 실행
① Viewer Request ② Origin Request
④ Viewer Response ③ Origin Response
Amazon
CloudFront
Origin
34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda@edge
① Viewer Request ② Origin Request
{CF}/gsneotek.jpg?d=128x128
③ Origin Response
HTTP STATUS :
404(File Not Found)
④ Viewer Response
HTTP STATUS :
404(File Not Found)
Amazon
CloudFront
Lambda@edge 사용 예)
• Lambda@Edge를 활용한 URI 수정 자동화
• Lambda@Edge를 활용한 이미지 리사이즈 자동화
Amazon Simple
Storage Service (S3)
Origin
원본이미지
gsneotek.jpg
35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda@edge
① Viewer Request ② Origin Request
{CF}/gsneotek.jpg?d=128x128 {Origin}/128x128/gsneotek.jpg
③ Origin Response
HTTP STATUS :
404(File Not Found)
④ Viewer Response
HTTP STATUS :
200(OK)
Modify URI
Resize Image
Amazon
CloudFront
Lambda@edge 사용 예)
• Lambda@Edge를 활용한 URI 수정 자동화
• Lambda@Edge를 활용한 이미지 리사이즈 자동화
Amazon Simple
Storage Service (S3)
Origin
원본이미지
gsneotek.jpg
36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Origin 보호
example.com
Amazon
EC2
Origin
Elastic Load
Balancing
(ELB)
Amazon Simple
Storage Service (S3)
Amazon
CloudFront
Origin
37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Origin 보호
Origin Access Identify(OAI) Block by IP address, Custom Header
Amazon
EC2
Custom Origin
Elastic Load
Balancing
(ELB)
Amazon Simple
Storage Service (S3)
S3 Origin
CloudFront를 경유하지 않은 접근에 대한 차단
CloudFront IP Range 가 아닌 Access 차단
CloudFront - ALB 간 접근제어 : Custom Header 활용
38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DDoS 공격에 대한 보호
AWS Shield Standard 에 의한 Layer 3/4 보호 제공
• 관리형 DDoS 보호 서비스
• SYN/UDP 등 L3/L4 DDoS 공격 트래픽 차단
• CloudFront Edge에 도달하는
모든패킷에 대해 인라인 검사
• Application의 앞단에 CloudFront 경유하여
모든 알려진 Layer 3 / 4 공격으로부터
가용성을 포괄적으로 보호
DDoS 공격
정상 사용자
AWS Origin
L3/L4 DDoS 자동 차단
Custom Origin
------------------- OR -----------------
OriginEdge location
Amazon
CloudFront
Amazon
Shield
39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WiseN Service
• 1. CloudFront Analyzer
• 2. Multi-CDN
• 3. Multi-CDN Uploader
• 4. GuardDuty Dashboard
• 5. Case Manager
• 6. Resource Checker
• 7.Media CMS
…
41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront Analyzer
Amazon CloudFront Reports + 추가 모니터링 서비스
• Cache 통계 : 상태코드별 Request, Cache Hit/Miss
• Populer Objects : Top 50 인기 Objects
• Top Referrers : Top 25 Referrers, Requests
• Usage : HTTP/HTTPS Request, 전송된 데이터
• Viewers : Devices, Browers, O/S, Locations
• BandWidth
• Media Session
• Edge Trend
• Time Taken
• DownloadSpeed
• Unique User Trend
42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront Analyzer
Bandwidth : 5분/1시간/1일 별 Bandwidth 모니터링
Media Session : HLS 미디어 세션 통계 제공
최소 1분 단위 통계 제공 – 광고 시스템 연계 API 제공
Bandwidth (bps)
Media Session
43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront Analyzer
Edge Trend : Edge 별 Request Count (최대 상위 20개)
Edge별 Request / 국내 vs 해외 Request 동향 모니터링
44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront Analyzer
Download Speed : 다운로드 평균 속도
100KB 이상의 Object 에 대한 상/하위 10% 평균 및 나머지 전체 평균에 대한
다운로드 속도 모니터링
45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront Analyzer
Time Taken : Edge 기준 Response Time
Edge의 Response Time을 측정하여 성능 및 정상서비스 여부 모니터링
46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WiseN Multi-CDN 정책 관리 서비스
다양한 CDN 서비스 정책 관리서비스
1개의 서비스 도메인-N개의 CDN Provider 등록 가능
분기 제어 정책
- 가중치 기반 (Weighted)
- 지역 기반 (Geolocation)
- 요일 기반 (Day Of Week)
- 전송량 제한 기반 (Transferred Data)
Dashboard 통한 모니터링
- 서비스 도메인 기준 각 CDN Provider 분배 현황
- 장애 경고
47. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WiseN Multi-CDN 정책 관리 서비스
CDN Provider 에 대한 통계 제공
Bandwidth
Transferred Data
Request
분배 흐름을 확인 할 수 있는 기본 통계 정보 제공
CDN Provider 별 통계 제공
Time Scheduling 기능 제공
시간대 별 정책 지정 가능
• CDN A : 80%
• CDN B : 10%
• CDN C : 10%
• CDN A : 40%
• CDN B : 30%
• CDN C : 30%
48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WiseN Multi-CDN Uploader
CDN 원본 저장소 파일 관리 (Windows기반)
N개의 여러 저장소 동적관리
Amazon S3, SFTP, SCP 등 프로토콜 제공
저장소별 Invalidation(Purge) 기능
파일(or 디렉토리) 선택 Invalidation 기능
파일(디렉토리) 업/다운로드 기능
동시에 여러 저장소 동일하게 수행 가능
멀티 업/다운로드 및 자동에러 복구 기능
Drag & Drop 파일 복사 기능
파일 정합성 체크 비교 기능
저장소 대 저장소 비교 기능
51. 여러분의 피드백을 기다립니다!
#AWSSummit 해시태그로
소셜미디어에 여러분의
행사소감을 올려주세요.
AWS Summit Seoul 2019
모바일 앱과 QR코드를 통해
강연평가 및 설문조사에
참여해 주시기 바랍니다.
내년 Summit을 만들 여러분의
소중한 의견 부탁 드립니다.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
52. Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
안수일
architect@gscdn.com
53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.