Tmpfs for amavisd-new: Difference between revisions

No edit summary
No edit summary
 
Line 1: Line 1:
{{BC|Community Sandbox}}
__FORCETOC__
<div class="col-md-12 ibox-content">
=Tmpfs for amavisd-new=
{{KB|{{Unsupported}}|{{ZCS 7.0}}|{{ZCS 6.0}}|}}
{{WIP}}
{{WIP}}
'''It is highly advised to see http://wiki.zimbra.com/wiki/SpamAssassin_Customizations#2._Put_Amavis.27s_Temp_Dir_on_a_RAM_Disk'''
'''It is highly advised to see http://wiki.zimbra.com/wiki/SpamAssassin_Customizations#2._Put_Amavis.27s_Temp_Dir_on_a_RAM_Disk'''
This wiki is outdated.
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 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.'''
__TOC__
=Note=
=Note=
This is not a Zimbra feature. I've documented the steps here just for reference who require amavisd with tmpfs. Please check [http://bugzilla.zimbra.com/show_bug.cgi?id=13607 Bug 13607] and [http://bugzilla.zimbra.com/show_bug.cgi?id=8081 Bug 8081] for more details.
This is not a Zimbra feature. I've documented the steps here just for reference who require amavisd with tmpfs. Please check [http://bugzilla.zimbra.com/show_bug.cgi?id=13607 Bug 13607] and [http://bugzilla.zimbra.com/show_bug.cgi?id=8081 Bug 8081] for more details.
Line 46: Line 48:
   zmamavisdctl start
   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.
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.
{{Article Footer|Zimbra Collaboration 8.0, 7.0|04/16/2014}}

Latest revision as of 10:11, 13 July 2015

Tmpfs for amavisd-new

   KB 15185        Last updated on 2015-07-13  




0.00
(0 votes)

It is highly advised to see http://wiki.zimbra.com/wiki/SpamAssassin_Customizations#2._Put_Amavis.27s_Temp_Dir_on_a_RAM_Disk 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.

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

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

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.

Verified Against: Zimbra Collaboration 8.0, 7.0 Date Created: 04/16/2014
Article ID: https://wiki.zimbra.com/index.php?title=Tmpfs_for_amavisd-new 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