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
12
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
エンジニア1年目で複雑なコードの改善に取り組んだ話
mtnmr
3
2k
Go1.23で入った errorsパッケージの小さなアプデ
kuro_kurorrr
2
400
2024 컴포즈 정원사
jisungbin
0
150
Rubyとクリエイティブコーディングの輪の広がり / The Growing Circle of Ruby and Creative Coding
chobishiba
1
270
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
0
390
Pythonで改めて考える「クラス(class)」の使いどころ
os1ma
4
930
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.5k
LangChainの現在とv0.3にむけて
os1ma
4
940
Developer Joy == Developer Productivity (really!)
hollycummins
1
220
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
4
90k
Kotlin 2.0 and Beyond
antonarhipov
2
150
What is Parser
yui_knk
9
4.2k
Featured
See All Featured
Designing for Performance
lara
604
68k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
0
130
Build The Right Thing And Hit Your Dates
maggiecrowley
30
2.3k
How to Ace a Technical Interview
jacobian
274
23k
Infographics Made Easy
chrislema
239
18k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
363
22k
Intergalactic Javascript Robots from Outer Space
tanoku
268
26k
Fireside Chat
paigeccino
31
2.9k
Navigating Team Friction
lara
183
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Optimizing for Happiness
mojombo
375
69k
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 計装