Tmpfs for amavisd-new

Tmpfs for amavisd-new

   KB 15185        Last updated on 2015-07-13  

(0 votes)

It is highly advised to see This wiki is outdated. This document gathers steps required to configure amavisd to use a ramdisk for its temporary data processing. The steps are specific to RHEL servers running Zimbra 6.x or higher.


This is not a Zimbra feature. I've documented the steps here just for reference who require amavisd with tmpfs. Please check Bug 13607 and Bug 8081 for more details.


Amavisd-new's speed may be limited by the speed and latency of your disk I/O, which can causes huge active mail queue, with a very limited delivery rate. Moving amavisd tmp directory to ramdisk will eliminate disk read/write operations. It can make a lot of difference in amavisd mail processing speed.


1. You need a kernel that is capable of creating and using a tmpfs filesystem

2. Zimbra 6.x or higher installed on the server.


Warning: Following is just an example. Actual sizing for tmpfs vary on several factors like number of compressed attachments, number and size of attachments etc. You need contact zimbra PS for optimal sizing suggestions based upon your environment.

If you run n amavisd-new instances and each one accepts mails of the size defined in zimbraMtaMaxMessageSize, then the tmpfs of size will be:

 n * (1 + max(expansionfactor)) * $zimbraMtaMaxMessageSize 

n = "max_servers" option configured in /opt/zimbra/conf/amavisd.conf file. By default it set to 10.

zimbraMtaMaxMessageSize = It is a global config option in zimbra. It sets value for postconf message_size_limit. By default it is set to "10240000".

So for a default zimbra install, tmpfs size will be:

10 instances * 10MB (zimbraMtaMaxMessageSize) = 100 MB

The unpacked mail: 10*10 MB raw mail size become about 10*8 MB binary size, unpack at ratio 1:2, become 160 MB

Hence the size will be 100 + 160 = 260 MB


1. Create a tmpfs entry in /etc/fstab

 /dev/shm   /opt/zimbra/data/amavisd/tmp   tmpfs defaults,noexec,nodev,nosuid,size=150m,mode=750,uid=502,gid=503 0 0

uid and gid will be zimbra user's gid/uid. Check for it in /etc/passwd

2. Stop zmamavisdctl.

 zmamavisdctl stop

3. Mount the ramdisk.

 mount /opt/zimbra/data/amavisd/tmp

4. Start zmamavisdctl.

 zmamavisdctl start

Check using "mount" command if the ramdisk is mounted at /opt/zimbra/data/amavisd/tmp. You can also check for logs in /var/log/zimbra.log if there are any errors.

Verified Against: Zimbra Collaboration 8.0, 7.0 Date Created: 04/16/2014
Article ID: Date Modified: 2015-07-13

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search