3

I've bee looking into the possibility that my server is experiencing a lot of iowait issues. I've found a lot online about running the dd command. I am unable to run this conv:

[root@vps ~]# dd if=/dev/zero of=/tmp/test bs=64k count=16k conv=fdatasync
dd: invalid conversion: `fdatasync'
Try `dd --help' for more information.

I also tried without the conv and I don't get statistics like most of the postings I see from other people. Can someone explain why this is the case?

[root@vps ~]# dd if=/dev/zero of=/tmp/test bs=64k count=16k
16384+0 records in
16384+0 records out
2
  • What statistics do other people see? dd seems like the wrong tool. Sar would show you better info about io waits. May 14, 2011 at 1:23
  • @MarkWagner, When you say dd seems like the wrong tool, are you saying that romanrm.net/dd-benchmark is wrong?
    – Pacerier
    May 2, 2015 at 12:04

2 Answers 2

4

Try dstat or iostat with SWAT or Cacti for charting. (This is assuming you're not using Solaris, OpenIndiana or variants in which case you'd use Dtrace.)

http://freshmeat.net/projects/dstat/?branch_id=54241&release_id=251831

http://blogs.oracle.com/paisit/entry/import_iostat_data_to_swat

http://forums.cacti.net/post-170326.html

Also look at:

ioapps - http://code.google.com/p/ioapps/

strace_analyzer - http://clusterbuffer.wetpaint.com/page/Strace+Analyzer+-+Next+Generation

strace_analyzer tutorial - http://www.linux-mag.com/id/7730/1/

0

Your dd version apparently does not support the fdatasync conversion. If you can't get the statistics out of it, you might perform your own calculations by using something like

time sh -c "dd if=/dev/zero of=/tmp/test bs=64k count=16k && sync"

this will give you the total amount of time needed for writing and syncing - you can just divide the amount of data (1 GB in your example) by the amount of time to calculate the mean write rate.

3
  • 2
    Unfortunately, the sync command will flush all data, which can be waaay more than the 1GB from dd when the server is loaded.
    – Turbo J
    May 14, 2011 at 3:06
  • 1
    If you use oflag=sync it will use synchronized I/O for all data and metadata writes. Or you could use oflag=direct to use direct I/O. This is better than using dd ... && sync, as per Turbo J's comment. It also means you can trust dd's time/speed calculations: "dd if=/dev/zero of=/tmp/test bs=64k count=16k oflag=sync" May 14, 2011 at 3:15
  • Data in write caches is typically written to platters within a few seconds anyway, writing 1 GB is likely to flood the caches and benchmark calculations are typically taken when the system is idle. So unless you have vast write caches, multiple devices which have been written to during your benchmarks or extremly high transfer rates to expect, just doing a "sync" is a good enough estimate. BTW, the poster's "dd" did not spit out any calculations - that's why he might to use "time" in the first place.
    – the-wabbit
    May 14, 2011 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .