Question on Amavis and ramdisk

Mark Martinec Mark.Martinec+freebsd at ijs.si
Mon Aug 21 13:23:42 UTC 2017


2017-08-21 14:47 Willem Jan Withagen wrote:
> In the amavis rc.d file is noted:
> "========================================================"
> "WARNING: using ramdisk is reported to be unstable and"
> "thus it is highly recommended to be turned off."
> "========================================================"
> 
> And this warning seems there since 2012....
> 
> Is this warning still valid?
> And if YES, could somebody try and enlighten me as to what is unstable
> on this config?
>   - Is the ramdisk itself unstable?
>   - Or is it the fact that upon a crash de ramdisk is lost and email
>     might be lost?

I don't really know what was the reason for this warning, but I can
guess that it's because the port creates a mdmfs ram disk of a fixed
size for the %%AMAVISDIR%%/tmp file system, and any fixed size small
disk may eventually run out of space, either during some peak mail
traffic rush-in, of perhaps when soma stale temporary files happen
to be left undeleted and accumulating, while this goes unnoticed
for some time.

Using tmpfs instead of mdmfs could avoid some of the above concerns
if you really want to use a ram disk. In my experience with a
modern host and file systems, especially with SSD, there is no longer
any substantial speedup by using a ram disk instead, so I don't
think it is worth sacrificing memory for a ram disk, which could
better be used by file system caches etc.

>   - Or is it the fact that upon a crash de ramdisk is lost and email
>     might be lost?

No, mail should not be lost. Write failures would be noticed and
a feeding mailer would receive a temporary failure (smtp status 450),
so mail should stay in the mailer's queue for a later retry.
But left unattended for days, this would result in mail non-delivery
notification to the sender.

   Mark


More information about the freebsd-ports mailing list