Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AWS Lambda Provisioned Concurrency Dive Deep & Practice

kensh
July 01, 2020

AWS Lambda Provisioned Concurrency Dive Deep & Practice

動画はこちら
https://youtu.be/bEToYzUAYYQ?t=2583

AWS Lambdaはそれ自身がスケーラブルでフルマネージドなサービスですが、ある一部のユースケースではコールドスタートをケアするのが大変となる場面もありました。しかし、2019 re:Inventで発表されたProvisioned Concurrencyが登場して以来、AWS Lambdaがこれまで以上に多くのユースケースで利用できるようになりました。このセッションでは、Provisioned Concurrencyの仕組みやユースケース、Tips、デザインパターンなど様々な話題を提供しています。

kensh

July 01, 2020
Tweet

More Decks by kensh

Other Decks in Technology

Transcript

  1. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 1st July 2020 Kensuke Shimokawa AWS Lambda Provisioned Concurrency Dive Deep & Practice @_kensh
  2. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Who am I? Name Kensuke Shimokawa Company Amazon Web Services Japan K.K. Role Serverless Specialist Solutions Architect @_kensh
  3. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Table of contents • Day1 24th June • How to manage throttling • Day2 1st July • Provisioned Concurrency Dive Deep & Practice
  4. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambda Provisioned Concurrency の基本
  5. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのインスタンスライフサイクル Cold Start コンテナ 生成 パッケージ ロード パッケージ 展開 ランタイム ・ 起動初期化 関数 ・ メソッド起動 デプロイ Warm Start https://d1.awsstatic.com/whitepapers/Overview-AWS-Lambda-Security.pdf
  6. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Concurrency model 初期化処理 Cold Start Warm Start ハンドラー処理 ② ① ③
  7. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Warm Start 事前暖機 Warm Start 初期化処理 ハンドラー処理
  8. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Metrics Metrics 説明 ProvisionedConcurrencyInvocations プロビジョニングされた同時実行で関数コードが実行さ れる回数 ProvisionedConcurrencySpilloverInvocations プロビジョニングされたすべての同時実行が使用されて いるときに、標準同時実行で関数コードが実行される回 数。 ProvisionedConcurrentExecutions プロビジョニングされた同時実行でイベントを処理して いる関数インスタンスの数。プロビジョニングされた同 時実行数を割り当てたエイリアスまたはバージョンの呼 び出しごとに、Lambda は現在のカウントを出力します。 ProvisionedConcurrencyUtilization バージョンまたはエイリアスの場合、 ProvisionedConcurrentExecutions の値を、割り当て済み のプロビジョニングされた同時実行の合計量で割った値。 たとえば、.5 は、割り当て済みのプロビジョニングされ た同時実行数の 50% が使用中であることを示します。 https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html
  9. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Concurrency time = 1.0 = 100% ProvisionedConcurrencyUtilization Provisioned Concurrency = 0.5 = 50%
  10. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Concurrency time Provisioned Concurrency ProvisionedConcurrencyUtilization = 1.0 = 100%
  11. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Concurrency time Provisioned Concurrency SpillOver = 溢れ出た部分 = On Demand ProvisionedConcurrencyUtilization = 1.0 = 100%
  12. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Concurrency time Provisioned Concurrency SpillOver => ColdStart ProvisionedConcurrencyUtilization = 1.0 = 100% SpillOver => WarmStart ※Lambdaインスタンスが回収されず 再利用された場合
  13. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Concurrency time Provisioned Concurrency SpillOver => ColdStart ProvisionedConcurrencyUtilization = 1.0 = 100% SpillOver = On Demand => WarmStart => ColdStart
  14. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース
  15. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース (Note) Provisioned Concurrencyのユースケースをこれから紹介しますが、Lambdaは、 Provisioned Concurrencyを利用しなくても、スケーラブルなフルマネージド サービスです。 まずは、シンプルさを大事にし、通常のLambdaのスケーラビリティでPoCして みることから始めてください。
  16. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース • 予想できるスパイクへの対処 • Cold Startの抑制 • AWS Lambdaのバースト制限抑制
  17. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース • 予想できるスパイクへの対処 • Cold Startの抑制 • AWS Lambdaのバースト制限抑制
  18. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 予想できるスパイクへの対処 Concurrency time Provisioned Concurrency SpillOver
  19. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 予想できるスパイクへの対処 Concurrency time Provisioned Concurrency SpillOver 11:45 12:00 12:15 ProvisionedConcurrencyUtilization = 1.0 = 100%
  20. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 予想できるスパイクへの対処 Concurrency time Provisioned Concurrency 11:45 12:00 12:15 Amazon EventBridge ProvisionedConcurrencyUtilization = 0.8= 80% = 0.8= 80% スケールアウト スケールイン
  21. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース • 予想できるスパイクへの対処 • Cold Startの抑制 • リクエスト数はそんなにないが、UXのために遅延を回避したい • AWS Lambdaのバースト制限抑制
  22. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (認証認可トリガーなど) Concurrency time サインアップ前 Lambda トリガー Amazon Cognito User Pool サインアップ 承認要求 OK https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
  23. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (認証認可トリガーなど) Concurrency time サインアップ前 Lambda トリガー Amazon Cognito User Pool サインアップ 承認要求 OK ColdStart ※Lambdaインスタンスが回収され 再利用されなかった場合 https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
  24. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (認証認可トリガーなど) Concurrency time Provisioned Concurrency サインアップ前 Lambda トリガー Amazon Cognito User Pool サインアップ 承認要求 OK WarmStart https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
  25. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース • 予想できるスパイクへの対処 • Cold Startの抑制 • Java VMなど立ち上がると高速処理が期待できるruntimeを暖機 • AWS Lambdaのバースト制限抑制
  26. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (リクエストの波があるJVMシステムなど) Concurrency time ColdStart ColdStart ColdStart 初期処理が重たいRuntimeは立ち上がりにColdStartを誘発
  27. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (リクエストの波があるJVMシステムなど) Concurrency time Provisioned Concurrency WarmStart WarmStart WarmStart ProvisionedConcurrencyを使えば、ColdStartは抑制される
  28. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (リクエストの波があるJVMシステムなど) Concurrency time Provisioned Concurrency WarmStart WarmStart WarmStart ProvisionedConcurrencyを使えば、ColdStartは抑制される 余分なConcurrency = コスト増大
  29. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startの抑制 (リクエストの波があるJVMシステムなど) Concurrency time Provisioned Concurrency > 0.7 = 70% > 0.7 = 70% > 0.7 = 70% Amazon Application Auto Scalingを使って ProvisionedConcurrencyUtilizationに応じてスケール Amazon Application Auto Scaling
  30. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Lambda Provisioned Concurrency Auto Scaling (AWS CDK) const target = new applicationautoscaling.ScalableTarget(this, 'ScalableTarget', { serviceNamespace: applicationautoscaling.ServiceNamespace.LAMBDA, maxCapacity: 100, minCapacity: 10, resourceId: `function:${handler.functionName}:${fnVer.version}`, scalableDimension: 'lambda:function:ProvisionedConcurrency', }) target.scaleToTrackMetric('PceTracking', { targetValue: 0.7, predefinedMetric: applicationautoscaling.PredefinedMetric .LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION, }) https://docs.aws.amazon.com/cdk/api/latest/docs/aws-applicationautoscaling-readme.html
  31. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Lambda Provisioned Concurrency Auto Scaling (AWS SAM) MyScalableTarget: Type: AWS::ApplicationAutoScaling::ScalableTarget Properties: MaxCapacity: 100 MinCapacity: 10 ResourceId: !Sub function:${MyFunction}:live RoleARN: !Sub arn:aws:iam::${AWS::AccountId}:role/[...]AWSServiceRoleForApplicationAutoScaling_LambdaConcurrency ScalableDimension: lambda:function:ProvisionedConcurrency ServiceNamespace: lambda DependsOn: MyFunctionAliaslive MyTargetTrackingScalingPolicy: Type: AWS::ApplicationAutoScaling::ScalingPolicy Properties: PolicyName: utilization PolicyType: TargetTrackingScaling ScalingTargetId: !Ref MyScalableTarget TargetTrackingScalingPolicyConfiguration: TargetValue: 0.70 PredefinedMetricSpecification: PredefinedMetricType: LambdaProvisionedConcurrencyUtilization https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalabletarget.html https://aws.amazon.com/jp/blogs/aws/new-provisioned-concurrency-for-lambda-functions/
  32. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency ユースケース • 予想できるスパイクへの対処 • Cold Startの抑制 • AWS Lambdaのバースト制限抑制 • https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/invocation-scaling.html
  33. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのバースト制限抑制 Concurrency time バースト制限 アカウント同時実行数 (リミット制限緩和後) 1500 Tokyo 1000
  34. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのバースト制限抑制 Concurrency time バースト制限 アカウント同時実行数 (リミット制限緩和後) 1500 Tokyo 1000 バーストでスケール
  35. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのバースト制限抑制 Concurrency time バースト制限 アカウント同時実行数 (リミット制限緩和後) 1500 Tokyo 1000 500/分でスケール バーストでスケール この制限されたスケールを緩和したい
  36. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのバースト制限抑制 Concurrency time バースト制限 アカウント同時実行数 (リミット制限緩和後) 1500 Tokyo 1000 500/分でスケール バーストでスケール この制限されたスケールを緩和したい ColdStart これも緩和したい
  37. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのバースト制限抑制 Concurrency time バースト制限 アカウント同時実行数 (リミット制限緩和後) 1500 Warmかつ、バーストでスケール Provisioned Concurrency WarmStart
  38. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaのバースト制限抑制 Concurrency time バースト制限 アカウント同時実行数 (リミット制限緩和後) 1500 Provisioned Concurrency WarmStart レイテンシーが改善
  39. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Practice
  40. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Practice • デプロイに関するプラクティス • 実装に関するプラクティス • デザインパターンに関するプラクティス
  41. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Practice • デプロイに関するプラクティス • 実装に関するプラクティス • デザインパターンに関するプラクティス
  42. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned ConcurrencyのLambda Version指定について • Provisioned Concurrencyを利用するには、 Lambda関数のversion、または、aliasを発行 し指定する必要がある。 • Provisioningするversionはaliasが参照してい るversionを含めて、関数内で重複はできな い。 funcA (Provisioned Pool) prod(V5) V6 dev(V7) Lambda Instance
  43. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned ConcurrencyのLambda Version指定について • Provisioned Concurrencyを利用するには、 Lambda関数のversion、または、aliasを発行 し指定する必要がある。 • Provisioningするversionはaliasが参照してい るversionを含めて、関数内で重複はできな い。 • ひとつのaliasに複数versionを梱包できる。 • 加重をかけることによりトラフィック の流れをコントロール可能 funcA (Provisioned Pool) funcB (Provisioned Pool) prod(V5) V6 dev(V7) Lambda Instance prod(V3, V4) dev(V6)
  44. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned ConcurrencyのLambda Version指定について • Amazon API Gatewayの設定として、Lambda 関数プロキシ統合にターゲット関数を設定 • funcA:${stageVariables.alias} • AWS Lambda関数の設定として、aliasごとの リソースポリシー設定でAPI Gatewayからの 実行を許可 funcA (Provisioned Pool) prod(V5) V6 dev(V7) Endpoint Endpoint prod dev Amazon API Gateway
  45. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned ConcurrencyのLambda Version指定について • Amazon API Gatewayのリクエストは加重に 合わせて、Lambda Versionにルーティングさ れる。 • prodでは60%がV3へ、残りの40%が V4に流れる funcB (Provisioned Pool) Endpoint Endpoint prod dev Amazon API Gateway prod(V3, V4) dev(V6)
  46. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. aliasの参照Versionを更新したら Invocations time alias更新(prod = V3→V4) V3 (provisioned) V4 (on demand) V4 (provisioned) WarmStart WarmStart aliasを更新するとトラフィック は突如、新versionにシフトする ProvisionedConcurrencyInvocations Invocations
  47. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. aliasの参照Versionを更新したら Invocations time V3 (provisioned) aliasを更新するとトラフィック は突如、新versionにシフトする => ColdStartを誘発する V4 (on demand) V4 (provisioned) ColdStart WarmStart WarmStart これを緩和したい alias更新(prod = V3→V4) ProvisionedConcurrencyInvocations Invocations
  48. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. alias トラフィック シフティング • AWS SAM を使用してサーバーレスアプリケーションを作成する場合、 CodeDeploy が組み込まれているため、Lambda を安全にデプロイできます。 https://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html funcB: Type: AWS::Serverless::Function Properties: Runtime: python3.8 Handler: index.handler AutoPublishAlias: !Ref Stage DeploymentPreference: Enabled: true Type: Linear10PercentEvery1Minute
  49. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. aliasの参照Versionを更新したら with AWS SAM Invocations time V3 (provisioned) トラフィックを段階的に新versionに シフトする => ColdStartを抑制する V3 & V4 (deploying) V4 (provisioned) WarmStart WarmStart WarmStart alias更新(prod = V3→V4 ) 10% ProvisionedConcurrencyInvocations Invocations 20% 90% 80% 30% 100%
  50. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Practice • デプロイに関するプラクティス • 実装に関するプラクティス • デザインパターンに関するプラクティス
  51. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Cold Startを緩和する実装 (全てのRuntime共通) • ハンドラー外で • 初期化処理を実装 • 必須処理やObject生成処理など • ただしリクエスト独立性が必要 • 外部接続処理を実装(AWSサービスやAWS外のリソースに接続) • DBコネクション • TLSハンドシェイク • 接続先のタイムアウトにも注意 • ハンドラー内で • Globalに初期化データがあれば流用、なければ再作成しGlobalに格納 • コネクションタイムアウトなどに対応
  52. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Java についてのTips for Cold Start • Static Blockで処理 • クラスロード、インスタンス化などをハンドラー外に書く • リフレクション、動的オブジェクト生成、Proxyオブジェクトは避ける private static Map<String, String> headers = new HashMap<>(); static { headers.put("Content-Type", "application/json"); headers.put("X-Custom-Header", "application/json"); }
  53. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Python についてのTips for Cold Start • import は、ハンドラー外で実行 • デコレータはシンプルに実装 • Fat-Heavy デコレータにしない • 関心ごとの分離は良いが、無関心にデコレーションしない • 慣用デコレーションは必要の有無を確認する
  54. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Node.js についてのTips for Cold Start • CallBackをGlobalでコールした場合、Handler実行が始まってからも処理を継 続する場合がある(非同期) • Globalでのawait つまり、Top-level `await`が現状不可のため、 Globalでの初期化処理は同期的な処理系を採用する必要がある
  55. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency Practice • デプロイに関するプラクティス • 実装に関するプラクティス • デザインパターンに関するプラクティス
  56. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Concurrency Quotaの共有範囲 • Concurrency Quotaは、アカウント、リージョン単位で共有される。 • デフォルトでConcurrency Quotaは1000 • Provisioned Concurrencyの設定値もこの共有の考えに従う • 900(デフォルト=1000-100)まで、Provisioned Concurrencyが設定可能 な場合、この900を複数の関数で分け合う必要がある
  57. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 暖機したいAPI Provisioned Concurrency割り当て可能: 900 Endpoint Lambda function 900 provisioned
  58. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 暖機したいAPIが複数ある場合 Provisioned Concurrency割り当て可能: 900 要件: 両APIとも600 rpsを満たしたい Endpoint Lambda function 300 Endpoint Lambda function 600 Duration (Warm) provisioned 500 ms(P99) 1000 ms(P99)
  59. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 暖機したい関数が直列で複数ある場合 Provisioned Concurrency割り当て可能: 900 要件: 両関数とも600 tpsを満たしたい Endpoint Lambda function 300 600 Duration (Warm) provisioned 500 ms(P99) 1000 ms(P99) Lambda function
  60. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 暖機したいAPIが多数ある場合 Provisioned Concurrency割り当て可能: 900 Provisioned Concurrency利用なら Dispatch Patternなど(後ほど説明)
  61. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 暖機したいAPIが多数ある場合 Provisioned Concurrency割り当て可能: 900 (重要) システム全体アーキテクチャとして暖機APIが多数の場合 アーキテクチャデザインを見直すことも視野に入れる • 基本的な関数コードのチューニング • 非同期にできるか検討 • リージョン、アカウント分離 • Service Quota 緩和 • AWS Fargateなどのコンテナ化検討 Provisioned Concurrencyに頼らない
  62. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provisioned Concurrency割り当て可能: 900 Dispatch Pattern で実装として対応 900 provisioned 言語関数実装 def func1 def func3 def func2 def funcN dispatcher Dispatch Pattern - 複数関数を共通Quota消費で暖機
  63. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Dispatch Pattern - 複数関数を共通Quota消費で暖機 Provisioned Concurrency割り当て可能: 900 Dispatch Pattern で実装として対応 900 provisioned 言語関数実装 def func1 def func3 def func2 def funcN dispatcher Monolambdas モノリスに回帰するので 本当にアーキテクチャ回避できないか検討
  64. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. private static Map<Integer, Function> functions = new HashMap<>(); static { functions.put(0, App::lambda_a); functions.put(1, App::lambda_b); } public static Object lambda_a (final Object event, final Context context) { return new GatewayResponse("{\"message\":\"this is a.\"}", headers, 200); } public static Object lambda_b (final Object event, final Context context) { return new GatewayResponse("{\"message\":\"this is b.\"}", headers, 200); } public Object handler(final Object event, final Context context) { Integer dispatch = router(event); Function function = functions.get(dispatch); return function.invoke(event, context); } Monolambdas(モノラムダ) かつて個々のLambda関数であった機能を 言語内関数に移植 Dispatch Pattern - 複数関数を共通Quota消費で暖機 (Javaの例)
  65. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. まとめ • まずはProvisioned Concurrencyを利用しなくても通常のLambdaのフルマネー ジドなスケーラビリティでアーキテクティングしてみる • どうしても暖機が必要なケースや、スパイクするイベントに対応が必要な場 合にProvisioned Concurrencyを部分利用する • (アーキテクチャやコードチューニングの免罪符ではない) • 多くの関数を暖機する必要がある場合、それに至ったアーキテクチャに無理 がないか検討した上で、Quotaの制限に対応するためにアカウント/リージョ ンを分けたりQuotaの制限緩和を実施する
  66. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Thank you ! @_kensh
  67. © 2020, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. AWS Lambdaの制限 (追加) Metrics 説明 リージョンあたりの呼び出し頻度 (リクエスト数/秒) 10 倍の同時実行数の制限 (同期的 – すべてのリソース) 10 倍の同時実行数の制限 ( 非同期的 – AWS以外のソース) 無制限 (非同期的 – AWS サービスのソース) 関数のバージョンまたはエイリアスあたりの 呼び出し頻度 (リクエスト数/秒) 10 x 割り当て済みのプロビジョニングされた同時実行数 この制限は、プロビジョニングされた同時実行数を使用 する関数にのみ適用されます。