【レポート】 Performing chaos engineering in a serverless world #CMY301 #reinvent

2019.12.04

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

こんにちは。AWS事業本部のKyoです。

AWS re:Invent 2019のセッション「Performing chaos engineering in a serverless world」についてレポートします。

登壇者

Gunnar Grosch - Evangelist and Co-founder, Opsio

概要

The principles of chaos engineering have been battle-tested for years using traditional infrastructure and containerized microservices. But how do they work with serverless functions and managed services? In this session, we cover the motivations behind chaos engineering, how we perform chaos experiments, and what some of the common weaknesses are that we can test for in our serverless applications. We also run some actual experiments in a serverless AWS environment. Join us as we move from talking about principles to performing real chaos-engineering experiments for serverless.

コンテンツ

What is Chaos engineering

  • 物を壊すことではない
  • プロダクションのみ適応するものではない
  • 巨大なストリーミングカンパニーのためのものではない (Netfrixのことですね)
  • 制御された障害の注入を実行する
  • システムの弱点を見つけ、壊れる前にそれを修正する
  • あなたの組織とシステムに自信をつける

Motivations behind chaos engineering

  • 顧客は彼らがすべき経験を得ている?
  • モニタリングとアラートに自信ある?
  • 組織は停止を処理する準備ができている?
  • インシデントから学ぶ?
  • "Everything fails, all the time!" (Werver Vogles CTO, Amazon)
  • システムに障害が起こった時に、「何が起こった!?」と聞かないで

Runnning chaos experiments

Step1: 定常状態を知る

  • トラディショナルなメトリクス
  • ビジネス面のメトリクス

Step2: 仮説を立てる

  • 見つけたものを使う
  • カオスはあらゆるレイヤーに障害を注入する
  • 科学的なif..thenメソッドを利用する
  • まず知っている問題を解決する

Step3: 実験の計画と実行

  • ホワイトボード実験
  • 影響範囲を確認
  • 組織に事前告知
  • 「ストップボタン」を用意する

Step4: 測定と学び

  • メトリクスを使った仮説の検証
  • システムはresilientだったか
  • 想定外のことは起こったか
  • プロセスと成功の共有

Step5: スケールアップまたは中止して修正

  • 学びを向上に使う
  • 自身と共にスケールアップ
  • スコープを広げ新たな効果を明らかにする

Challenges with serverless

  • 管理するサーバがない
  • より少ない重荷
  • 選ぶべき多くのサービス
  • 機能およびサービスごとの構成
  • より粒状のアーキテクチャ

Chaos engineering is perfect fit for serverless

サーバレスの一般的な弱点

  • エラーハンドリング
  • タイムアウト値
  • イベント
  • フォールバック
  • フェイルオーバー

serverless chaos experiment

コードへの障害

  • 下流のサービスを取り除く
  • 関数の並行性の変化

セキュリティポリシーエラー

  • CORSのコンフィグのエラー
  • サービスのコンフィグのエラー
  • ディスク容量の障害

レイテンシ

  • コールドスタート
  • クラウドプロバイダの問題
  • ランタイムやコードの問題
  • インテグレーションの問題
  • タイムアウト

DEMO

おわりに

定常状態を知り、仮説を立てて、実験を行う、これらのプロセスは実験科学と共通であると感じました。

今回のデモ環境については以下から色々と試せるようです。

Serverless Chaos Demo site

以上、何かのお役に立てれば幸いです。