テストステ論

高テス協会会長が, テストステロンに関する情報をお届けします.

(writeboost report) ONLY stacking Writeboost on your HDD gets you to free lunch again!

I am really surprised with this result so I share this latest benchmark results, which is amazing to you.

In write-back, Writeboost firstly reads out N segments from cache device (typically SSD) and secondly sorts the blocks in them by destination LBA (say, N * 128 4KB blocks) and then lastly writes all them back to the backing device (typically HDD) in asynchronous manner.

Because the blocks are sorted, the patten is nearly sequential, or at least more effective than pure random writes.

This test is to see how this optimization effects.

We compare pure HDD w/ or wo Writeboost stacked in a way of consuming 4KB random writes to the HDD persistent medium.

  # Writeboost sorts in writeback.
  # This test is to see how the sorting takes effects.
  # Aspects
  # - Does just stacking writeboost can always boost write.
  # - How the effect changes according to the nr_max_batched_migration tunable?
  def test_writeback_sorting_effect

    def run_fio(dev)
      fs = FS::file_system(:xfs, dev)
      fs.format
      dir = "./fio_test"
      fs.with_mount(dir) do
        Dir.chdir(dir) do
          ProcessControl.run("fio --name=test --rw=randwrite --ioengine=libaio --direct=1 --size=64m --bs=4k --ba=4k --iodepth=32")
        end
        ProcessControl.run("sync")
        drop_caches
      end
    end

    def run_wb(s, batch_size)
      s.cleanup_cache
      s.table_extra_args = {
        :nr_max_batched_migration => batch_size,
      }
      s.activate_top_level(true) do
        report_time("writeboost batch_size(#{batch_size})", STDERR) do
          run_fio(s.wb)
          # For Writeboost,
          # we wait for all the dirty blocks are written back to the backing device.
          # The data written back are all persistent.
          s.wb.message(0, "drop_caches")
        end
      end
    end

    s = @stack_maker.new(@dm, @data_dev, @metadata_dev, :cache_sz => meg(65))
    s.activate_support_devs do
      [4, 32, 128].each do |batch_size|
        run_wb(s, batch_size)
      end
      report_time("backing ONLY", STDERR) do
        run_fio(s.backing_dev)
      end
    end
  end

And this is the result:

Elapsed 61.329199777: writeboost batch_size(4)
Elapsed 36.761916445: writeboost batch_size(32)
Elapsed 27.058421746: writeboost batch_size(128)
Elapsed 85.989786731: backing ONLY

What this result says is that "just" stacking Writeboost with a small device can boost writes at least 1.4 times and at most 3 times in your system. The clock of CPU stopped its increase long time ago, and today I give you free lunch again in storage system.

Try stack Writeboost in your system. Writeboost is already merged into Joe's thin-dev branch and you can access there at his Github repo (https://github.com/jthornber/linux-2.6).

Writeboost has a great potential to change everything in storage system. No shabby optimization in filesystem will be gone and just stack Writeboost with simple filesystem like ext3 is our direction.