2 ms·
PostgreSQL is a bit of a hybrid in terms of scheduling. It has its own disk cache but still goes through the kernel mechanisms. Classic database I/O schedulers
by jandrewrogers 12y ago
PostgreSQL is a bit of a hybrid in terms of scheduling. It has its own disk cache but still goes through the kernel mechanisms. Classic database I/O schedulers are not portable so it is a bit of a challenge to implement one in big open source projects for reasons outside of technical ability.
With proper cache and I/O scheduler, the same workload will fit in memory, so the only way the disk gets in the way is if the I/O scheduling does something suboptimal with respect to writes (which happens a lot with the kernel caching behavior).
Modern database servers typically have more disk bandwidth than network bandwidth and therefore most write workloads should be able to go through storage at the network's wire speed, at least in theory. In practice, I/O scheduling behavior from memory to storage tends to be bursty or poorly timed. Consequently, the instantaneous I/O bandwidth requirements can exceed the effective disk bandwidth for brief periods and performance degrades.
A really good database I/O scheduler, cache, and execution engine work together to basically makes sure that peak bandwidth demands to the disk subsystem are never much worse than the network wire speed. Achieving this is not trivial and requires a lot of clever dynamic resource optimization but many sophisticated database engines implement this to some degree or another.