KLAWS on GCP

333 views

Published on

KLab で運用する AWS 環境 KLAWS を、GCP で運用することを考える

Published in: Engineering
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
333
On SlideShare
0
From Embeds
0
Number of Embeds
176
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

KLAWS on GCP

  1. 1. KLAWS on GCP KLab inc. kansei chiba
  2. 2. Profile ● Kansei Chiba / 1989 〜 ● KLab / 2011 〜 ○ Infrastructure Management Group 2 ○ Linux, AWS, Azure, GCP ... ○ php, golang, objective-c, swift ... ● Hobby ○ RoadBike / 2015 〜 ○ Diving / 2007 〜 ● FB ○ Kansei Chiba
  3. 3. KLAWS on GCP ● KLAWS = KLab で 運用する AWS なインフラ環境 ● AWS 一択な状況の打開 ● 日本リージョンの完成間近 ● AWS での運用経験を前提にした話
  4. 4. KLAWS Components ● Network ○ VPC ● VM ○ EC2 ● PaaS ○ Route53, RDS, Elasticache, S3, CloudFront, ELB ● OSS ○ apache,nginx,uwsgi,php,fluentd,rlogd,repcached,mysql...
  5. 5. Cloud ● 海外展開 ● リソース補填 ● プロトタイプ
  6. 6. Prototype ● とあるゲーム向け環境 ● リアルタイム通信を使用し、ユーザ同士が協力して敵を倒す ● サーバは、必要な時間になったら自動立ち上げ、削除
  7. 7. Prototype ● WebSocket を使用 ● LB には、ELB TCP Listener ● ゲームサーバは cron で自動立上げ
  8. 8. Devise ● ゲームサーバの自動立ち上げ ● ProxyProtocol ● リバプロ ● エラー通知
  9. 9. Devise ● ゲームサーバの自動立ち上げ ○ アプリケーションチェック ○ まずは 1 台 ○ ハズレインスタンス対応 ● ProxyProtocol ● リバプロ ● エラー通知
  10. 10. Devise ● ゲームサーバの自動立ち上げ ● ProxyProtocol ● リバプロ ● エラー通知
  11. 11. Devise ● ゲームサーバの自動立ち上げ ● ProxyProtocol ● リバプロ ● エラー通知
  12. 12. Devise ● ゲームサーバの自動立ち上げ ● ProxyProtocol ● リバプロ ● エラー通知
  13. 13. KLAWS ● そんなことを考えるのが普段のお仕事 ● あくまで KLAWS で構成された 1 環境の話で、全ての構成ではありません
  14. 14. s/AWS/GCP/ ● GCP は ロードバランサがすごい ● GCP は インスタンスの起動が速い ● GCP はお安いらしい ● GCP を使ったら彼女ができました ● GCP を使ったら身長が伸びました ● ry ● 良さげな噂ばかりが耳に届く ● s/AWS/GCP/ すると、どうなるのか考えてみる # GCP勉強会みたいになるかもしれませんがご容赦下さい...
  15. 15. KLAWS Components ● Network ○ VPC ● VM ○ EC2 ● PaaS ○ Route53, RDS, Elasticache, S3, CloudFront, ELB
  16. 16. GCP Network ● Subnet Group ● Security Group ● Route Table
  17. 17. GCP Network ● Subnet Group ● Security Group ● Route Table 10.0.0.0/24 日本リージョン・ゾーン A 10.0.1.0/24 日本リージョン・ゾーン B 10.0.0.0/24 東京リージョン 10.0.1.0/24 海外リージョン AWS GCP
  18. 18. GCP Network ● Subnet Group ● Security Group ● Route Table AWS GCP 各種リソースに対してセキュリティグループの紐付 タグに対してトラフィックの制限設定を紐付け
  19. 19. GCP Network ● Subnet Group ● Security Group ● Route Table VIP InstanceB VIP InstanceA VIP keepalived + unicast vrrp # AWS 触ってない人にはちょっとわかりにくいかも ...(__)
  20. 20. GCP Network ● Subnet Group ● Security Group ● Route Table 優先度 宛先IP 宛先インスタンス 0 10.0.0.1/32 A 1 10.0.0.1/32 B N/A 優先度 宛先IP 宛先インスタンス 2 10.0.0.1/32 A 1 10.0.0.1/32 B F/O 優先度 宛先IP 宛先インスタンス 0 10.0.0.1/32 A 1 10.0.0.1/32 B F/B
  21. 21. Network Performance ping による測定値 fromto asia-east-1 us-central us-east-1 europe-west asia-east-1 - 151.642ms 190.175ms 251.908ms us-central 151.642ms - 36.394ms 103.074ms us-east-1 190.175ms 36.394ms - 92.627ms europe-west 251.908ms 103.074ms 92.627ms -
  22. 22. Network Performance bit/sec packet/sec 9 Gbps 1040 kpps AWS ( c4.8x HVM / 拡張ネットワーキング有効 ) bit/sec packet/sec 15 Gbps 900 kpps GCP ( 32 core VM ) iperf3, 独自ツールによる計測値
  23. 23. いんたーねっと とある性能試験中な昼下がり...
  24. 24. ● 異議申し立てボタンの出現
  25. 25. We've recently detected activity on your Google Cloud Platform/APIs project ID ************** that appears to violate our Terms of Service. Please take a moment to review the Google Cloud Platform Terms of Service or the applicable Terms of Service for the specific Google API you are using. It appears that your project is committing denial of service attacks.To protect our users, we have set an outbound bandwidth rate limit on your project.
  26. 26. _人人人人人_ > 英 語 <  ̄Y^Y^Y^Y^Y ̄ # 何やら、DDoS と勘違いされたらしい ...
  27. 27. 日本語で書かれてるし、日本語で異議申し立てできるっしょ・・・
  28. 28. _人人人人人_ > 英 語 <  ̄Y^Y^Y^Y^Y ̄
  29. 29. StressTest ● ネットワークの性能試験が、DDoS として検知されることがある ● 負荷試験前に、GCP に通知しておきましょう ● やりとりは基本英語です ○ もしかすると、Gold Support 以上なら、日本語でも対応してもらえるかも ● 解除まで諸々のやり取りを含め大体、3 - 4 営業日はかかりました
  30. 30. GCP VM ● Instance Type ● Metadata ● Maintenance ● Disk
  31. 31. GCP VM ● Instance Type ● Metadata ● Maintenance ● Disk
  32. 32. GCP VM ● Instance Type ● Metadata ● Maintenance ● Disk $ curl http://169.254.169.254/latest/meta-data/
  33. 33. GCP VM ● Instance Type ● Metadata ● Maintenance ● Disk
  34. 34. GCP VM ● Instance Type ● Metadata ● Maintenance ● Disk 1TB SSD Bandwidth (512K random read) 1TB SSD IOPS (4k random write) 246MB/sec 15350 IOPS
  35. 35. GCP VM ● 内部DNSの断捨離 ● LocalSSD
  36. 36. PaaS AWS GCP Route53 CloudDNS RDS CloudSQL S3 CloudStorage Elasticache GCE で頑張りましょう CloudFront CloudCDN ELB LB (HTTP/Network)
  37. 37. PaaS AWS GCP Route53 CloudDNS RDS CloudSQL S3 CloudStorage Elasticache GCE で頑張りましょう CloudFront CloudCDN ELB LB (HTTP/Network) ● アクセス制限周り ● SSL ● 性能 etc
  38. 38. KLAWS ● s/AWS/GCP したときのざっくりした違い ● あまり時間もないので、差異の紹介はここまで ● 結局使えるのかどうか
  39. 39. KLAWS on GCP ● 複数の IaaS を実際に触って、初めて分かるメリットがある ● IaaS の差異を見ていくのは結構面白い ● GCP の今後に期待 ○ 来年の春には、ガッツリ使えるようなクオリティになっている事を期待

×