Optimizing Zimbra Servers CPU Wait Time

CPU stat illustration

CPU stat illustration

Yesterday, I was complained about our mail server’s performance.

At first, I checked the disk space and everything’s OK. From server statistics, I found that the processed messages (sending and receiving) was about a hundred per minute.

Then I checked the load of the server using top command, and the result showed that the CPU wa percentage was quite high, about 30 to 60 %.

Based on some references on the internet, it mainly was caused by amavisd service which is doing read and write operation  from and to disk. It’s better to change the location of amavisd temporary folder (/opt/zimbra/data/amavisd/tmp) to RAM disk.


Then I did these steps:

  1. zmcontrol stop as zimbra user
  2. Add the following line to /etc/fstab:

/dev/shm /opt/zimbra/data/amavisd/tmp tmpfs defaults,size=200m,mode=700,uid=2003,gid=2000 0 0



/dev/shm : the RAM disk device

/opt/zimbra/data/amavisd/tmp : the mount point (amavisd temporary folder)

size=200m : folder size

mode=700 : only zimbra user can do read, write, and execute

uid=2003,gid=2000 : UID and GID of amavis (usually same to zimbra user)


After restarting the server and starting the zimbra services (zmcontrol start) I found that the CPU wait time  now is about 5 to 20% and the performance seems better and faster 🙂



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: