SlideShare a Scribd company logo
Linux Process Snapper の紹介
Dec, 2020
Twitter: yoheia@
Linux Process Snapper の作者
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=2
Tanel Poder
db tech showcase で何度か来日したことも
Linux Process Snapper のコンセプト
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=4
pSnapper は Python スクリプト
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=14
pSnapper は 0x.tools のツール群の一つ
https://0x.tools/
pSnapper は Thread State Analysis
Snapper
pSnapper
Performance Insights
Oracle ASH
など
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=5
Thread State とは
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=11
Thread State Analysis に使うツール
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=6
B.Gregg の Thread State Analysis Method
http://www.brendangregg.com/tsamethod.html
Brendan Gregg
• Netflix の Sr. Performance Architect
• Sun->Oracle->Joyent->Netflix
Performance Insights は TSA の発展型の ASH
https://www.slideshare.net/yoheiazekatsu/awrexcel/8
https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.html
Kyle Hailey
Oracle、AWS や他にも様々なプロダクトで
ASH のコンセプトを実装
スレッド(セッション)の状態をサンプリングし、
その履歴を可視化。スレッドの状態より細やかに
Wait Event ベースで状態をサンプリング。
*ASH: Active Session History
ps で Thread State Analysis してみる
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=9
pSnapper の実行例
https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=16
ビジュアライズする機能もリリース予定?
https://youtu.be/YEWp3O7Kem8?t=2767
デモ
# pgbench で PostgeSQL にクエリ実行
$ pgbench -r -c 8 -j 8 -t 100000 -U postgres -h localhost -d postgres -p 5432 > /dev/null 2>&1 &
# pSnapper でサンプリングする
$ sudo psn -G syscall,wchan
実行例
# dd を実行
$ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
$ sudo dd if=/dev/xvda1 of=/dev/null bs=1M count=10000 &
# pSnapper でサンプリングする
$ sudo psn -G syscall,wchan,kstack
まとめ
まとめ
• Linux Process Snapper はアドホックなトラブルシューティングツール
• Python スクリプトおくだけで動く
• Thread State Analysis (サンプリング&集計)ができる
• 情報ソースは /proc
• 機能追加される計画なので、今後も期待
Appendix. 参考情報
• Linux Performance Analysis in 15 minutes
 https://www.slideshare.net/yoheiazekatsu/linux-performance-analysis-in-15-minutes
• Modern Linux Performance Tools for Application Troubleshooting
• https://www.slideshare.net/tanelp/modern-linux-performance-tools-for-application-troubleshooting
• Profiling Linux Activity for Performance and Troubleshooting
 https://www.youtube.com/watch?v=YEWp3O7Kem8
• 0x.tools
 https://0x.tools/
• tanelpoder - 0xtools (Github)
 https://github.com/tanelpoder/0xtools

More Related Content

Similar to Linux Process Snapper Introduction (20)

PDF
Dockerを支える技術
Etsuji Nakai
 
PPT
Windows® API Code Pack for Microsoft® .NET Framework
Tadahiro Higuchi
 
PDF
Rails解説セミナー: リリースノート解説編
Yohei Yasukawa
 
PDF
20170124 linux basic_1
YUSUKE MORIZUMI
 
PPT
NanoA
Kazuho Oku
 
PDF
How to run P4 BMv2
Kentaro Ebisawa
 
PDF
Start-padrino
Uchio Kondo
 
ODP
Programming camp Codereading
Hiro Yoshioka
 
PDF
Batch processing and Stream processing by SQL
SATOSHI TAGOMORI
 
PDF
scala-kaigi1-sbt
Kenji Yoshida
 
PDF
マイクロサービス時代の生存戦略 with HashiCorp
Masahito Zembutsu
 
PDF
初めてのプラグイン開発
ikikko
 
PDF
Janus @ Meetup Tokyo #12
Lorenzo Miniero
 
PDF
GTC Japan 2016 Rescaleセッション資料「クラウドHPC ではじめるDeep Learning」- Oct/5/2016 at GTC ...
Rescale Japan株式会社
 
PDF
perfを使ったPostgreSQLの解析(前編)
NTT DATA OSS Professional Services
 
PDF
Spark SQL - The internal -
NTT DATA OSS Professional Services
 
PDF
Node予備校 vol.1 名古屋
Mori Shingo
 
PDF
Open Shift v3 主要機能と内部構造のご紹介
Etsuji Nakai
 
PDF
はてなのサービスの開発環境
ast_j
 
PPTX
今さら聞けない人のためのDocker超入門 CentOS 7.2対応版
VirtualTech Japan Inc.
 
Dockerを支える技術
Etsuji Nakai
 
Windows® API Code Pack for Microsoft® .NET Framework
Tadahiro Higuchi
 
Rails解説セミナー: リリースノート解説編
Yohei Yasukawa
 
20170124 linux basic_1
YUSUKE MORIZUMI
 
NanoA
Kazuho Oku
 
How to run P4 BMv2
Kentaro Ebisawa
 
Start-padrino
Uchio Kondo
 
Programming camp Codereading
Hiro Yoshioka
 
Batch processing and Stream processing by SQL
SATOSHI TAGOMORI
 
scala-kaigi1-sbt
Kenji Yoshida
 
マイクロサービス時代の生存戦略 with HashiCorp
Masahito Zembutsu
 
初めてのプラグイン開発
ikikko
 
Janus @ Meetup Tokyo #12
Lorenzo Miniero
 
GTC Japan 2016 Rescaleセッション資料「クラウドHPC ではじめるDeep Learning」- Oct/5/2016 at GTC ...
Rescale Japan株式会社
 
perfを使ったPostgreSQLの解析(前編)
NTT DATA OSS Professional Services
 
Spark SQL - The internal -
NTT DATA OSS Professional Services
 
Node予備校 vol.1 名古屋
Mori Shingo
 
Open Shift v3 主要機能と内部構造のご紹介
Etsuji Nakai
 
はてなのサービスの開発環境
ast_j
 
今さら聞けない人のためのDocker超入門 CentOS 7.2対応版
VirtualTech Japan Inc.
 

More from Yohei Azekatsu (11)

PPTX
SIGMOD 2022 Amazon Redshift Re-invented を読んで
Yohei Azekatsu
 
PPTX
Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amaz...
Yohei Azekatsu
 
PPTX
CloudTrail ログの検索を爆速化してみた
Yohei Azekatsu
 
PPTX
Parquetはカラムナなのか?
Yohei Azekatsu
 
PPTX
Linux Performance Analysis in 15 minutes
Yohei Azekatsu
 
PDF
iostatの見方
Yohei Azekatsu
 
PDF
シンプルでシステマチックな Oracle Database, Exadata 性能分析
Yohei Azekatsu
 
PDF
シンプルでシステマチックな Linux 性能分析方法
Yohei Azekatsu
 
PDF
簡単!AWRをEXCELピボットグラフで分析しよう♪
Yohei Azekatsu
 
PPTX
Dbts2012 unconference wttrw_yazekatsu_publish
Yohei Azekatsu
 
PPTX
私がPerlを使う理由
Yohei Azekatsu
 
SIGMOD 2022 Amazon Redshift Re-invented を読んで
Yohei Azekatsu
 
Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amaz...
Yohei Azekatsu
 
CloudTrail ログの検索を爆速化してみた
Yohei Azekatsu
 
Parquetはカラムナなのか?
Yohei Azekatsu
 
Linux Performance Analysis in 15 minutes
Yohei Azekatsu
 
iostatの見方
Yohei Azekatsu
 
シンプルでシステマチックな Oracle Database, Exadata 性能分析
Yohei Azekatsu
 
シンプルでシステマチックな Linux 性能分析方法
Yohei Azekatsu
 
簡単!AWRをEXCELピボットグラフで分析しよう♪
Yohei Azekatsu
 
Dbts2012 unconference wttrw_yazekatsu_publish
Yohei Azekatsu
 
私がPerlを使う理由
Yohei Azekatsu
 
Ad

Linux Process Snapper Introduction

  • 1. Linux Process Snapper の紹介 Dec, 2020 Twitter: yoheia@
  • 2. Linux Process Snapper の作者 https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=2
  • 3. Tanel Poder db tech showcase で何度か来日したことも
  • 4. Linux Process Snapper のコンセプト https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=4
  • 5. pSnapper は Python スクリプト https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=14
  • 6. pSnapper は 0x.tools のツール群の一つ https://0x.tools/
  • 7. pSnapper は Thread State Analysis Snapper pSnapper Performance Insights Oracle ASH など https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=5
  • 9. Thread State Analysis に使うツール https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=6
  • 10. B.Gregg の Thread State Analysis Method http://www.brendangregg.com/tsamethod.html Brendan Gregg • Netflix の Sr. Performance Architect • Sun->Oracle->Joyent->Netflix
  • 11. Performance Insights は TSA の発展型の ASH https://www.slideshare.net/yoheiazekatsu/awrexcel/8 https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.html Kyle Hailey Oracle、AWS や他にも様々なプロダクトで ASH のコンセプトを実装 スレッド(セッション)の状態をサンプリングし、 その履歴を可視化。スレッドの状態より細やかに Wait Event ベースで状態をサンプリング。 *ASH: Active Session History
  • 12. ps で Thread State Analysis してみる https://speakerdeck.com/tanelpoder/troubleshooting-linux-activity-with-task-state-sampling?slide=9
  • 15. デモ # pgbench で PostgeSQL にクエリ実行 $ pgbench -r -c 8 -j 8 -t 100000 -U postgres -h localhost -d postgres -p 5432 > /dev/null 2>&1 & # pSnapper でサンプリングする $ sudo psn -G syscall,wchan
  • 16. 実行例 # dd を実行 $ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches" $ sudo dd if=/dev/xvda1 of=/dev/null bs=1M count=10000 & # pSnapper でサンプリングする $ sudo psn -G syscall,wchan,kstack
  • 18. まとめ • Linux Process Snapper はアドホックなトラブルシューティングツール • Python スクリプトおくだけで動く • Thread State Analysis (サンプリング&集計)ができる • 情報ソースは /proc • 機能追加される計画なので、今後も期待
  • 19. Appendix. 参考情報 • Linux Performance Analysis in 15 minutes  https://www.slideshare.net/yoheiazekatsu/linux-performance-analysis-in-15-minutes • Modern Linux Performance Tools for Application Troubleshooting • https://www.slideshare.net/tanelp/modern-linux-performance-tools-for-application-troubleshooting • Profiling Linux Activity for Performance and Troubleshooting  https://www.youtube.com/watch?v=YEWp3O7Kem8 • 0x.tools  https://0x.tools/ • tanelpoder - 0xtools (Github)  https://github.com/tanelpoder/0xtools

Editor's Notes

  • #3: B.Gregg と並んでリスペクトしているトラブルシューター B.Gregg 同様に理論と実践を持ち合わせ、体系化してシステマチックなノウハウを提供してくれている
  • #11: 最近、Systems Performance の2nd Edition を出した、B.Gregg のサイトや書籍でも TSA の解説がある。
  • #12: K
  • #13: K
  • #14: K
  • #15: K
  • #16: K
  • #17: K