logoalt Hacker News

dale_glasstoday at 2:42 PM3 repliesview on HN

I wonder why this is not more common. LVM is easy to set up, and it's already common to allocate volumes for things like disk images for VMs, so why not databases?


Replies

jandrewrogerstoday at 4:40 PM

Some Linux filesystems, notably ext4 and XFS, provide the necessary features to get 90% of the benefit simply by using O_DIRECT correctly. The last 10% is achieved by doing direct I/O to raw block devices, with the obvious caveat that this is not as easy to manage.

Both of these are commonly done in database storage engines.

tptacektoday at 3:59 PM

If you preallocate and O_DIRECT, haven't you basically soaked up most of the benefit of skipping the filesystem?

pizza234today at 3:04 PM

Because the speed increase is - on modern, properly tuned filesystems - surprisingly small, due to how RDBMS's manage their pool; by working on large container files, they avoid most of the filesystem overhead.