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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
More Decks by kumico
See All by kumico
こんにちは DID
devoc
0
18
インタラクティブシェルのカスタマイズを楽しもう
devoc
0
200
OpenID Connect から学ぶ認証・認可
devoc
0
35
Grafana Cloudとソラカメ
devoc
0
360
モダンターミナルエミュレータは画像を表示できるらしい
devoc
1
44
Other Decks in Programming
See All in Programming
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
110
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.3k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
4.7k
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1.1k
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
460
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.2k
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
730
JavaDoc 再入門
nagise
0
300
Lessons from Spec-Driven Development
simas
PRO
0
150
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
460
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
360
Are puppies a ranking factor?
jonoalderson
1
3.5k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
Building an army of robots
kneath
306
46k
We Have a Design System, Now What?
morganepeng
55
8.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
Balancing Empowerment & Direction
lara
6
1.1k
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 計装