Optimize mail storage in Zimbra Collaboration Suite

    In one of our previous articlesdedicated to infrastructure planning during the implementation of Zimbra Collabortion Suite at the enterprise, it was said that the main limitation in the work of this solution is the input / output speed of disk devices in mail storages. Indeed, at the time when several hundred employees of the enterprise simultaneously access the same mail storage, the channel width for writing and reading information from hard drives may not be enough for the responsive service. And if for small Zimbra installations this does not become a particular problem, then in the case of large enterprises and SaaS providers, all this can lead to unresponsive e-mail work and, as a result, reduced employee efficiency, as well as to SLA violation. That is why when designing and operating large-scale Zimbra installations, special attention should be paid to the issue of optimizing the operation of hard disks in the mail storage. Let's look at two cases and try to figure out what methods of optimizing the load on disk storages can be applied in each of them.

    image

    1. Optimization when designing a large-scale Zimbra installation

    At the design stage of a highly loaded Zimbra installation, its administrator has to make a choice which data storage system to use. In order to decide on this issue, you should know that the main load on hard drives is created by the MariaDB DBMS, Apache Lucene search system, as well as the blob storage that are part of the Zimbra Collaboration Suite. That is why for the operation of these software products under high loads it is necessary to use high-speed and reliable equipment.

    Under normal conditions, Zimbra can be installed both on RAID from hard drives, and on storage connected via the NFS protocol. In cases of very small installations, you can install Zimbra on a regular SATA-drive. However, in large installations, all these technologies demonstrate various disadvantages in the form of reduced write speed or low reliability, which is unacceptable for large enterprises, and, especially, for SaaS providers.

    That is why in conditions of large-scale infrastructures Zimbra is best to use SAN. It is she who at the moment is able to provide the greatest bandwidth for storage devices and at the same time, due to the ability to connect a large amount of cache, its use practically does not entail any significant risks for the enterprise. A good idea would be to use NVRAM, which is used in many SANs to speed up recording performance. But it is better to disable caching of recorded data on the disks themselves, since it can lead to irreparable damage to the media and loss of data in case of power problems.

    As for the choice of the file system, the best choice would be to use the standard for Linux Ext3 / Ext4. The main nuance associated with the file system is that it should be mounted with the -noatime option . This parameter will disable the function of fixing the time of the last access to files, which means that it will greatly reduce the load on reading and writing. In general, when creating an ext3 or ext4 file system for Zimbra, the following parameters of the mke2fs utility should be used :

    -j - Create the file system with an ext3 / ext4 journal.
    -L TITLE - To create a volume name, then use it in / etc / fstab
    -O dir_index - To use a hashed search tree to speed up the search for files in large directories
    -m 2 - To reserve 2% of the volume in large file systems under the root directory
    -J size = 400 - To create a large log
    -b 4096 - To determine the block size in bytes
    -i 10240 - For the message store, this parameter should correspond to the average message size. You should carefully consider this parameter, since subsequently its value cannot be changed

    In addition, we recommend that you enable dirsync for blob storage, Lucene search meta data storage, and MTA queue storage. This should be done for the reason that usually Zimbra uses the fsync utility to guarantee that it will write blob with data to disk. However, when the Zimbra mailbox or MTA creates new files during message delivery, it becomes necessary to write to disk the changes that occurred in the corresponding folders. That is why even in the case when the file has already been written to disk using fsync , the record of adding it to directories may not have time to write to the disk and, as a result, may be lost due to a sudden server failure. By using dirsync these problems can be avoided.

    2. Optimization with a working Zimbra infrastructure

    It often happens that after several years of operation of Zimbra, the number of its users increases significantly and the service is becoming less and less responsive every day. The way out of this situation is obvious: you just need to add new servers to the infrastructure so that the service works again as fast as before. Meanwhile, it is far from always possible to immediately add new servers to the infrastructure in order to increase its speed. Often, IT managers have to coordinate for a long time the purchase of new servers with the accounting or security department, in addition, suppliers often fail to bring the new server late or not deliver what is needed.

    Of course, it is best to build your Zimbra infrastructure with a margin in order to always have a margin for its expansion and not depend on anyone, however, if the mistake has already been made, the IT manager can only smooth out its consequences. For example, an IT manager can achieve a small increase in productivity by temporarily disabling Linux system services, which regularly access hard disks during operation and can therefore negatively affect Zimbra’s speed. So, for a while you can disable:

    autofs, netfs - Remote file system detection services
    cups - Print service
    xinetd, vsftpd - Built-in * NIX services that you probably will not need
    portmap, rpcsvcgssd, rpcgssd, rpcidmapd - Remote procedure call services that are commonly used in conjunction with network file systems
    dovecot, cyrus-imapd, sendmail, exim, postfix, ldap - Duplicates of the main utilities included in the Zimbra Collaboration Suite
    slocate / updatedb - Since Zimbra stores each message in a separate file, starting the updatedb service daily can lead to problems, and therefore you can do it manually during least server load

    Saving system resources as a result of disabling these services will not be very significant, but even this can be very useful in conditions close to force majeure. After the new server is added to the Zimbra infrastructure, it is recommended to re-enable previously disabled services.

    It is also possible to optimize Zimbra operation by moving the syslog service to a separate server so that it does not load mail storage hard drives during operation. For these purposes, almost any computer, up to a cheap single-board Raspberry Pi, is suitable.

    For all questions related to the Zextras Suite, you can contact the representative of Zextras Katerina Triandafilidi by e-mail katerina@zextras.com

    Also popular now: