I'm in the process of configuring postfix on my server and I was wondering why people do not run the postfix queues from a ram disk?
The default home directory containing all the queues is (for the Ubuntu distribution) /var/spool/postfix
. This of course is a folder which exists on hard disk under normal circumstances.
The basic answer which I've found from Google is that it protects against mail getting lost if the server crashes.
The question this still leaves me with is this: If the server did crash and the postfix queues were being stored on disk, would they not most likely be lost due to the kernel's internal hard disk caching. From what I understand, these files are pretty short lived. I'm struggling to see the difference between this and running more explicitly in RAM and saving to HD as postfix is shut down cleanly.
Have I missed something obvious here?
As part of postfix returning a
250
"accepted" code to the sending server, it is communicating to that server that it has truly accepted the message, and that the sending server can forget about it. This means that postfix will have already written the file to disk.I would highly recommend not using a ramdisk for your queues - if need be, throw in a pair of SSDs in a RAID1 array. They should provide plenty of IOPs for you.