AWS Graviton2インスタンスで コストパフォーマンスを最適化︕
Transcript of AWS Graviton2インスタンスで コストパフォーマンスを最適化︕
© 2021, Amazon Web Services, Inc. or its Affiliates.
AWS Graviton2インスタンスでコストパフォーマンスを最適化︕
第六回「アップデート紹介とちょっぴりDiveDeepするAWSの時間」
2021/05/27
Amazon Web Services Japan K.K.Compute Specialist Solutions Architect松尾康博
© 2021, Amazon Web Services, Inc. or its Affiliates.
o 名前︓松尾康博
o 経歴o ⼤学院︓スパコンの運⽤効率化研究(と⾃動⾞整備⼠)o Sierで分散キューの開発・導⼊、分散処理研究o Web系スタートアップCTOo Sierで仮想化基盤の調査・導⼊・運⽤o 現職(⼩売、スタートアップ、HPC、Deep Learning, GPU, Outposts,
Wavelength, Graviton2)o 趣味
o ⾛⾏ロガーの分析
⾃⼰紹介
© 2021, Amazon Web Services, Inc. or its Affiliates.
Graviton2の概要
© 2021, Amazon Web Services, Inc. or its Affiliates.
2006年 EC2開始当時
必要に応じてスケールアウト/イン
従量課⾦1種類のインスタンス
M1
© 2021, Amazon Web Services, Inc. or its Affiliates.
現在のEC2の選択肢
カテゴリー 機能 オプション
Amazon EBSAmazon Elastic Inference
Elastic Fabric Adapter
General purpose
Burstable
Compute intensive
Memory intensive
Storage (high I/O)
Dense storage
GPU compute
Graphics intensive
Choice of processor(AWS, Intel, AMD)
Fast processors(up to 4.5 GHz)
High footprint(up to 24 memory TiB)
Instance storage(HDD and NVMe)
Accelerated computing(GPUs and FPGA)
Networking(up to 100 Gbps)
Bare metalSize
(nano to 32xlarge)
I N S TA N C E T Y P E S
あらゆるワークロードとビジネスニーズに対応
© 2021, Amazon Web Services, Inc. or its Affiliates.
Amazon EC2 のプロセッサの選択肢
© 2021, Amazon Web Services, Inc. or its Affiliates.
Gravitonの歴史
AWS Graviton processoro 2018年11⽉GAo 第⼀世代 Armプロセッサo 50億トランジスタ、16nmプロセスo 最⼤16コア(vCPU)o A1インスタンスに搭載
AWS Graviton2 processoro 2020年5⽉GAo 第⼆世代Armプロセッサo 300億トランジスタ、7nmプロセスo 4倍のコア数、2倍のキャッシュ容量o 7倍のCPU性能、2倍の vCPU性能
© 2021, Amazon Web Services, Inc. or its Affiliates.
[参考] Graviton2プロセッサの詳細
Arm Neoverse N1コア、Arm v8.2準拠o No SMT・No NUMAo 64KB L1 & 1MB L2キャッシュ / vCPU、32MB LLCo 64コア間は ~2TB/s メッシュ型インタコネクトで接続o PCIe Gen4 64レーン搭載
8 x DDR-3200チャネル (> 200GB/s)o インスタンス上のDRAMメモリの内容はAES-256で暗号化
1Tbit/s 圧縮アクセラレータo 2xlarge以上のインスタンスは圧縮デバイスが利⽤可能o 最⼤15GB/sの圧縮、最⼤11GB/sの伸張処理
© 2021, Amazon Web Services, Inc. or its Affiliates.
AWS Graviton2 搭載インスタンスのラインナップ
M6g汎⽤
1:4 vCPU:memory
R6gメモリ最適化
1:8 vCPU:memory
C6gコンピューティング最
適化1:2 vCPU:memory
X2gdメモリ最適化
1:16 vCPU:memory最大 1TB
T4gバースト可能な
汎⽤インスタンス無料枠提供中
(〜6/30)
その他:・ローカルNVMe SSD ストレージを搭載したバリエーション:
汎⽤ (M6gd), コンピューティング最適化 (C6gd), メモリ最適化 (R6gd & X2gd)
・ベアメタルタイプ: M, C, R, X インスタンスファミリー:(M6g.metal, M6gd.metal, C6g.metal, C6gd.metal, R6g.metal, R6gd.metal, X2gd.metal)
Free Trial
C6gn100 Gbps Networking
38 Gbps EBS
New!
© 2021, Amazon Web Services, Inc. or its Affiliates.
Graviton2搭載インスタンスの特徴
同一サイズのインスタンスと比較し
20%の低コスト
現行世代のインスタンスと比較し
最大40%良好なコストパフォーマンス
同じインスタンスファミリの中で最大の性能を提供
コストパフォーマンス
© 2021, Amazon Web Services, Inc. or its Affiliates.
各種ベンチマーク結果(性能向上)の⼀例
100 100 100
144
124
143
40
60
80
100
120
140
160
SPEC INT2017 ( E s t ima t e ) NG INX MEMCACHED
PE
RC
EN
TA
GE
© 2021, Amazon Web Services, Inc. or its Affiliates.
コストパフォーマンスの試算例 – C5.4xlarge 10台のGraviton化
$6,163.20
$4,930.56
$3,944.45
$2,958.34
$0.00
$1,000.00
$2,000.00
$3,000.00
$4,000.00
$5,000.00
$6,000.00
$7,000.00
C5.4xl *10 C6g.4xl *10 C6g.4xl *8 (20% Performance UP) C6g.2xl *12 (down size with reduce # ofinstsance)
Monthly Cost
20%
36% 52%
①Graviton適用 ②20% Performance Up ③ Down Size
© 2021, Amazon Web Services, Inc. or its Affiliates.
Graviton2を活⽤しているお客様
詳細はこちら: https://aws.amazon.com/ec2/graviton/
© 2021, Amazon Web Services, Inc. or its Affiliates.
さらなるコスト最適化︓購⼊オプション
秒単位 時間単位⼤幅な
ディスカウント優れた柔軟性
最⼤90%の値引き。中断あり
Gravitonインスタンスでももちろん使えます
© 2021, Amazon Web Services, Inc. or its Affiliates.
ソフトウェアエコシステム
© 2021, Amazon Web Services, Inc. or its Affiliates.
Graviton2 対応状況
o OS: ほとんどのLinuxとBSDはArm64をサポートしています
o コンパイル言語: C/C++, Golang, Rust
o スクリプト言語: Python, Ruby, PHP, Node.js, .Java, NET Core (on Linux) etc.
o オープンソースソフトウェア: Nginx, Redis, Memcached, MySQL
o EDAソフトウェア: Cadence Design Systems, Mentor
https://github.com/aws/aws-graviton-getting-started
© 2021, Amazon Web Services, Inc. or its Affiliates.
オペレーティングシステムの対応状況
Red Hat Enterprise Linux 8.2+ SLES 15 SP218.04LTS, 20.04LTSAmazon Linux 2
Debian
https://github.com/aws/aws-graviton-getting-started/blob/master/os.md
© 2021, Amazon Web Services, Inc. or its Affiliates.
各種ミドルウェア・ソフトウェアの対応状況
JenkinsGitLabGitHub Actions Travis CICircleCI
CrowdStrike Rapid7Qualys TenableSnyk
Cassandra KeyDB MariaDB Memcached MongoDB MySQL PostreSQL Redis ScyllaDB
Chef HoneycombDatadog Dynatrace TerraformNew Relic Splunk
© 2021, Amazon Web Services, Inc. or its Affiliates.
コンテナ関連の対応状況
Bottlerocket (Container OS)(github.com/bottlerocket-os)
Firecracker (MicroVMs)(github.com/firecracker-microvm)
Amazon Elastic Container Service(Amazon ECS)
Amazon Elastic Container Service for Kubernetes (Amazon EKS)
Docker Kubernetes
Amazon Elastic Container Registry(Amazon ECR)
© 2021, Amazon Web Services, Inc. or its Affiliates.
開発ツール関連の対応状況
AWS Marketplace
AWS Systems Manager
Amazon CloudWatch
Amazon Inspector
AWS Batch
AWSCodeBuild
AWS CodeCommit
AWS CodePipeline
AWS CodeDeploy
Amazon CorrettoOpenJDK
AWS Fluent BitAWS Command
Line Interface
AWS EC2 Image Builder
AWS Auto Scaling
(Mixed-arch)
AWS X-Ray
© 2021, Amazon Web Services, Inc. or its Affiliates.
AWSサービスのGraviton2対応状況
Amazon ElastiCache(Memcached, Redis)
Amazon RDS(MySQL, MariaDB, PostgreSQL)
Amazon EMR(Hadoop, Spark)
Amazon Aurora2021/3/12 GA
Amazon Elastic Container Service(Amazon ECS)
Amazon Elastic Container Service for Kubernetes (Amazon EKS)
Amazon ElasticsearchService
2021/5/4 GA
© 2021, Amazon Web Services, Inc. or its Affiliates.
Graviton2の始め⽅
© 2021, Amazon Web Services, Inc. or its Affiliates.
難易度 ワークロード Actions
ほぼ何もしなくて良い RDS, ElastiCache, ElasticSearch
最新バージョンにアップグレードしインスタンスタイプを変更
⾮常に容易 EMR概ね動作するただしJNI やPython-native モジュールに注意︕
容易 Linux + ⾼級⾔語arm64 AMI上に構築ただしJNI やPython-native モジュールに注意︕
やや⾯倒 Linux + 低級⾔語 arm64 AMI上でコードをリコンパイル
動くが書き換えが必要 Microsoft Windows + .NET
.NET coreに書き換えて, Linux/arm64上で実⾏
未対応 Microsoft Windows Microsoft Windows Server はarm64に未対応
どこから着⼿するか︖
© 2021, Amazon Web Services, Inc. or its Affiliates.
Step.1 依存関係の調査
https://docs.aws.amazon.com/whitepapers/latest/aws-graviton2-for-isv/planning-your-transition.html
© 2021, Amazon Web Services, Inc. or its Affiliates.
Step.2 対応状況・バージョンの確認
https://github.com/aws/aws-graviton-getting-started/blob/main/os.md
https://github.com/aws/aws-graviton-getting-started#recent-software-updates-relevant-to-graviton
© 2021, Amazon Web Services, Inc. or its Affiliates.
Step 3. テスト︕︕︕︕
o Arm64 AMIからGraviton2インスタンスを起動
o Graviton2インスタンスに必要なパッケージをインストールしCustom AMIを作成o CloudFormationやAnsibleで⾃動化していると簡単
o アプリケーションの動作テストo CI/CDや⾃動テスト、E2Eテストの仕組みが既にあると簡単
o アプリケーションの性能テストo Jmeterクラスタなど負荷テスト環境が既にあると簡単
© 2021, Amazon Web Services, Inc. or its Affiliates.
Sptep 4 本番環境への投⼊
o 既存のインスタンスをGraviton2インスタンスへ⼊れ替えo Blue/Green deploymento カナリアリリース
© 2021, Amazon Web Services, Inc. or its Affiliates.
注意点
Arm専⽤AMIo Graviton2インスタンスはArm⽤AMIからのみ起動可能o WindowsはArm未サポート
Arm対応Dockerイメージo Graviton2インスタンス上でのDockerコンテナは、Arm対応
Dockerイメージのみ利⽤可能。o Amazon ECRはマルチアーキテクチャコンテナイメージ対応
o https://aws.amazon.com/jp/blogs/containers/introducing-multi-architecture-container-images-for-amazon-ecr/
o CodeBuildはArmイメージのビルドに対応o https://aws.amazon.com/jp/blogs/devops/creating-multi-architecture-docker-
images-to-support-graviton2-using-aws-codebuild-and-aws-codepipeline/
© 2021, Amazon Web Services, Inc. or its Affiliates.
注意点
o バージョンo 古いバージョンのソフトウェアやパッケージはArm未対
応もしくはGraviton2最適化ができていない場合があるo 性能の最適化
o 1コアしか使⽤しないアプリケーションは、x86インスタンスより遅くなる場合がある
o C/C++は最新のGCCで、推奨オプションをつけてコンパイル
o マルチスレッドアプリケーションはLSE (Learge System Extensions)を活⽤する
o https://github.com/aws/aws-graviton-getting-started/blob/main/optimizing.md
o https://developer.arm.com/documentation/pjdoc466751330-9707/2-0
© 2021, Amazon Web Services, Inc. or its Affiliates.
まとめ
© 2021, Amazon Web Services, Inc. or its Affiliates.
o コスト最適化の選択肢としてGraviton2インスタンスをまず候補に
o パフォーマンスだけでなくコストパフォーマンスで考えましょう
o OS/⾔語/パッケージ/ライブラリの対応は⽇々進⾏中。最新情報をチェック︕
o まず使ってみましょう( 6⽉30⽇までt4g.micro 750時間/⽉ 無料)
Graviton2 まとめ
© 2021, Amazon Web Services, Inc. or its Affiliates.
AWS Gravitonプロセッサo https://aws.amazon.com/jp/ec2/graviton/
Getting started with AWS Gravitono https://github.com/aws/aws-graviton-getting-started
AWS Graviton2 for ISVo https://docs.aws.amazon.com/whitepapers/latest/aws-graviton2-for-isv/
参考情報
© 2021, Amazon Web Services, Inc. or its Affiliates.
AWSへのマイグレーションのその先に〜リフト&シフトからのクラウド最適化〜o 開催⽇︓2021 年 6 ⽉ 3 ⽇(⽊)午後 14 時〜17 時o 申込サイト︓https://pages.awscloud.com/JAPAN-event-OE-Migration-20210603-reg-event.html
告知︓AWS Compute 最適化セミナー
時間 セッションタイトル スピーカー
14:00 〜 14:30 AWS Compute サービスの全体像と我々が何を⽬指しているのか 安⽥ 俊彦 (AWS)
14:30 〜 15:00 最適な Amazon EC2インスタンスの選び⽅ 松尾 康博 (AWS)
15:10 〜 15:30 Amazon EC2 コストの最適化 滝⼝ 開資 (AWS)
15:30 〜 16:00 ネットワークの最適化 岡 豊 (AWS)、菊池 之裕 (AWS)
16:10 〜 16:30 お客様事例1 オンプレミスから AWS 移⾏によるコスト・パフォーマンス最適化戦略事例
株式会社 fluct ⻄郡 卓⽮ 様
16:30 〜 16:50 お客様事例2(調整中) (調整中)
© 2021, Amazon Web Services, Inc. or its Affiliates.
Thank You!