Mailscanner Disk Layout - best practice for performance?

Conz conz at b0x.nl
Sat Dec 13 14:56:26 UTC 2025


Hi,

 

I have the following in my fstab:

tmpfs   /var/spool/MailScanner/incoming tmpfs rw,size=256M 0 0

 

I forgot if the installer put it there or if I put it there lol, this
machine has been constantly updated since 2017.

 

Few things to consider:

Power loss/hard reset means anything in the queue is gone.

Ram/tmpfs disk size determines maximum size of what can be in the queue. If
you have a high volume where the queue often builds up you might have to
scale to fit. Mine is very low volume and the 256MB is oversized. The whole
server only has 6Gb of ram. 

I can't fully recall but a setup I used to manage from around 06 that did
about 20-30k emails a day I think had a 512Mb ramdrive, its 10k disks and 4
core xeon could not keep up with the AV scanning back when multiple scanners
still existed for Linux (I think I had 3).

 

So, this'll depend a little on what sort of setup you have or are getting,
like if its virtual or physical.

Anything cloud, like your test setup, ramdrive absolutely because you'll
probably get a fat bill otherwise.

Anything virtual on premise and you'll want the ram drive or your hypervisor
admin will get mad at you.

Physical with spinning disks, also ram drive. 

Physical with nvme will be up for debate. There's the wear thing but it
should be fine .. but considering the small amount of ram you need it'll
depend on how bad a loss of email is to you.

Any modern hardware with a physical install and it might also be an idea to
just have a pair of small cheap nvme's in raid 1 if the idea of possibly
losing emails is a problem for you. The cheaper the better so you can just
have a spare on the shelf.

 

Also, be sure to look at grey-listing if you get more than 2-3k e-mails a
day, including spam. 

That'll have more positive impact on your server load than a ramdisk. The
only downside is that there will be a few minutes delay for the first legit
email from an unknown server and spam learning might be affected in a
negative way if too much is blocked before getting scanned. I have had this
problem.

And don't forget to look at all the other stuff too like DKIM. 

Anything that can be kicked out BEFORE spamassassin or the AV has to do
anything is 'resource profit' and more free cycles to deal with spam that
got through :-)

 

Iirc there is also some decent scaling information available on the
mailscanner site or the book Julian wrote. You don't need a lot, but
obviously It scales with volume.

 

Hope this helps.

 

Verzonden: vrijdag 12 december 2025 19:43
Aan: 'MailScanner Discussion' <mailscanner at lists.mailscanner.info>
Onderwerp: Mailscanner Disk Layout - best practice for performance?

 

We're running a beta testing MailScanner with Mailwatch  and postfix using
Ubuntu 24  LTS on an  AWS  M6a.xlarge instance with 16G ram. 

 

Before going live, I want to split out the disks for best performance.

Where do you see the highest disk utilization?

 

With 16G ram I could squeak out a small ramdisk. Also have the option to go
to provisioned IOPS although that gets expensive fast. 

 

 

Thanks for any suggestions!

 

 

 

MailWatch Version: 1.2.23

Operating System Version: Ubuntu 24.04.3 LTS (Noble Numbat)

Postfix Version: 3.8.6

MailScanner Version: 5.5.3

ClamAV Version: 1.4.3

SpamAssassin Version: 4.0.0

PHP Version: 8.3.6

MySQL Version: 10.11.13-MariaDB-0ubuntu0.24.04.1

GeoIP Database Version: No database downloaded

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mailscanner.info/pipermail/mailscanner/attachments/20251213/747d08c4/attachment.htm>


More information about the MailScanner mailing list