Академический Документы
Профессиональный Документы
Культура Документы
https://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance...
Contents
1 Basics
2 Measuring Write Performance
2.1 Laptop Example
2.1.1 Laptop Throughput (Streaming I/O)
2.1.2 Laptop Latency
2.2 Server with RAID10 Example
2.2.1 Server Throughput (Streaming I/O)
2.2.2 Server Latency
3 References
Basics
can be used for simplified copying of data at the low level.[1] In doing this, device files are often
access directly. Beware that erroneous usage of dd can quickly lead to data loss. We absolutely
recommend performing the steps described below on test systems. If dd is used incorrectly, data
loss will be the result.
dd
1 de 4
4/11/16 9:12 PM
https://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance...
For measuring write performance, the data to be written should be read from /dev/zero[2] and ideally
written it to an empty RAID array, hard disk or partition (such as using of=/dev/sda for the first
hard disk or of=/dev/sda2 for the second partition on the first hard disk). If this is not possible, a
normal file in the file system (such as using of=/root/testfile) can be written. For safety reasons we
are using test files in the following examples. The write performance achieved thereby will be a little
slower (because metadata will also be written to the file system).
Important: When writing to a device (such as /dev/sda), the data stored there will be lost. For that
reason, you should only use empty RAID arrays, hard disks or partitions.
Note:
When using if=/dev/zero and bs=1G, Linux will need 1GB of free space in RAM. If your test
system does not have sufficient RAM available, use a smaller parameter for bs (such as
512MB).
In order to get results closer to real-life, we recommend performing the tests described several
times (three to ten times, for example). By doing so, you can quickly detect outliers
(http://en.wikipedia.org/wiki/Outlier). Such outliers can include cron jobs, interrupts or general
conditions due to parallel processing, which can all briefly affect performance. An extreme
example, which clarifies this issue, would be the parallel execution of updatedb by a cron job.
Laptop Example
In this example, the test data will be written to /root/testfile. The test system (a Thinkpad T43 Type
2668-4GG) had 1.5 GByte of RAM and a Fujitsu MHT2060AH hard disk rotating at 5,400 rpm.
Laptop Throughput (Streaming I/O)
One gigabyte was written for the test, first with the cache activated (hdparm -W1 /dev/sda):
root@grml ~ # dd if=/dev/zero of=/root/testfile bs=1G count=1 oflag=direct
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 32.474 s, 33.1 MB/s
root@grml ~ #
Laptop Latency
In this test, 512 bytes were written one thousand times, first with the cache activated (hdparm -W1
/dev/sda):
root@grml ~ # dd if=/dev/zero of=/root/testfile bs=512 count=1000 oflag=direct
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.36084 s, 1.4 MB/s
root@grml ~ #
2 de 4
4/11/16 9:12 PM
https://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance...
Then, with the cache deactivated (hdparm -W0 /dev/sda): One thousand accesses required 11.18
seconds, meaning one access took 11.18 ms.
root@grml ~ # dd if=/dev/zero of=/root/testfile bs=512 count=1000 oflag=direct
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 11.1865 s, 45.8 kB/s
root@grml ~ #
Server Latency
In this test, 512 bytes were written one thousand times. Thereby, the 0.084 seconds that were
measured for one thousand accesses corresponded to precisely 0.084 ms for each access. This value is
so low because of the RAID controllers cache:
test-sles10sp2:~ # dd if=/dev/zero of=/root/testfile bs=512 count=1000 oflag=dsync
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.083902 seconds, 6.1 MB/s
test-sles10sp2:~ #
References
1. Dd (Unix) (http://en.wikipedia.org/wiki/Dd_(Unix)) (en.wikipedia.org)
2. /dev/zero (http://en.wikipedia.org/wiki//dev/zero) (en.wikipedia.org)
3 de 4
4/11/16 9:12 PM
https://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance...
Related articles
HA Cluster with Linux
Containers based on Heartbeat,
Pacemaker, DRBD and LXC
Linux Storage Stack Diagram
Updates with LXC 1.0
Show article
Show article
Show article
Retrieved from "https://www.thomas-krenn.com/en/wikiEN/index.php?title=Linux_I
/O_Performance_Tests_using_dd&oldid=3014"
Categories: Linux Linux Performance
4 de 4
4/11/16 9:12 PM