Measuring HD latency in ways relevant to MySQL

As I described yesterday, Open Query is doing some tests on SSDs and other devices pretending to be harddisks (SANs, battery-backed RAID controllers, etc). To aid this, I wrote a small tool to test the different kind of I/O operations MySQL would/could do, which is not quite the same as what other general purpose apps would do, and also not what other test tools measure. For instance, it tries Direct I/O as well as fsync() after each write, and also it a range of different I/O block sizes.

In a nutshell, it’s aimed to do what MySQL does, without MySQL! Testing lots of different setups for this particular purpose (even with fantastic tools like MySQL Sandbox) is a complete pest, and changing InnoDB page size requires a recompile. While Percona has tried a larger page size in the past and decided it wasn’t worth it (the default is 16K), I thought it worthwhile to include such a test as the situation may change over time with different devices.

So, this is a little tool for a very specific purpose, and it should not grow beyond that – but do feel free to abuse it for whatever other purpose you reckon fits a similar approach. Oh, and it outputs CSV for easy graphing. To grab the code, go to the hdlatency project on Launchpad. It’s plain C, and GPLv3 licensed.

5 Responses to “Measuring HD latency in ways relevant to MySQL”

  1. How is the workload different than sysbench fileio?

  2. Cool.

    I have found one of the better ways is actually using some of the code we use in waffle, we actually track how long each read request take to retrieve a page from disk, which is really really interesting to see.

  3. You might want to have a look at Oracle’s tool ORION – it does IO benchmarking based simulating various random small and large IO’s (according to the settings) like any database would do. ORION doesn’t require anything to install – just one binary.

  4. Interesting to see indeed, but it does require a specific MySQL installation.
    Also, it does not test different aspects of I/O, not all I/O done by MySQL is the same.

  5. Hi Mark! Possibly not much.
    It’s just a neat wrap of all stuff that MySQL does in a single run, with CSV output. Also the tool itself is small and has no dependencies, so it’s easy to get on to and run in environments where installing more stuff is either disallowed or unpractical.
    But it’s not a new wheel as such.

Leave a Comment