Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Use the dd command to the hard disk I / O performance test     - netfilter- in kernel mode network packet operation (Linux)

- Hadoop 2.2.0 installation development environment (standalone pseudo-distributed mode) (Server)

- Python configuration tortuous road of third-party libraries Numpy and matplotlib (Programming)

- Linux Log Clear (Linux)

- ASM required disk format process in Solaris platforms (Linux)

- Install Oracle 11g illustrations and dependent libraries under SUSE11 (Database)

- Linux Open coredump (Linux)

- Monitoring Linux System 7 command-line tool (Linux)

- Eclipse Android development environment installation (Linux)

- Limit the use of the request being Nginx Flood attack (Linux)

- How to install MySQL on Linux Dock (Database)

- Oracle online redefinition (Database)

- Experience RHEL7 new features (Linux)

- Django Signals from practice to source code analysis (Programming)

- How to install Eclipse Luna IDE on CentOS 7 / RHEL 7 (Linux)

- Verify the character set on MyCAT (Database)

- CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)

- Cacti installation deployment under CentOS 6.6 (Server)

- Zabbix monitors Nginx status (Server)

- Build your own Git server under Linux (Server)

 
         
  Use the dd command to the hard disk I / O performance test
     
  Add Date : 2018-11-21      
         
       
         
  How to use the dd command to test the performance of my hard drive? How to detect the hard disk read and write speeds in the linux operating system?

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

dd command: It is used in Linux and Unix systems on the hard disk write performance of detection equipment.
hparm command: It is used to get or set the hard disk parameters on Linux-based systems, including testing reading performance and cache performance.
In this guide, you will learn how to use the dd command to test hard drive performance.

Use the dd command to monitor the hard disk read and write performance:

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

Understand options dd command

In this example, I'll use Ubuntu Linux 14.04 LTS mounted systems RAID-10 (with SAS SSD of Adaptec 5405Z) array of servers to run. The basic syntax is:

dd if = / dev / input.file of = / path / to / output.file bs = block-size count = number-of-blocks oflag = dsync
## GNU dd syntax ##
dd if = / dev / zero of = / tmp / test1.img bs = 1G count = 1 oflag = dsync
## Another GNU dd syntax ##
dd if = / dev / zero of = / tmp / testALT.img bs = 1G count = 1 conv = fdatasync

Use the dd command to get the server throughput

Please note that in this experiment, we write data to a G can be found, the server's throughput is 135 MB / s, which

if = / dev / zero (if = / dev / input.file): Enter the file name to set the dd command read.
of = / tmp / test1.img (of = / path / to / output.file): the name of the dd command to write input.file output file.
bs = 1G (bs = block-size): set dd command reads the block size. For example, a G.
count = 1 (count = number-of-blocks): Number of dd command to read the block.
oflag = dsync (oflag = dsync): use synchronous I / O. Do not omit this option. This option can help you remove the effects of caching in order to present to you accurate results.
conv = fdatasyn: This option and oflag = dsync the same meaning.
In the following example, I wrote a total of 1000 times 512 bytes to write Delay times RAID10 server:

dd if = / dev / zero of = / tmp / test2.img bs = 512 count = 1000 oflag = dsync
Sample output:

1000 + 0 records in
1000 + 0 records out
512000 bytes (512 kB) copied, 0.60362 s, 848 kB / s
Note that the server throughput and delay time also depends on the load on the server / application. So I recommend that you just restart at a peak time is over and the server to run the test in order to obtain a more accurate measure. Now you can compare the results of these tests with each other on all of your devices.

Why throughput and latency servers are so poor?

Low value does not mean that you are using bad hardware. It could be a hardware controller cache RAID10 caused.

Use the hdparm command to view the disk cache read speed.

I suggest that you run the following command 2-3 times to detect the device read performance, as a reference and compared with each other:

### Cached disk read performance test - / dev / sda ###
hdparm -t / dev / sda1
## Or ##
hdparm -t / dev / sda
Then run the following command 2-3 times to control detection of the cache read performance:

