time - Disk read/write perfomance in linux -


i wanted check read/write performance of disk. executing below command write file

time dd if=/dev/zero of=/home/test.txt bs=2k count=32k; 

which gives 400mb/s

for checking read performance have executed below commands.with , without 'of' parameter. there huge difference between results

time dd if=/home/test.txt of=/dev/zero bs=2k (gives 2.8gb/s)  time dd if=/home/test.txt bs=2k  (9mb/s) 

i read "of=/dev/zero" used read data temp file while creating file.

but why required while checking read performance , why there huge difference in speed , without "of=/dev/zero"

/dev/zero special file. it's contents stem device driver. write operations on /dev/zero guaranteed succeed. bit more here , here

without specifying of dd prints stdout. data terminal receives has formatted , printed. terminal you're using bottleneck performance of drive.

also if stands input file, likewise of means output file.

edit:

writing /dev/zero can have unexpected results. wouldn't accurate way of measuring read performance.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -