24
Confidential & Proprietary Google Cloud Platform 1 Proprietary + Confidential Google Cloud Platform ネットワークとロードバランシング 九州インフラ交流勉強会 (Kixs) Vol.003 Google Cloud, Customer Engineer, Masanori Satoh Google Cloud, カスタマーエンジニア, 佐藤聖規 February 10, 2017

Google Cloud のネットワークとロードバランサ

Embed Size (px)

Citation preview

Confidential & ProprietaryGoogle Cloud Platform 1

Proprietary + Confidential

Google Cloud Platformネットワークとロードバランシング

〜 九州インフラ交流勉強会(Kixs) Vol.003 〜

Google Cloud, Customer Engineer, Masanori SatohGoogle Cloud, カスタマーエンジニア, 佐藤聖規February 10, 2017

Confidential & ProprietaryGoogle Cloud Platform 2

佐藤聖規 (Satoh, Masanori)カスタマーエンジニア・Google Cloudのソリューションのご提案

・お客様プロジェクトへのアーキテクチャ・プロダクトの

技術的なご支援

・DevOps (CI/CD、開発ツール、プラクティス)、Java 関連

Confidential & ProprietaryGoogle Cloud Platform 3

Cloud Platform is built on the same infrastructure that powers Google.

Confidential & ProprietaryGoogle Cloud Platform 4

Confidential & ProprietaryGoogle Cloud Platform 5

世界を駆け巡るGoogle バックボーンネットワーク

Building what’s next 6

FASTER US - Japan - Taiwan

Google Cloud ネットワーク

現在のリージョンとゾーン数

POP

ネットワーク経路

2017年にローンチ予定のリージョンとゾーン数

#

# https://peering.google.comhttps://cloud.google.com/compute/docs/regions-zones/regions-zones

2

3

シンガポール2

サウスカロライナ

バージニア北部

ベルギー

ロンドン

東京

台湾ムンバイ

シドニー

オレゴンアイオワ

フランクフルト

サンパウロ

フィンランド

3

3

33

3

3

2

43

3

3

Cloud Virtual Network

● 複数リージョンで単一のネットワーク

 -> トラフィックはGoogle のバックボーンを通過

US

192.168.0.0/16

192.168.0.0/24

JP

192.168.1.0/24

● サブネット、VPN、ダイレクトピアリング構成も可能

Confidential & ProprietaryGoogle Cloud Platform 9

ロードバランサー

● Google基盤の上に作られたスケーラビリティと堅牢性を備えたサービス● 大きくわけて 2 種類のロードバランサーを提供

● HTTP (S) ロードバランサー● TCP / UDP ネットワークロードバランサー

Confidential & ProprietaryGoogle Cloud Platform 10

HTTPロードバランサー

● HTTP/HTTPSリクエストをコントロール● ポート80/8080/443

● HTTPS (SSL) オフロード対応● シングルIP● 外部IPアドレス● コンテンツベースのルーティング

● URIを見てバックエンドの振り分けプールを判断する

● ヘルスチェックメカニズム● 事前ウォーミングの必要なし

Confidential & ProprietaryGoogle Cloud Platform 11

HTTPロードバランサー:負荷分散アルゴリズム

● インスタンスの負荷ベース● CPU 使用率● 秒間リクエスト数 (RPS)

● マルチリージョンで構成した場合はユーザに一番近いリージョンに転送される● セッションアフィニティを設定可能

Confidential & ProprietaryGoogle Cloud Platform 12

HTTPロードバランサーの使用例

リージョン跨ぎの負荷分散 コンテンツベースルーティング

Confidential & ProprietaryGoogle Cloud Platform 13

リージョン跨ぎの負荷分散

HTTP(S) ロードバランサー リージョンまたぎ負荷分散

1IPを最も近いリージョンのインスタンスグループに分散

Confidential & ProprietaryGoogle Cloud Platform 14

HTTPロードバランサー:リージョン跨ぎの負荷分散

Confidential & ProprietaryGoogle Cloud Platform 15

HTTPロードバランサー:コンテンツベースルーティング

Confidential & ProprietaryGoogle Cloud Platform 16

バックエンドサービス

● バックエンドサービスは、1つもしくは複数のインスタンスグループで構成● CPU使用率か、秒間リクエスト数(RPS) により負荷が分散される。● 各バックエンドに対して、ヘルスチェックが行われる。● インスタンスをインスタンスグループに追加することで、バックエンドサービスとし

てアサインできる。● インスタンスを直接バックエンドサービスに追加することはできない。

Confidential & ProprietaryGoogle Cloud Platform 17

秒間100万のリクエストに対応

Compute Engine Load Balancing hits 1 million requests per second!

64インスタンスで負荷を生成

200インスタンスでWebサーバを提供

ロードバランサーの IPアドレスは一つだけ

Confidential & ProprietaryGoogle Cloud Platform 18

従来型ロードバランサー

region 2 region 3region 1

従来型Load Balancer と Google HTTP (S) Load Balancerの違い

VMs VMs VMs

... ... ...LB(s)

DNS LB

Google Cloud Platform のロードバランサー

region 2 region 3region 1

VMs VMs VMs

:::::::::::::::::::::::::::::::::::::::::::::::HTTP LB

DNS :)

VMベースのロードバランサ: 静的IP無し、遅いスケール、DNSに依存 (TTLの影響を受けるなど)、障害検知も遅い

Google HTTP (S) Load Balancer: 1つの Global IP アドレス、最短のホップ、 ウォーミングなしで拡張可能、DNS依存なし、障害検知

X

X

X

X

X

X

X

X

X

X

1つのglobal IP: 11.22.33.44

Confidential & ProprietaryGoogle Cloud Platform 19

TCP / UDP ネットワークロードバランサー

● TCP/UDP (L4) パケットが対象● バックエンドは、同一リージョン内のみ

● TCP proxyとして動作、リージョンをまたいだInstanceへ負荷分散 (Alpha)● バックエンドのヘルスチェックはHTTP● 事前ウォームアップの必要なし

Confidential & ProprietaryGoogle Cloud Platform 20

負荷分散のアルゴリズム

● ハッシュベース● ソースIP/ポートおよび宛先IP/ポートのハッシュを計算して宛先を決定

● 新しいコネクションは、別のインスタンスに分散される● コネクションがクローズするまで、すべてのパケットは同じインスタンスに転送され

る● セッションアフィニティを設定可能 (クライアントIPアドレス、クライアントIP + プロト

コル)

Confidential & ProprietaryGoogle Cloud Platform 21

TCP / UDP ネットワークロードバランサー

ターゲットプール

ヘルスチェック

転送ルール

インスタンス

Confidential & ProprietaryGoogle Cloud Platform 22

Container Engine

DataStore

Load balancing

Pokémon GOとGCP

Confidential & ProprietaryGoogle Cloud Platform 23

Resarch at GoogleMaglev: A Fast and Reliable Software Network Load Balancer

Googleを支えるテクノロジーシリーズ

第1回 分散型ロードバランサーを実現するMaglev(パート1) (中井悦司) 第2回 分散型ロードバランサーを実現するMaglev(パート2) (中井悦司)

こちらもご覧ください

Thank you

福岡の皆様向けのイベント企画中!

Coming Soon!