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
1
280
CPUの基本的な性能指標
以下動画のテキストです
https://youtu.be/1pyzZQLxzv8
Satoru Takeuchi
PRO
August 15, 2020
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
「Linux」という言葉が指すもの
sat
PRO
4
130
APIとABIの違い
sat
PRO
5
62
ファイルシステムへのアクセス方法
sat
PRO
0
26
ファイルシステム
sat
PRO
1
34
低レイヤソフトウェア技術者が YouTuberとして食っていこうとした話
sat
PRO
7
6.1k
ポーリングと割り込み
sat
PRO
1
81
Rook: Intro and Deep Dive With Ceph
sat
PRO
1
140
会社員しながら本を書いてきた知見の共有
sat
PRO
3
880
デバイスにアクセスするデバイスファイル
sat
PRO
1
62
Other Decks in Technology
See All in Technology
ハードウェアとソフトウェアをつなぐ全てを内製している企業の E2E テストの作り方 / How to create E2E tests for a company that builds everything connecting hardware and software in-house
bitkey
PRO
1
140
新アイテムをどう使っていくか?みんなであーだこーだ言ってみよう / 20250911-rpi-jam-tokyo
akkiesoft
0
270
250905 大吉祥寺.pm 2025 前夜祭 「プログラミングに出会って20年、『今』が1番楽しい」
msykd
PRO
1
930
バイブスに「型」を!Kent Beckに学ぶ、AI時代のテスト駆動開発
amixedcolor
2
560
Firestore → Spanner 移行 を成功させた段階的移行プロセス
athug
1
480
COVESA VSSによる車両データモデルの標準化とAWS IoT FleetWiseの活用
osawa
1
290
【実演版】カンファレンス登壇者・スタッフにこそ知ってほしいマイクの使い方 / 大吉祥寺.pm 2025
arthur1
1
850
職種の壁を溶かして開発サイクルを高速に回す~情報透明性と職種越境から考えるAIフレンドリーな職種間連携~
daitasu
0
170
下手な強制、ダメ!絶対! 「ガードレール」を「檻」にさせない"ガバナンス"の取り方とは?
tsukaman
2
450
Practical Agentic AI in Software Engineering
uzyn
0
110
自作JSエンジンに推しプロポーザルを実装したい!
sajikix
1
180
研究開発と製品開発、両利きのロボティクス
youtalk
1
530
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
Fireside Chat
paigeccino
39
3.6k
Visualization
eitanlees
148
16k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Agile that works and the tools we love
rasmusluckow
330
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
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