July 26, 2017

How to Measure the I/O Read and Disk Performance on FreeBSD

FreeBSD Logo

You want to measure the disk seeks and transfer performance under FreeBSD? With the command diskinfo you can generate simple benchmarks of your disks. This tool will show you basic information about the disk device and runs a simple performance test. Now you can measure the I/O read overhead of any disk or RAID storage.

Root access is required to edit the following files and to execute commands. Log in as root (su) or simply prepend sudo to all commands that require root privileges.

Measure the I/O Read

With the -c option you can measure the I/O read command overhead.

diskinfo -c /dev/ad4

This is a sample output of a disk in a RAID 1 storage:

/dev/ad4
        512             # sectorsize
        1500301910016   # mediasize in bytes (1.4T)
        2930277168      # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        2907021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        WD-WCAZA4434495 # Disk ident.

I/O command overhead:
        time to read 10MB block      0.155548 sec       =    0.008 msec/sector
        time to read 20480 sectors   2.401898 sec       =    0.117 msec/sector
        calculated command overhead                     =    0.110 msec/sector

Benchmark of the disks seeks and transfer performance

With the -t option you can generate a simple benchmark of the disks seeks and transfer performance.

diskinfo -t /dev/ad4

This is a sample output of a disk in a RAID 1 storage:

/dev/ad4
        512             # sectorsize
        1500301910016   # mediasize in bytes (1.4T)
        2930277168      # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        2907021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        WD-WCAZA4434495 # Disk ident.

Seek times:
        Full stroke:      250 iter in   7.866983 sec =   31.468 msec
        Half stroke:      250 iter in   5.731172 sec =   22.925 msec
        Quarter stroke:   500 iter in   9.985187 sec =   19.970 msec
        Short forward:    400 iter in   2.804155 sec =    7.010 msec
        Short backward:   400 iter in   2.462798 sec =    6.157 msec
        Seq outer:       2048 iter in   0.281750 sec =    0.138 msec
        Seq inner:       2048 iter in   0.298792 sec =    0.146 msec
Transfer rates:
        outside:       102400 kbytes in   1.036759 sec =    98769 kbytes/sec
        middle:        102400 kbytes in   1.339807 sec =    76429 kbytes/sec
        inside:        102400 kbytes in   2.540079 sec =    40314 kbytes/sec

Speak Your Mind