LoginSignup
2
1

More than 5 years have passed since last update.

ddとhdparmで簡易的なディスク性能の調査

Posted at

概要

ddコマンドとhdparmコマンドを使って、Linuxマシンのディスク性能を調べる。
GCE(ComputeEngine)インスタンスに対して調べる必要があったので、その時のメモ。

環境

  • GCE
  • Debian GNU/Linux 9
  • n1-standard-1(vCPU x 1、メモリ 3.75 GB)
  • Disk: SSD 永続ディスク 50GB

調査

Write

$ dd if=/dev/zero of=tmp.data bs=1M count=3000 oflag=direct
3000+0 records in
3000+0 records out
3145728000 bytes (3.1 GB, 2.9 GiB) copied, 82.3658 s, 38.2 MB/s

oflag=directを指定する意味

データに対してダイレクト I/O を使用し、バッファ・キャッシュを介さないようにする。
https://linuxjm.osdn.jp/info/GNU_coreutils/coreutils-ja_79.html

Read

コマンドインストール

$ sudo apt install hdparm
$ sudo hdparm -t /dev/sda1

/dev/sda1:
 Timing buffered disk reads: 744 MB in  3.01 seconds = 247.39 MB/sec

余談

hdparmで何を調べているかはmanを読むのが良い。

This measurement is an indication of how fast the drive can sustain sequential data reads under Linux, without any filesystem overhead.

雑談

GCEインスタンスの性能を見るのが目的だったが、特にReadで結果が安定しなかった。(56.78 MB/s ~ 247.39 MB/secまでバラツキが大きい)

GCEの上限のIOパフォーマンスはディスクの種類とサイズによって下記のように決まるはずだが、WriteもReadもそれを超える結果がでた。(理由はわかっていない)
https://cloud.google.com/compute/docs/disks/performance?hl=ja#type_comparison

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1