Benchmark Tests with Linux

From Knowledge Center
Revision as of 08:37, 28 April 2019 by Ruan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Disk IO

1 GB File written

dd if=/dev/zero of=/root/testfile2 bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 10.3055 s, 104 MB/s

512 bytes were written one thousand times

$ 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, 500 KiB) copied, 2.24966 s, 228 kB/s

Write 1GB file with no flags

$ sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.12289 s, 956 MB/s

Read from cached buffer:

$ dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.65436 s, 1.6 GB/s

Clear the cache and read accurate read speeds:

$ sysctl -w vm.drop_caches=3
$ dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.998637 s, 1.1 GB/s

Using HDParm to benchmark read speeds:

$ hdparm -Tt /dev/sda1

/dev/sda1:
 Timing cached reads:   13680 MB in  2.00 seconds = 6856.47 MB/sec
 Timing buffered disk reads: 2162 MB in  3.00 seconds = 720.56 MB/sec

Resources