Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
サーバレス時代の負荷テスト戦略 / Load testing strategy for se...
Search
geeawa
January 22, 2020
Technology
5k
18
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
サーバレス時代の負荷テスト戦略 / Load testing strategy for serverless
geeawa
January 22, 2020
More Decks by geeawa
See All by geeawa
Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026
gawa
9
1.7k
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
4.2k
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
350
AI は "道具" から "同僚" へ 自律型 AI エージェントの最前線と、AI 時代の人材の在り方 / Colleague in the AI Era - Autonomous AI Seminar 2026 at Niigata
gawa
0
350
Server Less Code More - コードを書かない時代に生きるサーバーレスデザイン / server-less-code-more
gawa
5
3k
[JAWS-UG TOHOKU] AI エージェント作って・使って・楽しんで ~Bedrock Engineer で AI エージェントを体験しよう~ / create, use and enjoy AI agents
gawa
6
790
AI Agent that supports ”YOU” / introducing-bedrock-engineer-en
gawa
2
1k
開発エージェントの作り手から見る開発エージェントの利用テクニック / ai-coding-dojyo-bedrock-engineer
gawa
3
870
開発 AI エージェントBedrock Engineer 開発秘話 / bedrock-engineer-dev-stroy
gawa
7
1k
Other Decks in Technology
See All in Technology
Zoom2Youtube.Claude
kawaguti
PRO
3
480
最近評価が難しくなった
maroon8021
0
260
“全部コピーしない”ファイルデータの活用 : — FSx for ONTAP × S3 Tables × Icebergで作るメタデータカタログ
yoshiki0705
0
650
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
4
3.8k
AI Driven AI Governance
pict3
0
310
テスト設計の本質を改めて考えてみる~生成AIを活用する時代だからこそ、作ったテストの説明性を高めよう~
yamasaki696
1
440
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
140
SRE本の知られざる名シーン / The Hidden Gems of Google SRE Book
nari_ex
1
310
Making sense of Google’s agentic dev tools
glaforge
1
120
Mastraエージェント、どのクラウドにデプロイする?
minorun365
PRO
2
180
人を動かすのは時間ではなく、納得感 〜新任EMが入社3ヶ月、組織を2回変えた話〜
kakehashi
PRO
3
200
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
Automating Front-end Workflow
addyosmani
1370
210k
The Limits of Empathy - UXLibs8
cassininazir
1
410
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
A better future with KSS
kneath
240
18k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
Speed Design
sergeychernyshev
33
1.9k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
360
Claude Code のすすめ
schroneko
67
230k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Transcript
サーバレス時代 の 負荷テスト戦略 〜CircleCIで実現する継続的負荷テストとチューニングTips〜 2020.01.22 Serverless Meetup Tokyo #15
淡路⼤輔 / INTEC @gee0awa 好きな技術 Serverless / React Native
負荷テスト と サーバレス
Elasticity Performance, Scalability, Resilience
None
App
App EC2 r4.large × 1
App EC2 r4.large × 1 ApachBench
App EC2 r4.large × 1 ApachBench $ ab -n 100
-c 10 http://example.com
EC2 EC2 EC2 EC2 EC2 App r4.large × 5
EC2 EC2 EC2 EC2 EC2 App r4.large × 5
EC2 EC2 EC2 EC2 EC2 App r4.large × 5
Master EC2 EC2 EC2 EC2 App r4.large × 5
EC2 EC2 EC2 EC2 EC2 EC2 EC2 EC2 EC2 App
r4.large × 10 Master
EC2 EC2 EC2 EC2 EC2 EC2 EC2 EC2 EC2 EC2
EC2 EC2 EC2 EC2 App r4.large × 15 Master
・負荷に応じて Slave 台数をスケールさせたい ・サーバの⽤意に時間がかかる ・GUIでシナリオ作るとメンテしづらい ・EC2 ⾼い・・・ 課題
お⾦はかけたくない ⼤量リクエストを⽣成したい もっと簡単に導⼊したい Simple Performance Cost
⚡Artillery⚡
Node.js製のシンプルな負荷テストツール
Artillery scenario YAMLファイルに宣⾔的にシナリオを記述する 60秒間、20⼈の仮想ユーザがリクエスト
EC2 App ⚡Artillery⚡ $ artillery run senario.yml
CloudWatch, DataDog, aws-sigv4 etc..
EC2 App ⚡Artillery⚡ $ artillery run senario.yml
ECS Cluster App ⚡Artillery Pro⚡ $ artillery run senario.yml
Artillery + Lambda
None
serverless-artillery https://github.com/Nordstrom/serverless-artillery
None
InfluxDBに結果を保存、Grafanaで可視化
install deploy invoke remove serverless-artillery $ npm install -g serverless-artillery
$ slsart deploy —stage dev $ slsart invoke —stage dev $ slsart remove
Lambdaだから維持費ゼロ 負荷に応じたオートスケール YAMLによる宣⾔的シナリオ Simple Performance Cost
None
継続的負荷テスト 開発プロセスの早い段階から性能検証を⾏う
Github Developer commits yaml file 継続的負荷テスト CircleCIから負荷テストを実⾏する Invoke loadtest unittest
⚡ Serverless Artillery⚡
Github Developer commits yaml file 継続的負荷テスト unittest CircleCIから負荷テストを実⾏する loadtest Invoke
⚡ Serverless Artillery⚡ 処理が被ったらスキップされる
.circleci/config.yml シンプルなインタフェースで 実⾏できるようにしておく
None
None
プロダクションでは 様々なアクセスが想定される
負荷にランダム性を持たせる
Artillery scenario YAMLファイルに宣⾔的にシナリオを記述する 60秒間、20⼈の仮想ユーザがリクエスト この部分を ランダムに変化させる
シナリオファイルの負荷量を書き換える generateSenario.js duration, arrivalRate, phase数の最⼤・最⼩値だけ指定して ランダムな負荷を⽣成できるようにシナリオファイルを書き換える ChaosEngineering!!
負荷をランダムにする .circleci/config.yml
負荷テスト の 環境下 で アプリケーション を 開発する
App ⚡Serverless Artillery⚡
App ⚡Serverless Artillery⚡ get /todos get /todos/{{ id }} put
/todos/{{ id }} post /todos/{{ id }} delete /todos/{{ id }} TODOリスト アプリケーション https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb-and-offline
TODOリスト アプリケーション https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb-and-offline serverless examples の Node.js REST API
TODOリスト アプリケーション TODOリストに登録 Responseのjsonに含まれるidの値を保持 idを指定して1件取得 idを指定して1件更新 idを指定して1件削除 Artilleryのシナリオ
結果
キャパシティユニットが全然⾜りない DynamoDB
TODO⼀覧 ソース
全件スキャンになってる!! TODO⼀覧 ソース
AWS X-Ray 監視
PUT DELETE GET POST Lambdaの実⾏単位や DynamoDBへのリクエスト単位で 処理時間を計測
Lambda (cron) GetServiceGraph API Slack AWS X-Ray ALERT 監視 Response
time 4xx (error) 429 (throttling) 5xx (failure)
サーバレス時代 の 負荷テスト戦略 まとめ 宣⾔的シナリオ・低コスト・⾼負荷 継続的負荷テスト・ランダム性 分散トレーシング・監視 ⚡Serverless Artillery⚡ AWS
X-Ray CircleCI
ご静聴ありがとうございました