Frank DENIS random thoughts.

STF scheduler for OpenBSD

Since efficient disk I/O scheduling is something critical to any busy host, I spent some spare time playing again with the OpenBSD scheduling policy.

As a first experiment, the default one-way elevator was replaced by a STF elevator. By the way, bufs are now taken out of queues through a wrapper function (disksort_get()) instead of reinventing the wheel for ATA, SCSI, Swap, etc.

You can download the patch against OpenBSD-current here : OpenBSD alternative I/O scheduler

The first benchmarks and live results are exciting. Blogbench, iozone and bonnie++ clearly show improvements over the default OpenBSD scheduler, although I only tried on IDE disks. WIth the STF scheduler, Blogbench yields a final score of 72 (for writes) and 5064 (for reads) on a french UFS2 filesystem, while the default scheduler peaks at 60 and 4934. Preliminary MySQL benchmarks also show improvements although only MyISAM was tested so far.

There are still tons of improvements that should go in. Going from STF to SATF, maybe, although I’m not convinced that it can be made in a generic way that would work with RAID arrays. Prioritizing requests (favor reads over writes, favor synchronous over async writes, delayed requests from processes with niceness above NZERO, deadline) will probably be the next step.