Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
APIサーバのレスポンス速度をふわっと把握したかった
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ramo798
January 23, 2024
Programming
490
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
APIサーバのレスポンス速度をふわっと把握したかった
若手・学生サーバーサイドエンジニアLT会
ラクーンホールディングス x ゆめみ のコラボLT会です!
https://yumemi.connpass.com/event/301942/
ramo798
January 23, 2024
More Decks by ramo798
See All by ramo798
メールの分類をLLMをつかってやってみた
ramo798
0
100
Other Decks in Programming
See All in Programming
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
730
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
150
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
700
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
620
What We Talk About When We Talk About XP
m_seki
2
660
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
300
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
530
setup-vp GitLab対応の裏側
naokihaba
0
110
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
2.8k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
WCS-LA-2024
lcolladotor
0
830
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Done Done
chrislema
186
16k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
760
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Docker and Python
trallard
47
4.2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
WENDY [Excerpt]
tessaabrams
14
39k
4 Signs Your Business is Dying
shpigford
187
23k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Transcript
APIサーバのレスポンス速度 をふわっと把握したかった ramo
目次 • 自己紹介 • やりたいこと • きっかけ • 技術選定の話 •
使い方 • 結果
自己紹介 ramo 仕事→ URIHOというサービス開発。 好きなフレームワーク→ remix, sveltekit マイブーム→ cloudflare workers
最近matzさんとツーショット撮りました
URIHOについて 販売企業 URIHOは企業間取引において発生する 売掛金の未払い・倒産に備える保証サービスです。 購入企業
やりたいこと バックエンドのAPIサーバのレスポンス速度を計測したい
きっかけとか → 社内の人がISUCONを楽しそうにやってて羨ましかった →→ 来年はでる → そういえば自分のやってるサービスはどうなっているのか? →→ いろんなパターンで測定してみたい →→→ データがいっぱあるときとか
きっかけとか 「推測するな、計測せよ」と常々言われいていますので 計測することにしました。
今回やろうと思ったこと ローカルで動くもので測れるようにしたい → 既存機能の改修したときのベンチマークしたい → テストデータを多くした場合に速度の低下が起きないか等を気づきたい バックエンドAPIのレスポンス速度の計測から始める → ミニマムに始める → システムの構成的に、ボトルネックはそこになりがち
技術選定 Locustというpythonのライブラリを使うことにしました。 テストシナリオをコードで記述ができる → pythonで前処理等が書ける →→ ログイン処理が楽。共有が楽。テストデータの挿入ができる
Locustの使い方 from locust import HttpUser, task, between class ApiUser(HttpUser): wait_time
= between(1, 5) def on_start(self): self.client.post("/accounts/sign_in", { "account[email]": "email", "account[password]": "password" }) @task def load_test_api_endpoint(self): self.client.get("/endpoint")
使い方 locust -f your_script_name.py
結果
結果と展望 → ローカルサーバなので実際の数値ではないですが、大まかに傾向が把握で きました。 → 定期的に測るようにして機能が増えていくごとにどのように変化していく かを測定できると面白そう → 大量のテストデータを作成しての挙動も確認できるので未来のしんどくな るポイントを発見できる可能性がある
以上です。