Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CPUの基本的な性能指標
Search
Satoru Takeuchi
PRO
August 15, 2020
Technology
320
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CPUの基本的な性能指標
以下動画のテキストです
https://youtu.be/1pyzZQLxzv8
Satoru Takeuchi
PRO
August 15, 2020
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
68
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
93
あなたの知らないバージョン命名規則
sat
PRO
3
900
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
66
バイナリダンプの模様を読む
sat
PRO
0
89
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
87
114-ファイルのshallow_copy.pdf
sat
PRO
2
57
113-Btrfsのスナップショット.pdf
sat
PRO
0
40
Other Decks in Technology
See All in Technology
Multica × 長期記憶:40個のミニプロジェクト管理
eiei114
1
280
DEFCON34-Write-up_HYCu-MYCu
daikiokazaki
0
160
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
1
490
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
23
13k
Sigmaで作る業務アプリ
kazushiro_honma
0
130
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.1k
Genieを崇めよ
kameitomohiro
0
110
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
1.2k
Geolonia の開発現場における AIの活用について
miya0001
0
100
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
120
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
230
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Building Applications with DynamoDB
mza
96
7.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
270
Abbi's Birthday
coloredviolet
3
9.9k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
530
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
400
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
Accessibility Awareness
sabderemane
1
210
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Believing is Seeing
oripsolob
1
220
Transcript
CPUの基本的な性能指標 Aug 15th, 2020 Satoru Takeuchi Twitter: satoru_takeuchi, EnSatoru 1
性能指標を計るコマンド • sarコマンド ◦ Sysstatパッケージに入っている • 使い方 ◦ sar 1:
一秒ごとにCPUが何をしているのかを表示。全 CPUの平均値を出す ◦ sar -P ALL 1: 一秒ごとに全CPUの平均値、および各 CPUの値を出す ◦ sar -P 0 1: 一秒ごとにCPU0が何をしているのかを表示 • オプションを付けると別種のメトリクスも得られる ◦ メモリ ◦ ストレージI/O ◦ ネットワークI/O 2
数値の意味がわからん! $ sar -P 0 1 ... 06:13:58 AM CPU
%user %nice %system %iowait %steal %idle 06:13:59 AM 0 0.00 0.00 0.00 0.00 0.00 100.00 こいつらの意味は何 ? 順番に説明します %stealは今回は省略 3
%idle • 単純に何もしてない ◦ どんなプロセスも動いていないしカーネルも仕事していないし I/Oもしてない 06:13:58 AM CPU %user
%nice %system %iowait %steal %idle 06:13:59 AM 0 0.00 0.00 0.00 0.00 0.00 100.00 4
%user • プロセスが動いている • 演習: 無限ループプログラムを動かす ◦ taskset -c 0
./loop 06:20:34 AM CPU %user %nice %system %iowait %steal %idle 06:20:35 AM 0 100.00 0.00 0.00 0.00 0.00 0.00 5
%nice • syscallやnice/reniceコマンドで優先度を下げたプロセスが動作中 ◦ 優先度を上げたプログラムは %userにカウントされる • 演習: nice値を正の数にして(優先度を下げて)無限ループプログラムを実行 ◦
sudo taskset -c 0 nice -n 1 ./loop 06:27:23 AM CPU %user %nice %system %iowait %steal %idle 06:27:24 AM 0 0.00 100.00 0.00 0.00 0.00 0.00 6
%system • カーネルが動作中 • 演習: 無限ループ中にgetppid() syscallを呼び続けるプログラムを動かす ◦ taskset -c
0 ./ppidloop 06:29:42 AM CPU %user %nice %system %iowait %steal %idle 06:29:43 AM 0 62.63 0.00 37.37 0.00 0.00 0.00 getppid()を囲むループ処理 getppid()処理 7
%iowait • CPUはidle、かつ、CPU上のプロセスが依頼したストレージI/O実行中 • 演習: idleのCPU上でI/Oをし続ける ◦ for ((;;)) ;
do taskset -c 0 dd if=/dev/zero of=test.img bs=1M count=1K oflag=direct; done 06:37:52 AM CPU %user %nice %system %iowait %steal %idle 06:37:53 AM 0 0.00 0.00 20.75 24.53 0.00 54.72 I/O処理を囲むループ処理 カーネルのI/O処理 CPUは何もせずI/O待ち 8
%iowaitの罠 • CPUが何かしてる時にI/O中でも%iowaitにならない ◦ 〇: %iowaitが0ではない⇒I/Oが発生している ◦ ×: %iowaitが0⇒I/Oが発生していない •
演習: ./loopを実行しているCPU上で前述のI/Oを出すプログラムを動かす 06:43:01 AM CPU %user %nice %system %iowait %steal %idle 06:43:02 AM 0 80.81 0.00 19.19 0.00 0.00 0.00 ./loopの処理など カーネルのI/O処理 I/O中でもCPUが仕事してるので0.00 9
まとめ • sarコマンドが出すCPUについてのメトリクスについて学んだ • %iowaitは罠 10