Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:Invent
1 Million Bids in 100ms—Using AWS
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
このセッションへの期待
• Real-Time Bidding (RTB) on AWS の紹介...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
従来のRTBのデータフロー
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
なぜ RTB on AWS?
• イノベーション:最先端のネットワーキングとコンピューティング機...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beeswax̶about us
Ari Paparo
CEO
Ram Rengaswamy
C...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beeswax Programmatic Cloud
Out of the Box DSP Fu...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beeswax system architecture
Campaign management
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Performance̶ingestion & speed
Load balancing
Net...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Traffic ingestion
Image from: http://www.autogui...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Network optimization̶load balancers
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
NLBによるRTBアプリケーションの負荷分散
• 低レイテンシ - HTTPパースせずパケットを...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Elastic Network Adapter (ENA)
• ハードウェアにチェックサムをオフ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Check to see if ENA is enabled
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Network optimization̶NLB + ENA
• Active connecti...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Active connections: ~2M
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• New connections per min: ~2M
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Bandwidth: ~120GB/min
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Test it yourself̶Bees with Machine Guns
(マシンガンを持...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Low-latency NoSQL data store
Photo: greens.org.au
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DynamoDB Accelerator (DAX)
主な利点
• リードのパフォ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aerospike
• ⾮常に⾼い性能のKVS(リードレイテンシ<2ms)
• 各ENIは最⼤2...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scale̶globalization and
regionalization
AWS glob...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS global infrastructure
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Building with pods
US-east-1
Availability	zone
A...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hive ̶ Pods間でのデプロイ⽅法
• Hiveはbeeswaxのシステム管理ツールです
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グローバルDNSサービスを活⽤
• Geographic Routing
• DNSを使⽤してす...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セキュアなグローバルネットワークを簡単に導⼊
• 配置されたリージョン間のステートの同期
• 予...
異なるリージョンのVPCを接続する
インターリージョンVPCピアリングを発表
• 同⼀リージョン間に限定されていたVPCピアリ
ングが別リージョンのVPC間でも設定可能に
• リージョン間の通信にはAWSが管理する回線を
利⽤する。パブリックイ...
Amazon DynamoDBで
グローバルテーブル機能を発表
• 複数のリージョンにまたがるマルチマスターの
グローバルテーブルを作成できるようになった
• 書き込まれたデータは結果整合性で各リージョ
ンに展開される。従って、同⼀データが別の...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cost̶operations and spot market
Auto Scale group...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
複数リージョンに渡るトラフィックパターン
US
EU
APAC
AUS
LATAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
経済的なダイナミックインフラストラクチャー
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto Scaling group
Auto Scaling group
Collect me...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beeswax̶Auto Scale based on QPS
• ベストプラクティス:CPUし...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スポットインスタンスの詳細
オプション
• インスタンスの可⽤性を維持するた
めのスポットフリー...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Waterfall Auto Scaling Group
• スポット価格を市場よりも⼤きく、オ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
aws autoscaling create-auto-scaling-group --auto...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
aws autoscaling create-auto-scaling-group --auto...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
なるべくスポットインスタンスを使うように
スケールインスケールアウトさせる
0%
20%
40%...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
なるべくスポットインスタンスを使うように
スケールインスケールアウトさせる
0%
20%
40%...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beeswax̶sweet ʻspotʼ for RTB
ベストプラクティス:⼊札者を完全にステ...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data̶data lake, analytics & insights
Data lakes
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data lake
Photo: cherezoff/Shutterstock
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Central storage
Secure, cost-effective
storage i...
Amazon	S3	Selectと
Amazon	Glacier	Selectを発表
• S3 Select(プレビュー):ファイル全体をダウン
ロードせず必要なデータのみをシンプルなSQL
でクエリ可能に。最⼤400%の性能改善
– Lamb...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
なぜ S3?
スケーラブルで丈夫
•事実上無制限のオブジェクトの数
•⾮常に⾼い帯域幅 - 総ス...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3 のストレージクラスの選択
Standard
Active data Archive dat...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
シナリオ
• 広告データがあります
• 私はそのデータを豊かにしたい
• 私はそのデータに対して...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Analytics
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beeswax data flow
Streaming
collectors
Streaming...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
キャンペーンパフォーマンスのクエリと分析
パフォーマンスレポーティングキャンペーンマネージメント...
トラフィックの実⽤的なインサイトを得る
● Kinesisへのクエリのサンプル1%
● S3データレイクに格納
● 任意の宛先へのストリーミング(パ
ートナーサービス利⽤可)
● 在庫の発⾒に役⽴つ
● ビジネス推進に役⽴つインサイト:
○ 使...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RTB on AWS がもたらすものは?
REQUESTS PER SECOND
ONE MII...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
Upcoming SlideShare
Loading in …5
×

ATC301 AWS re:Invent 2017/11/27 - 1 Million Bids in 100ms - Using AWS to Power Your Real-time Bidder 翻訳

272 views

Published on

Atc301 dame 1 million bids in 100ms - using aws to power your real time bidder

Published in: Technology
  • Be the first to comment

  • Be the first to like this

ATC301 AWS re:Invent 2017/11/27 - 1 Million Bids in 100ms - Using AWS to Power Your Real-time Bidder 翻訳

  1. 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:Invent 1 Million Bids in 100ms—Using AWS to Power Your Real-time Bidder R a m K u m a r R e n g a s w a m y , C o - f o u n d e r a n d C T O , B e e s w a x E r i c k D a m e , S o l u t i o n s A r c h i t e c t , A W S •A T C 3 0 1 •N o v e m b e r 2 7 , 2 0 1 7
  2. 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. このセッションへの期待 • Real-Time Bidding (RTB) on AWS の紹介 • Beeswax の紹介 • 主な考慮事項 • パフォーマンス ̶ ingestion and speed • スケール ̶ globalization and regionalization • コスト ̶ operations and spot market • データ ̶ data lake, analytics, and insights
  3. 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 従来のRTBのデータフロー
  4. 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. なぜ RTB on AWS? • イノベーション:最先端のネットワーキングとコンピューティング機能 (Network Load Balancer、High IO インスタンス) •パフォーマンスリーダーシップとユニークなec2スポット市場での価格 •より⼤きな中国とインドを含む世界的なビジネス展開 •低レイテンシのデータ処理とキャッシングの幅広いテクノロジーの選択肢 •⼤規模かつ急速に成⻑しているパブリッシャーとブランドのエコシステム
  5. 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beeswax̶about us Ari Paparo CEO Ram Rengaswamy CTO Shamim Samadi CPO GLOBAL OFFICES CUSTOMERS FOUNDERSINVESTORS Angel Investors from: NEW YORK LONDON SAN FRANCISCO (coming soon) FreeWheel AOL Admeld Google Adelphic Right Media MOAT Maxifier DoubleClick MediaMath LiveRamp MoPub Twitter Millennial Quigo Yieldmo
  6. 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beeswax Programmatic Cloud Out of the Box DSP Functionality: Full DSP functionality on Day 1 Partner through robust integrations: Combine and customize Programmatic Cloud partners to design a custom bidder Build through Extensible APIs: Build a truly bespoke bidder on top of our REST APIs Header Bidding Functionality Data Visualization Dynamic Creative Optimization Fully managed RTB platform on
  7. 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beeswax system architecture Campaign management Serving Userdata management Reporting analytics
  8. 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Performance̶ingestion & speed Load balancing Network optimization Low-latency data store
  9. 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Traffic ingestion Image from: http://www.autoguide.com/
  10. 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Network optimization̶load balancers
  11. 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. NLBによるRTBアプリケーションの負荷分散 • 低レイテンシ - HTTPパースせずパケットを直接バックエンドにルーティング • トラフィックスパイクに強い - 突発的な負荷に対して低レイテンシを維持しながら秒間数 百万リクエストを処理 • 固定IPアドレス - より安定する。DNSはTTLを無視して様々な場所にキャッシュされる ExchangeからのHTTP/S 経由のBidリクエスト バックエンドインスタンス プールに負荷を均等に分散
  12. 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Elastic Network Adapter (ENA) • ハードウェアにチェックサムをオフロードする • ネットワークデバイスへの複数のRx / Txキュー(8つ) • ハードウェアで受信側ステアリング(Receive Side Steering:RSS)をサ ポート • CPUsにIRQ負荷を分散する
  13. 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Check to see if ENA is enabled
  14. 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Network optimization̶NLB + ENA • Active connections: ~2M • New connections per min: ~2M • Bandwidth: ~120GB/min
  15. 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Active connections: ~2M
  16. 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • New connections per min: ~2M
  17. 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Bandwidth: ~120GB/min
  18. 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Test it yourself̶Bees with Machine Guns (マシンガンを持った蜂) https://github.com/newsapps/beeswithmachineguns 10 million requests 1 million at a time
  19. 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Low-latency NoSQL data store Photo: greens.org.au
  20. 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon DynamoDB Accelerator (DAX) 主な利点 • リードのパフォーマンスとスケール:単⼀DAXクラスタから数百 万回のread/sでマイクロ秒の応答時間 • 低コスト:ホットデータを持つテーブルのDynamoDBテーブルの プロビジョニングされた読み取り容量を減らす Features • フルマネージドサービス、ハイアベイラビリティ • DynamoDB APIとの互換性 • Write-through • 1つまたは複数のテーブルに対する柔軟な使⽤ • 最⼤10個の読取りレプリカをスケールアウトします • 完全に統合されたAWSサービス • セキュア
  21. 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aerospike • ⾮常に⾼い性能のKVS(リードレイテンシ<2ms) • 各ENIは最⼤250K ppsを処理できます • 複数のENIを使⽤してインスタンスごとのパケットを増やす • client、fablic、XDRなどのAerospikeの通信⽤途ごとに別のENIを使⽤する • ENAを使⽤しコア間で割り込みを分配する • Placement groups • 帯域幅を最⼤化し、クラスタ内のノード間のレイテンシを最⼩限に抑える • NVMe SSD - はるかに低コストで⾮常に⾼いパフォーマンス
  22. 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Scale̶globalization and regionalization AWS global infrastructure Building in pods
  23. 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS global infrastructure
  24. 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  25. 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Building with pods US-east-1 Availability zone ASG ASG Elastic Load Balancing Availability zone ASG ASG US-west-1 Availability zone ASG ASG Elastic Load Balancing Availability zone ASG ASG EU-west-1 Availability zone ASG ASG Elastic Load Balancing Availability zone ASG ASG
  26. 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hive ̶ Pods間でのデプロイ⽅法 • Hiveはbeeswaxのシステム管理ツールです • オートスケール/ ECSなどの実装の詳細を抽象化します • リソースの作成、デプロイなどの⼀般的なタスクをサポートします • Pythonで書かれ、boto3 apiで構築されています • アクセス制御にIAMを活⽤しています • ローカルにAWS CloudFormationテンプレートをセットアップし、グロー バルに複製する • Examples: • hive <service_name> is --region <region_name> • hive <service_name> deploy --region <region_name>
  27. 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グローバルDNSサービスを活⽤ • Geographic Routing • DNSを使⽤してすべての操作を⼤陸にローカライズする • EU規制(GDPR)への対応を簡素化 • Latency Routing • DNSを使⽤してユーザーへの最短パスでルーティング • Traffic Flows • 複雑なルーティングシナリオの設定を簡素化 • 例えば、ユーザを⼤陸に閉じ込め、ユーザへの最速ルートを⾒つける ※ GDPR(General Data Protection Regulation):EU一般データ保護規制、2018年5月25日より施行予定 ※「AWSへのGDPRコンプライアンスのナビゲート」ホワイトペーパー https://aws.amazon.com/jp/blogs/security/introducing-the-new-gdpr-center-and-navigating-gdpr-compliance-on-aws-whitepaper/
  28. 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. セキュアなグローバルネットワークを簡単に導⼊ • 配置されたリージョン間のステートの同期 • 予算、コンバージョン、Cookieのマッチング • AerospikeのXDR(cross(X)DatacenterReplication) を 使⽤して同期する • AWSソリューションに基づくVPCのトランジット • ⾼可⽤でセキュアなIPsecトンネル • ENAを使⽤してEC2上の Cisco CSR(CloudServiceRouter) • 任意のVPC内の任意の2つのノード間のルート us-east-1us-west-2 eu-west-1
  29. 29. 異なるリージョンのVPCを接続する インターリージョンVPCピアリングを発表 • 同⼀リージョン間に限定されていたVPCピアリ ングが別リージョンのVPC間でも設定可能に • リージョン間の通信にはAWSが管理する回線を 利⽤する。パブリックインターネットに迂回す ることはない • 通信路はデフォルトで暗号化が適⽤される • バージニア、オレゴン、オハイオ、アイルラン ドで先⾏利⽤可能に。他リージョンは順次展開
  30. 30. Amazon DynamoDBで グローバルテーブル機能を発表 • 複数のリージョンにまたがるマルチマスターの グローバルテーブルを作成できるようになった • 書き込まれたデータは結果整合性で各リージョ ンに展開される。従って、同⼀データが別のリ ージョンで更新された場合は後勝ちとなる • テーブル名やハッシュキーは全リージョンで同 ⼀の設定にする必要がある。また、既存テーブ ルのグローバル化は現時点では未対応 • バージニア、オハイオ、アイルランド、フラン クフルトで利⽤可能。他は2018年を予定
  31. 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Cost̶operations and spot market Auto Scale groups Running lean Running efficient
  32. 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 複数リージョンに渡るトラフィックパターン US EU APAC AUS LATAM
  33. 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 経済的なダイナミックインフラストラクチャー
  34. 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Auto Scaling group Auto Scaling group Collect metrics Alarm fires when threshold is crossed Auto Scaling Scaling event is triggered Elastic Load Balancing
  35. 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beeswax̶Auto Scale based on QPS • ベストプラクティス:CPUしきい値でCloudWatch Alarmを使⽤してスケール アップ/ダウン • オートスケーリングのスケジュール機能を使い、指定した時間での⾃動アクシ ョンを使⽤し、毎⽇の⽇の出前にPre-Warm (必要台数起動)します。 • 全ての必要なライブラリを含むAMIを作っておくことでで起動時間を最適化す る
  36. 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. スポットインスタンスの詳細 オプション • インスタンスの可⽤性を維持するた めのスポットフリート • 継続的に稼働しなければならない作 業時間確保のスポットブロック(1〜 6時間) コミットメントレベル • なし *特定のEC2インスタンスタイプ、地域、および利用可能なゾーンに基づくオンデマンド価格と比較
  37. 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Waterfall Auto Scaling Group • スポット価格を市場よりも⼤きく、オ ンデマンドより⼩さく設定する • ⼊札時に常に市場レートを提供し ます • グループをオンデマンドインスタンス のグループとスポットインスタンスの グループに分ける • スポットグループ内のスポットインス タンスの数に関するcloudwatchアラ ーム • GroupInServiceInstances • スポットグループ内のスポットインス タンスの数がしきい値を下回った場合 にオンデマンドグループのインスタン ス数を調整する Network Load Balancing Availability zone #1 Availability zone #2 On-demand Auto Scaling group Spot Auto Scaling group
  38. 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. aws autoscaling create-auto-scaling-group --auto-scaling-group-name on-demand-asg --launch-configuration-name my-lc -- availability-zones "us-east-1a" "us-east-1b" --load-balancer-names "my-nlb" --max-size 5 --min-size 1 --desired- capacity 2 aws cloudwatch put-metric-alarm --alarm-name AddCapacity --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 120 --threshold 80 --comparison-operator GreaterThanOrEqualToThreshold --dimensions "Name=AutoScalingGroupName,Value=on-demand-asg" --evaluation-periods 2 --alarm-actions PolicyARN ## this will add servers to the on-demand-asg group when CPU threshold is at 80% aws cloudwatch put-metric-alarm --alarm-name RemoveCapacity --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 120 --threshold 40 --comparison-operator LessThanOrEqualToThreshold --dimensions "Name=AutoScalingGroupName,Value=on-demand-asg" --evaluation-periods 2 --alarm-actions PolicyARN ## this will remove servers from the on-demand-asg group when CPU threshold is at 40% Waterfall ASG̶on-demand config
  39. 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. aws autoscaling create-auto-scaling-group --auto-scaling-group-name spot-asg --launch-configuration-name my-lc -- availability-zones "us-east-1a" "us-east-1b" --load-balancer-names "my-nlb" --max-size 5 --min-size 1 --desired- capacity 2 aws cloudwatch put-metric-alarm --alarm-name AddCapacity --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 120 --threshold 50 --comparison-operator GreaterThanOrEqualToThreshold --dimensions "Name=AutoScalingGroupName,Value=spot-asg" --evaluation-periods 2 --alarm-actions PolicyARN ## this will add servers to the spot-asg group when CPU threshold is at 50% aws cloudwatch put-metric-alarm --alarm-name RemoveCapacity --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 120 --threshold 20 --comparison-operator LessThanOrEqualToThreshold --dimensions "Name=AutoScalingGroupName,Value=spot-asg" --evaluation-periods 2 --alarm-actions PolicyARN ## this will remove servers from the spot-asg group when CPU threshold is at 20% Waterfall ASG̶spot config
  40. 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. なるべくスポットインスタンスを使うように スケールインスケールアウトさせる 0% 20% 40% 60% 80% 100% 平均 CPU 使⽤率 オンデマンドインスタンス追加 スポットインスタンス追加 • 例えばCPU負荷が60%の時はスポットインスタンス追 加のアクションが実⾏される • もしスポットが起動できなかった場合、負荷が上がり 続け、80%を超えたらオンデマンドインスタンスを起 動する • なるべくスポットインスタンスを利⽤するようなスケ ールアウトポリシー しきい値 50%以上:スポット追加 80%以上:オンデマンド追加
  41. 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. なるべくスポットインスタンスを使うように スケールインスケールアウトさせる 0% 20% 40% 60% 80% 100% 平均 CPU 使⽤率 オンデマンドインスタンス削除 スポットインスタンス削除 • 例えばCPU負荷が30%の時はオンデマンドインスタン スを削除アクションが実⾏される • さらに負荷がさがった場合にスポットインスタンスの 削除を⾏う • なるべくスポットインスタンスを利⽤するようなスケ ールインポリシー ※スポットインスタンスは急に停⽌する可能性がある のでそれを考慮した最⼩台数を設定する しきい値 40%以下:オンデマンド停⽌ 20%以下:スポット停⽌
  42. 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beeswax̶sweet ʻspotʼ for RTB ベストプラクティス:⼊札者を完全にステートレスにする • S3/EFSなどのスケーラブルで永続的なデータストアに利⽤し、起動時そこからインメ モリにステートを読み込む •すべての操作をKinesisなどのスケーラブルで永続的なデータストアに記録する •⾼性能広告ターゲティングでは、すべてのキャンペーンの状態をメモリに保存する必要 があります •永続化ストレージを使っているので、スポットインスタンスが終了しても、データ損失 はありません ベストプラクティス:bidderの起動時間を最⼩限に抑える •スポットのリスクは、市場の需要が増加するとキャパシティを失う •オンデマンドのキャパシティを素早く起動することでリスクを軽減する •全てのライブラリのインストールと設定をAMIに固める
  43. 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data̶data lake, analytics & insights Data lakes Analytics & insights
  44. 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data lake Photo: cherezoff/Shutterstock
  45. 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Central storage Secure, cost-effective storage in Amazon S3 Amazon S3 Catalog & search Access & search metadata DynamoDB Amazon ES Amazon Athena Amazon EMR Amazon Redshift Processing & Analytics Use predictive and prescriptive analytics to gain better understanding Amazon Kinesis FirehoseAWS Direct Connect AWS Snowball AWS DMS Data ingestion Get your data into Amazon S3 quickly and securely Data lake & AWS services AWS Glue
  46. 46. Amazon S3 Selectと Amazon Glacier Selectを発表 • S3 Select(プレビュー):ファイル全体をダウン ロードせず必要なデータのみをシンプルなSQL でクエリ可能に。最⼤400%の性能改善 – Lambdaファンクションから利⽤すると便利。Athenaや Redshift/EMRがS3 Selectをサポート予定 – プレビュー期間は無料で利⽤でき⾮圧縮のCSV/JSONをサポート。 暗号化ファイルは現時点では⾮対応 • Glacier Select(⼀般利⽤開始):Glacierにアーカ イブされたデータにもS3 Selectと同様に直接ク エリを発⾏可能に。AWS Glueとの連携も – スキャンしたデータ量(GB)、応答データ量(GB)、リクエスト数に で課⾦。データ取り出しスピードによって単価が異なる
  47. 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. なぜ S3? スケーラブルで丈夫 •事実上無制限のオブジェクトの数 •⾮常に⾼い帯域幅 - 総スループット制限なし •3つのAZにオブジェクトを複製して保存 コスト効率化 •ストレージ⽤のEC2を実⾏する必要はありません(HDFSとは異なります) •⼀時的なHadoopクラスタとEC2のスポット・インスタンスを実⾏できます •ライフサイクルポリシーによる階層型ストレージ(Standard、IA、Glacier) 柔軟なアクセス •ビッグデータフレームワークによる直接アクセス(Spark, Hive, Presto) •共有アクセス:複数の(Spark, Hive, Presto)クラスタは同じデータを使⽤できます
  48. 48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. S3 のストレージクラスの選択 Standard Active data Archive dataInfrequently accessed data Standard̶infrequent access Amazon Glacier
  49. 49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. シナリオ • 広告データがあります • 私はそのデータを豊かにしたい • 私はそのデータに対して複雑なクエリを実⾏したい • もしかしたら、そのデータセットを他の開発者やデータサイエン ティストに与えたい • 私はトレンドを理解し⼊札決定のロジックを更新する必要があり ます • 私の機械学習モデルはこのデータに適⽤できるはず
  50. 50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Analytics
  51. 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beeswax data flow Streaming collectors Streaming message hub Streaming delivery Data lake Customer API ETL joins and aggregations Optimization and analysis Query
  52. 52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. キャンペーンパフォーマンスのクエリと分析 パフォーマンスレポーティングキャンペーンマネージメント • Pull reports into your dashboard • Automate creation of line items, campaigns, and creatives Rest API for automation • Native support of multiaccount access control • Granular roles and permissions • Activity logs for tracking Roles, permissions, & accounts
  53. 53. トラフィックの実⽤的なインサイトを得る ● Kinesisへのクエリのサンプル1% ● S3データレイクに格納 ● 任意の宛先へのストリーミング(パ ートナーサービス利⽤可) ● 在庫の発⾒に役⽴つ ● ビジネス推進に役⽴つインサイト: ○ 使⽤しない広告サイズはありますか? ○ ⼗分なモバイルリクエストを受け取ってい ますか?
  54. 54. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RTB on AWS がもたらすものは? REQUESTS PER SECOND ONE MIIIIIIIILLION Photo: memegenerator.net
  55. 55. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!

×
Save this presentationTap To Close