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
CPUの基本的な性能指標
Search
Satoru Takeuchi
PRO
August 15, 2020
Technology
310
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
Machine Check Exception
sat
PRO
2
37
バイナリダンプの模様を読む
sat
PRO
0
68
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
54
114-ファイルのshallow_copy.pdf
sat
PRO
2
38
113-Btrfsのスナップショット.pdf
sat
PRO
0
16
システム強制終了時にファイルシステムの整合性を保つ~ コピーオンライト編 ~
sat
PRO
0
59
システム強制終了時に ファイルシステムの整合性を保つ ~ ジャーナリング編 ~
sat
PRO
2
63
ファイルシステムの整合性を回復するfsck
sat
PRO
1
65
小学校5,6年生向けキャリア教育 大人になるまでの道
sat
PRO
8
5.3k
Other Decks in Technology
See All in Technology
インシデント事例と パッケージの全量解析に学ぶ ソフトウェアサプライチェーンの守り方 / supply-chain-attack-defense
flatt_security
0
140
ボーイスカウトルールでメモリやスキルを改善しよう
azukiazusa1
4
1.5k
AmplifyHostingConstructからSSRフレームワークのためのホスティング設計を考察する/amplify-hosting-construct
fossamagna
1
250
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
130
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
150
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.5k
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
430
AIが当たり前の組織で エンジニアはどう育つか
nishihira
0
130
Amplify Gen2でbackend.tsにCDKを定義する/しない事によるCDKの挙動の違いとユースケース
smt7174
1
430
シンガポールで登壇してきます
yama3133
0
250
ソニー銀行におけるビジネスアジリティ向上のためのクラウドシフト戦略
srenext
0
860
世界、断片、モデル。そして理解
ardbeg1958
1
130
Featured
See All Featured
Making Projects Easy
brettharned
120
6.7k
Tell your own story through comics
letsgokoyo
1
1k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
220
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
220
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Done Done
chrislema
186
16k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
220
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
610
Git: the NoSQL Database
bkeepers
PRO
432
67k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
RailsConf 2023
tenderlove
30
1.5k
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