Friday, September 26, 2008

Linux Elevator Algorithm

There has been much debate over elevator algorithms concerning the 2.6 kernel.  For a database system, deadline and CFQ seem to be the most debated.  For a small database with relatively few drives in a RAID array, and relatively small memory, deadline works best.  One of my systems has a 48 x 15k drive SAS RAID array.  When you combine over 2GB/s of throughput, 128GB of memory, command queuing, etc - latency isn't the issue.  Leveraging caches to get a sequential R/W load is dramatically more important.  CFQ does this via implementation of R/B trees ordered by sector.  If you're periodically reshuffling the deck based on time expiration (deadline), you end up seeking all over the disk. 

Converting high performance servers to CFQ over deadline resulted in a 10-30% performance bump depending on load.

OLTP servers might have different experiences, but CFQ in an OLAP environment appears to be the way to go.  (for us! haha)

No comments: