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
アプリケーションパフォーマンスの計測と改善の方法を勉強している話
Search
kumico
September 17, 2023
Programming
3.4k
11
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
アプリケーションパフォーマンスの計測と改善の方法を勉強している話
2023/08/25のフレッシュメンLT #0で発表した資料になります。
https://connpass.com/event/285559/
kumico
September 17, 2023
Transcript
37 slides
アプリケーションパフォーマンスの計測 と改善の方法を勉強している話 Takumi Katase フレッシュメン夏祭りLT #0
自己紹介 • Takumi Katase Twitter: @devoc_ • SRE • Linux/Go/Terraform/Vim
• 🍜 / Game / Anime
アジェンダ • ベンチマーク • プロファイル • 分散トレース
アジェンダ • ベンチマーク • プロファイル • 分散トレース
ベンチマーク HTTP Requests Server
ベンチマーク Server Output • Latency • Throughput • etc .
. .
ab - Apache HTTP server benchmarking tool https://httpd.apache.org/docs/2.4/programs/ab.html
ab - Apache HTTP server benchmarking tool
ab - Apache HTTP server benchmarking tool
負荷を観察する HTTP Requests Server 👀 システムリソースの 状態を観察する
top - display Linux processes
top - display Linux processes 👈
観察結果から次の行動を決定する • MySQLのプロセスがCPUを多く(90%くらい)使っている • MySQLがボトルネックになってそう • スロークエリ調べてみよう • . .
. . . .
サイクルを回す ベンチマーク 解析 改善
Other tools • k6 ◦ シナリオを記述 ◦ 実際の利用状況に近い負荷を与えられる • perf
◦ Linuxのプロファイラ ◦ 超多機能。よりハードウェアに近いCPUの振る舞いを分析 できる
https://gihyo.jp/book/2022/978-4-297-12846-3
アジェンダ • ベンチマーク • プロファイル • 分散トレース
プロファイル システムパフォーマンスの分野で は、プロファイリング(profiling) とは、サンプリングツールの使用 という意味である。 計測値のサブセット(サンプル)を 取り、対象のおおよその姿を描く のである。 https://www.oreilly.co.jp/books/9784814400072/
CPU プロファイル
CPU プロファイル main() addAB() getA() getB()
CPU プロファイル main() addAB() getA() getB() 1s 1s 0.3s 0.6s
スタックトレース スレッド スタック レジスタ プログラム カウンタ プロセス スレッド スレッド
スタックトレース スレッド スタック レジスタ プログラム カウンタ プロファイラ プロファイラがスタック内 に保存されているリターン アドレスを解析する
package “net/http/pprof” https://pkg.go.dev/net/http/pprof Package pprof serves via its HTTP server
runtime profiling data in the format expected by the pprof visualization tool.
package “net/http/pprof”
package “net/http/pprof”
package “net/http/pprof”
アジェンダ • ベンチマーク • プロファイル • 分散トレース
分散トレース 分散トレースは、単に相互に関連 した一連のイベントです。分散ト レースシステムは、これらの関係 を追跡する作業を「自動的に魔法 のように」作成し、それを管理す る、パッケージ化されたライブラ リ を提供します。 https://www.oreilly.co.jp/books/9784814400126/
OpenTelemetry https://opentelemetry.io/docs/what-is-opentelemetry/ OpenTelemetry は、トレース、 メトリクス、ログなどのテレメ トリ データを作成および管理す るために設計された Observability フレームワークお
よびツールキットです。
OpenTelemetry https://github.com/catatsuy/private-isu private-isu app OpenTelemetry SDK 計装
Trace
Trace
Trace
Trace
OpenTelemetry private-isu app OpenTelemetry SDK 計装
OpenTelemetry private-isu app OpenTelemetry SDK 計装
More Decks by kumico
See All by kumico
こんにちは DID
devoc
0
29
インタラクティブシェルのカスタマイズを楽しもう
devoc
0
220
OpenID Connect から学ぶ認証・認可
devoc
0
47
Grafana Cloudとソラカメ
devoc
0
410
モダンターミナルエミュレータは画像を表示できるらしい
devoc
1
54
Other Decks in Programming
See All in Programming
AI Augmentation Techniques with Liberty
ivargrimstad
1
470
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
170
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
570
Next.js: The final boss of Web Performance
guaca
0
400
SODA - FACT BOOK(EN)
sodainc
1
240
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
ActionController meets Protocol Buffers
sorah
1
800
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
Modernizing iOS Apps
seyfoyun
0
150
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
260
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
12k
Featured
See All Featured
Music & Morning Musume
bryan
48
7.5k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
560
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Mobile First: as difficult as doing things right
swwweet
225
10k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
Building AI with AI
inesmontani
PRO
1
1.4k