Search This Blog


Disk Performance with dd

Write Performance

UPDATE 2015-12-31

There is also a method of testing disk performance which ensures each write is committed to disk prior to issuing the next write
dd bs=1M count=256 if=/dev/zero of=test oflag=dsync

dd if=/dev/zero of=/filesystem.dd bs=1M count=10000 conv=fdatasync,notrunc

This tells dd to require a complete “sync” once, right before it exits. So it commits the whole of the data, then tells the operating system: “OK, now ensure this is completely on disk”, only then measures the total time it took to do all that and calculates the benchmark result.

Read Performance

Clear caches:
echo 3 > /proc/sys/vm/drop_caches

Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.

To free pagecache:
echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation, and dirty objects are not freeable, the user should run "sync" first in order to make sure all cached objects are freed.

Then run your read tests:

dd if=/filesystem.dd of=/dev/null bs=1M count=10000


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.