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
アプリケーションパフォーマンスの計測と改善の方法を勉強している話
Search
kumico
September 17, 2023
Programming
11
3.3k
アプリケーションパフォーマンスの計測と改善の方法を勉強している話
2023/08/25のフレッシュメンLT #0で発表した資料になります。
https://connpass.com/event/285559/
kumico
September 17, 2023
Tweet
Share
More Decks by kumico
See All by kumico
OpenID Connect から学ぶ認証・認可
devoc
0
16
Grafana Cloudとソラカメ
devoc
0
300
モダンターミナルエミュレータは画像を表示できるらしい
devoc
1
23
Other Decks in Programming
See All in Programming
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
580
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
840
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
320
株式会社 Sun terras カンパニーデック
sunterras
0
310
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
1
450
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
360
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
110
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
560
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
420
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
130
品質ワークショップをやってみた
nealle
0
180
Le côté obscur des IA génératives
pascallemerrer
0
140
Featured
See All Featured
How GitHub (no longer) Works
holman
315
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Designing for Performance
lara
610
69k
How STYLIGHT went responsive
nonsquared
100
5.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Context Engineering - Making Every Token Count
addyosmani
6
240
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
8
910
Into the Great Unknown - MozCon
thekraken
40
2.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
It's Worth the Effort
3n
187
28k
Transcript
アプリケーションパフォーマンスの計測 と改善の方法を勉強している話 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 計装