Tmpfs for amavisd-new: Difference between revisions
No edit summary |
m (moved Creating tmpfs for amavisd-new to Tmpfs for amavisd-new) |
(No difference)
|
Revision as of 14:06, 10 August 2011
This document gathers requirement and 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.
Note
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.
Requirement
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.
Pre-requisites
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.
Sizing
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
Steps
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.