2008-03-12

MFS

It's been a long time since I first read Michael Lucas's O'Reilly OnLamp article about using the Memory File System on FreeBSD.

Today, we were talking about queuing e-mail messages, and it got me to thinking about the fastest, loosest, most dangerous way to bypass a mail server's write-the-message-to-disk-so-I-don't-lose-it step.

One good way to do it is to mount the message queue in MFS. If anything goes wrong, if the MFS mount gets unmounted, if you lose power, all messages are lost. This is a Very Bad Thing. Since I'm limiting myself to a theoretical exercise, I don't mind: potentially losing imaginary messages is not a factor.

So if want to mount /var/spool/postfix or /var/qmail/queue in MFS, you need to support MFS in your kernel. Lucky for me, OpenBSD supports this in the GENERIC kernel. No heavy lifting required.

# mount_mfs -s 1000000 swap /mnt/path

Done. Typical umount syntax works here as well. I've got my current test setup to use the "noatime" flag as well. Seems to work fairly quickly and it gives me a nice 400+ MB block of space to play with to my heart's content.

No comments: