Linux and Unix Test Disk I/O Performance With dd Command How to test disk write speed and latency on linuxsystems

How can I use dd command on a Linux to test I/O performance of my hard disk drive?
How do I check the performance of a hard drive including the read and write speed on a Linux operating systems?

You can use the following commands on a Linux or Unix-like systems for simple I/O performance test:

dd command : It is used to monitor the writing performance of a disk device on a Linux and Unix-like system.
hdparm command : It is used to get/set hard disk parameters including test the reading and caching performance of a disk device on a Linux based system.
In this tutorial you will learn how to use the dd command to test disk I/O performance.

Use dd command to monitor the reading and writing performance of a disk device:

  1. Open a shell prompt (Or login to a remote server via ssh)
  2. Use the dd command to measure server throughput (write speed)
    dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync
  3. Use the dd command to measure server latency
    dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

The dd command is useful to find out simple sequential I/O performance.

Here’s some examples:

Disk I/O Performance With dd Command
Disk I/O Performance With dd Command
Disk I/O Performance With dd Command
Disk I/O Performance With dd Command

 

As you can see, writing 1 file (1 GigaByte dimension) can permit to test the maximum speed of writing bandwidth, instead, writing a small file many times, is better to simulate the actual daily behavior of a server (many small files, many times a day)

IMPORTANT! To keep your filesystem clean by useless files, remember to delete test1.img and test2.img at the end of test:

  1. cd /tmp/
  2. rm test1.img
  3. rm test2.img

How to enable Performance data when is not available from VMware vCenter Fix Performance data when is not available for an entity by CLI

Details
When connected with VMware Infrastructure (VI) Client to the ESXi/ESX host, performance graphs are not available.
You see an error similar to:

  • Performance data is currently not available for this entity

Solution
This issue occurs when the time is not synchronized between the VI Client host and the ESXi/ESX host.

To resolve this issue, ensure there is no time differences between the VI Client host and the ESXi/ESX host.

Run these commands:

For ESXi:
/etc/init.d/ntpd restart

and

/etc/init.d/vpxa restart