## Cache read reference - / dev / sda ###
hdparm -T / dev / sda1
## Or ##
hdparm -T / dev / sda
Or simply to combine the two tests:

hdparm -Tt / dev / sda

Test drive reads and cache performance Linux hdparm command

Note again, because the cache properties file operations, you will always see a high reading speed.

Use the dd command to test the read speed

In order to obtain an accurate reading of test data, run the following command before the first test, to set the cache is invalid:

flush
echo 3 | sudo tee / proc / sys / vm / drop_caches
time time dd if = / path / to / bigfile of = / dev / null bs = 8k
Example notebook

Run the following command:

Debian system notebook with Cache throughput ### ###
dd if = / dev / zero of = / tmp / laptop.bin bs = 1G count = 1 oflag = direct
### ### Failure to make cache
hdparm -W0 / dev / sda
Cache ### no Debian system throughput ### notebook
dd if = / dev / zero of = / tmp / laptop.bin bs = 1G count = 1 oflag = direct

Examples of Apple's OS X Unix (Macbook pro) of

GNU dd has many more options but OS X / BSD and Unix-like dd command need to run as follows to test real disk I / O and not memory add sync option as follows:

GNU dd command has many other options, but in OS X / BSD and Unix-in, dd command like that need to be detected to perform the following to remove the memory address of the synchronization of the hard disk's I / O performance:

## Run this command 2-3 times to get better results ###
time sh -c "dd if = / dev / zero of = / tmp / testfile bs = 100k count = 1k && sync"
Sample output:

1024 + 0 records in
1024 + 0 records out
104857600 bytes transferred in0.165040 secs (635346520 bytes / sec)
real 0m0.241s
user 0m0.004s
sys 0m0.113s
My Macbook Pro's write speed is 635,346,520 bytes (635.347MB / s).

I do not like to use the command line?

You can also message in a Linux-based or using disk utility (gnome-disk-utility) on Unix systems the tool to get. The following figure is on my Fedora Linux v22 VM taken.

Graphical Method

Click on "Activites" or "Super" button to switch between the desktop and Activites view. Enter the "Disks"

Open Gnome hard disk tools

On the left panel, select your hard drive, click on the configure button, and then click on the "Benchmark partition":

Reviews hard disk / partition

Finally, click "Start Benchmark ..." button (you may need to enter the administrator user name and password):

The final evaluation results

If you ask, I recommend using what commands and methods?

I recommend using on all Unix-like systems dd command (time sh -c "dd if = / dev / zero of = / tmp / testfile bs = 100k count = 1k && sync)
If you are using GNU / Linux, the use dd command (dd if = / dev / zero of = / tmp / testALT.img bs = 1G count = 1 conv = fdatasync)
Make sure that every time you use, are adjusted count and bs parameters to achieve better results.
GUI method is only suitable for a desktop system or as Gnome2 Gnome3 of Linux / Unix laptop users.
     
         
       
         
  More:      
 
- Can not remember how to solve the problem under Ubuntu brightness setting (Linux)
- Win8 mount disk partitions under Ubuntu (Linux)
- Tecplot Installation under Linux (Linux)
- Linux password file security issues detailed usage (Linux)
- Simple RPM package production (Linux)
- Volatile keyword in C language understanding (Programming)
- Oracle Linux 6.4 (BOND) dual NIC teaming combat - Annotated (Linux)
- CentOS7 installation hardware monitoring for Zabbix enterprise applications (Server)
- Java Class file format parsing (Programming)
- CentOS environment prepared crontab scheduled tasks (Linux)
- PL / SQL how to make the program every few seconds to insert a data (Database)
- Terminal Linux command prints - echo (Linux)
- Samba public folder permissions (Server)
- Ubuntu install Oracle 10g process and problem solution (Linux)
- Ubuntu 10.10 install Oracle 10g graphic tutorials (Database)
- Linux scp remote file copy (Linux)
- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)
- Subquery Oracle study notes (Database)
- error 1819 (HY000): your password does not satisfy the current policy requirements (Database)
- Use mdadm tool to create software RAID 0 (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.