aws 첫 번째 프로젝트 시작하기 :: 노경훈 :: aws summit seoul 2016
TRANSCRIPT
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
노경훈 Territory Sales Representative
17 May 2016
AWS 첫 번째 프로젝트 시작하기
비용 최적화 관점에서
Agenda
1. Intro
2. 총소유비용(TCO) 이해하기
3. 비용최적화(Cost Optimization)의 4가지 축
4. 비용최적화 원칙 적용해보기
5. 결론 및 요약
Intro - 이 세션에서 기대하는 것
처음으로 AWS를 시작하는 고객들에게가장 효율적인 접근 방법을 비용 중심으로소개
올바른 사이징, 구매옵션, 아키텍처, 그리고각종 관리 등을 통한 실제 Cost Optimization 사례 전달
비용에 대한 두려움 없애기
AWS 를시작하면서…
1. 계정을 만들고, 기본 보안 설정을 함
2. AWS SA들과 최적 아키텍처 만듦
3. Elastic Compute Cloud (EC2) 생성해 봄
4. EC2 Backup 도 해보고 restore를 해봄
5. SNS 를 이용해서 필요한 알람을 걸기도 함
6. Amazon Simple Storage Service (S3) 에 object를업로드 하고 public 웹서비스도 해봄
7. POC 하면서 마이그레이션 플랜도 짜봄
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
총소유비용(TCO) 이해하기
TCO 라는 말이 있었다.
태초에…
총소유비용 TCO(Total Cost of Ownership)?
정의 : 특정 기술 혹은 서비스에 대한 구현비용을 결정하기 위해 드는직간접적인 비용, HW & SW 획득, 설치, 교육, 지원, 유지보수, 기반구조, 가동중지, 공간 및 에너지
사용예:
1) 전체 혹은 일부 인프라를 운영하는데 드는 on-premise 혹은 co-loacation
비용을 AWS와 비교할 때
2) AWS로 마이그레이션할 예산작업(budgeting)이나 사업 보고서(business
case)를 작성할 때
서버가 AWS?
≠
On-Premises Cost 이해하기
비용최적화 마이그레이션전략을 세우기 위해 현재비용을 정확히 이해하는 것이중요합니다.
It is important to accurately
understand your current costs
in order to know how to build
your migration model for
optimal cost efficiency.
TCO = acquisition costs + operations costs
Hardware – Server, Rack
Chassis PDUs, ToR
Switches (+Maintenance)
Software - OS,
Virtualization Licenses
(+Maintenance)
Facilities Cost
Hardware – Storage Disks,
SAN/FC SwitchesStorage Admin costs
Network Hardware – LAN
Switches, Load Balancer
Bandwidth costsNetwork Admin costs
Server Admin Virtualization Admin4
Diagram doesn’t include every cost item. For example, software costs can include database, management, and middle-tier
software costs. Facilities cost can include costs associated with upgrades, maintenance, building security, taxes, etc. IT labor
costs can include security admin and application admin costs.
Space Power Cooling
Facilities Cost
Space Power Cooling
Facilities Cost
Space Power Cooling
Server Costs
Storage Costs
Network Costs
IT Labor Costs
1
2
3
illustrative
전통적인 인프라 준비 및 운영
전통적인 data center의한계
비탄력적인 물리 자산 비용 일괄적으로 계산하기 쉽지 않음
높은 확장 및 이전 비용 예상치 못한 오류로 인한 비용
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
비용최적화(Cost Optimization)의4가지 축
비용최적화는
going from… to…
pay for what you use(사용) pay for what you need(필요)
어디서부터 시작해야할까요?
비용최적화를 위한 4가지 축
Right Sizing(적절한 용량산정)
Purchase
Option(구매옵션)
Increase
Elasticity(탄력적 아키텍처)
Measure,
Monitor, &
Improve(지속적 관리)
Right sizing
Right sizing 적절한 용량산정
• 필요한 성능을 가진 instance 중 가장 저렴한것을 고른다.
• CPU, RAM, storage, network utilization 등을모니터링 하면서 down sizing할 인스턴스를찾는다.
• Amazon CloudWatch metrics나 custom RAM
metrics으로 계속해서 모니터링 하면서 타입을조정한다.
요령: 용량산정 후 Reserved Instance사용
• 현재 워크로드와 잘 맞는 instance type을 찾아야 함– 필요한 성능 정의
– 현재 성능 모니터링
– Change Instance Type
Instance 선택 = Performance Tuning
Purchase Option(구매옵션) – 예약 인스턴스(RI)
계약기간1 Year
3 Year
AWS Services Offering RIs
Amazon EC2
Amazon RDS
Amazon DynamoDB
Amazon Redshift
Amazon ElastiCache
* Dependent on specific AWS service, size/type, and region
Purchase Option(구매옵션) – 예약 인스턴스(RI)
Step 1: RI Coverage
• 항상켜져 있는 instance에 적용
Step 2: RI Utilization
• RI의 활용률을 높이기 위해 적용된 instance를최대한 활용
• 필요하면 쪼개거나 합치는 것도 가능
Purchase Option(구매 옵션) - EC2 Spot Pricing
Users with urgent
computing needs or
large amounts of
additional capacity
Time or instance
flexible
Experiment and/or
build cost sensitive
businesses
* Compared to On Demand price based on specific EC2 instance type, region and availability zone
Purchase Option(구매 옵션) - Spot Instance
Increase elasticity – 탄력적 아키텍처
쓰지 않는 instance는 끄세요.
• dev/test, non-prod instances 인데 항상켜져있는 것들
Autoscaling
• Auto Scaling을 통해 scale up and down
• Instance type을 작게 운용 가능
적절한 용량과 탄력적 아키텍처의 적용
More smaller instances vs. fewer larger instances
29 m4.large @ $0.165/hr
$3,445.2 / mo*
59 t2.medium @ $0.080/hr
$3,398.4 / mo*
*기준 Linux instances in Seoul Region at 720 hours per month
1. 24시간 켜놓아야 하는workload들은 예약 인스턴스
2. Autoscaling 그룹을 통한탄력적 대응
3. Spot로 먼저 생성, 필요하면On-Demand로 대응
0
2
4
6
8
10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/Spot
On Demand
Spot
Reserved Instance
Autoscaling + Purchase Option(구매옵션)
Increase elasticity
Managed Service 사용하기 -ELB
Availability
Zone #1
Availability
Zone #1
EC2 Instance
+ 소프트웨어LB
DNS
DNS
웹서버
웹서버
$ 0.025시간당
$ 0.08시간당 (t2.medium)
VS.
*기준 Linux instances in Seoul Region
Managed Service 사용하기 - SQS
Amazon
SES
Amazon
SNS
생산자
생산자생산자EC2 인스턴스
+ 소프트웨어큐
SQS 소비자
소비자
$ 0.0110,000 요청당(요청 당 $0.000001)
$ 0.08시간당 (t2.medium)
VS.
*기준 Linux instances in Seoul Region
Managed Service 사용하기 – S3
$ 0.08시간당 (t2.medium)
EC2 인스턴스+ Web Server
+Streaming
Imaging
+Downloading
*기준 Linux instances in Seoul Region
web access
Streaming & image distributions
Download distributions
Amazon S3
$ 0.00시간당 – 서버 없음
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
비용최적화(Cost Optimization) 원칙적용해보기
실제사례
로드밸런서(이중화)
- HSRP based Active – Standby
appliance based balancer X 2
웹서버 10 대- 4 core, 16GB ram X 10 EA
- 500GB SAS disks X 10 EA
DB 서버 2대 이중화(총 4대)
- 8 core, 32GB ram X 4 EA
- 1TB Raid 5 volumes per each
servers
- MySQL
AWS Balancer
- 1 Elastic Load Balancer ($18.3/month)
AWS EC2 Web servers:
- On-demand, m4.xlarge X 10, 100%
Utilization
- PIOPS 1500, EBS 500GB per instances
AWS RDS servers:
- On-demand, db.m4.2xlarge Multi-AZ X 2
- PIOPS 5000, 1TB Storage per instances
AWS Business level support
비싸다고 생각되시나요? 이 숫자를 기억해주십시오.
$ 10,838.41/month
* Seoul Region 기준
Let’s drill down
무엇이 잘못 되었을까요?
#1 Right Sizing
Over Provisioning 하지말자.
대부분의 경우 평소 CPU 사용률 그래프
비용 VS. 실제 사용률
Money
Time
당신이 실제 쓰는 자원
당신이 내는 금액
WASTE!!
100%
10% 이하
사놓은 것 Vs. 쓰는 양
인스턴스 타입 변경
EC2 – Change Instance Type 기능
수분 내에 타입 변경 가능
Down size your EC2
From m4.xlarge to t2.medium
Down size your RDS
From m4.2xlarge to m4.large
인스턴스 타입만 조절했을 뿐인데…
$ 10,838.41/month
to
40% 절약!
/month$ 6,482.19
EBS용량은 필요한 만큼
Down size your EBS
From 500GB 1500 PIOPS to General Purpose(SSD) 50GB
Down size your RDS
From 1TB 5000 PIOPS to General Purpose(SSD) 50GB
성능 및 용량만큼 조절한 결과….
to
/month
76.5% 절약!
$ 6,482.19/month
$ 1,526.45
#2 Increase Elasticity
가능한 Auto Scaling 적용
많이 줄이긴 했는데…더 줄일 수 있나요?
Serv
ice T
raffic
Time
100%
# of instance Transfer Out
Transfer In
AutoScaling이 아니었으면 낭비 되었을 비용
Serv
ice T
raffic
Time
100%
Transfer Out
Transfer In
Auto Scaling 적용
AWS Balancer
- 1 Elastic Load Balancer ($18.3/month)
AWS EC2 Web servers:
- On-demand, t2.medium X 2, 100% Utilization
- On-demand, t2.medium X 4, 50% Utilization
- On-demand, t2.medium X 4, 10% Utilization
- General Purpose 50 GB per instances
AWS RDS servers:
- On-demand, db.m4.large Multi-AZ X 2
- General Purpose 50 GB per instances
AWS Business level support
Auto Scaling 적용결과
to
/month
또 23.6% 절약!
$ 1,526.45/month
$ 1,166
#3 Purchase Option
Reserved Instance를 쓰자.
Reserved Instance 사용
AWS 로드 밸런서- 1 Elastic Load Balancer ($18.3/month)
AWS EC2 웹서버 10대- Partial RI 1 year , t2.medium X 2, 100% Utilization
- On-demand, t2.medium X 4, 50% Utilization
- On-demand, t2.medium X 4, 10% Utilization
- General Purpose 50 GB per instances
AWS RDS DB서버 4대- Partial RI 1 year, db.m4.large Multi-AZ X 2
- General Purpose 50 GB per instances
AWS Business level support
1 year RI 적용결과
to
/month
또 30.8% 절약!
$ 1,166/month
$ 806.4
처음 그냥 계산기에 넣었던 숫자 기억하십니까?
$ 10,838.41/month
to
$ 806.4/month
$ 9,676.72/year
92.6% 절약!
아직도 부담 되시나요? 꼭 기억해주세요.API /SDK /CLI /Web Console
기술문서표준 아키텍처
모니터링몇 분안에 글로벌 진출OS/ DB 라이선스 계약
Compliance/ Certificates
Network Bandwidth/ Peering
Huge number of references
초기투자 $0
Billing Options
IAM based Federation/ 보안이중화
Hardware Security Module
…
직접 구축한다면 막대한 시간과 비용이 필요합니다.
중간 요약1. Over Provisioning 하지말자.
2. 가능한 Auto Scaling 적용.
3. Reserved Instance를 쓰자.
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
결론 및 요약
비용최적화를 위한 지속적인 관리Measure, Monitor, & Improve
(4번째 축 기억나세요?)
Measure, Monitor, & Improve - Metrics & targets
% Instances turned off daily
% of Instances Right-Sized
% Always on Resources
Covered by RIs
% RI Utilization
✔✔✔✔✘
✘
✘
✘
각 수치에 대한 기준 마련 및 추적
Measure, Monitor, & Improve - AWS Tools
클라우드 환경에서의 IT
계획 구축 실행구축
모니터링
설계
Months Minutes
과거 현재 - AWS
비용은 모든 요소와 연결됨
Right Sizing
Purchase
Option
Increase Elasticity
Measure, Monitor, &
Improve
TCO
요약 - 기억합시다!
1. 안쓰는 Instance는 끄고, EBS는 없애자.
2. Over Provisioning 하지말자.
3. AutoScaling 적극 활용 하자.
4. RI와 Spot을 쓰자.
5. 계속해서 Measure, Monitoring, Improve
6.Cloud에 맞는 사고 방식을 갖자.
7. AWS 와 상의하자