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.2k
アプリケーションパフォーマンスの計測と改善の方法を勉強している話
2023/08/25のフレッシュメンLT #0で発表した資料になります。
https://connpass.com/event/285559/
kumico
September 17, 2023
Tweet
Share
Other Decks in Programming
See All in Programming
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
380
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
410
Програмиране с Rust, ФМИ, 2024
nikolads
0
120
CSC509 Lecture 06
javiergs
PRO
0
130
GPU Hash Table | レイトレ合宿10
yknishidate
0
120
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
130
Integrating AI in Your Enterprise Java Applications
ivargrimstad
0
760
書籍『LangChainとLangGraphによるRAG・AIエージェント[実践]入門』の紹介
os1ma
2
120
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
160
Golang と Erlang
taiyow
7
1.7k
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
220
レイトレ合宿10 レンダラー紹介 / Renderer Introduction, Ray Tracing Camp 10
shocker_0x15
0
630
Featured
See All Featured
For a Future-Friendly Web
brad_frost
174
9.4k
GitHub's CSS Performance
jonrohan
1030
450k
Optimising Largest Contentful Paint
csswizardry
31
2.9k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
59k
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
How STYLIGHT went responsive
nonsquared
95
5.1k
Building Your Own Lightsaber
phodgson
102
6k
Embracing the Ebb and Flow
colly
84
4.4k
Building an army of robots
kneath
302
42k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
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 計装