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
79
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
110
あなたの知らないバージョン命名規則
sat
PRO
3
920
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
74
Machine Check Exception
sat
PRO
2
71
バイナリダンプの模様を読む
sat
PRO
0
110
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
110
114-ファイルのshallow_copy.pdf
sat
PRO
2
63
113-Btrfsのスナップショット.pdf
sat
PRO
0
47
Other Decks in Technology
See All in Technology
USB PDを使ってスマホを労わりたい
raspython3
0
180
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
170
専門領域のAIをどう評価するか
bengo4com
2
320
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
290
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
360
僕のハーネスを紹介します
watany
3
550
今さら理解するウェブフォントver.2026
takanorip
3
920
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
360
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
390
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
170
ウォンテッドリーの最近のプロダクトと技術の紹介
stomk
0
210
Rust で関数型ドメインモデリング
takonda
0
170
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Speed Design
sergeychernyshev
33
2.2k
BBQ
matthewcrist
90
10k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
Crafting Experiences
bethany
1
390
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Site-Speed That Sticks
csswizardry
13
1.6k
Code Reviewing Like a Champion
maltzj
529
40k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
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