In April 2025 I opened a Support Case with Zimbra, which resulted in Zimbra issuing ZBUG-4827: Contact Ranking fetch causing slowness. This is an AutoComplete (Contacts Ranking Database) bug. This blog post will help you identify if your Zimbra system is subject to this bug, and your options for addressing the issue, until Zimbra issues a fix.
Technical Background
Zimbra maintains a per-user contact ranking database hidden from users. It’s used when composing a new email, inviting someone to attend a meeting, or anywhere else where Zimbra starts suggesting email addresses for you to use. When users have thousands of contacts in their Address books (at this writing, it seems that thousands of contacts in Emailed Contacts is a common observation), it is more likely that autocomplete will take longer to finish. The autocomplete processing uses lots of CPU, but since it should only last a second, if that, it’s not normally an issue.
In our case, we were observing users with only like 4,500 contacts or so in their address books have to wait more than an hour for the autocomplete to continue, during which time CPU usage was pegged at 100% and a few other (mostly “power”) users would sometimes notice the web client was not as snappily responsive as it usually was.
Discovery Activities
We sent Zimbra Support several zmdiaglog outputs generated while CPU was pegged at 100%. Zimbra Support quickly found entries in mailbox.log like:
2025-04-17 14:05:13,663 INFO [qtp1150284200-117586] [name=user@domain.com;mid=612;oip=xxx.xxx.xxx.xxx;port=41182;ua=ZimbraWebClient - FF137 (Win)/10.0.13_GA_4736;soapId=3fb74dfb;] gal - autocomplete: overall=4604559ms, ranking=2305295ms, folder=2299264ms, gal=0ms
Of course, the user above didn’t wait more than an hour for autocomplete to finish; they just kept typing the required email address and sent the email, meeting invite or whatever. But the autocomplete process kept processing on in the background until it finished, consuming every available CPU cycle along the way.
Zimbra Support’s Recommendations
Zimbra recommended we turn off autocomplete entirely on any mailstore that has this issue. You can do that by running:
su - zimbra zmlocalconfig -e contact_ranking_enabled=false zmmailboxdctl restart
This is a key productivity-enhancing feature of Zimbra; we were not keen to turn this feature off entirely if it was only a handful of accounts that were causing the issue on each mailstore. We found this wiki article which aligned with Zimbra Support’s additional recommendation to reset each impacted user’s per-user contact ranking database. To reset a user’s contacts ranking database, you can simply do:
su - zimbra zmsoap -z -m user@domain.com RankingActionRequest/action @op=reset
But, to do that, you need to know which users’ contacts ranking database needs to be reset.
Our Approach
While Zimbra gave us the name of one account from their investigation of just one of our mailstores, we wanted to identify all of the accounts on all of our mailstores where this was an issue. So we created a simple zgrep command to look through all of the available mailbox.log* files on a mailstore, to identify the users where an autocomplete was taking longer than 2 seconds, and; also count how many times such long-running autocompletes were happening. Here’s the command and representative output from one of our mailstores:
zimbra@mb31:~$ zgrep -E "autocomplete: overall=([2-9][0-9]{3,}|[0-9]{5,})ms" ~/log/mailbox.log* | grep -o "name=[^;]*" | sort | uniq -c | sort -nr 143 name=user1@domain.com 90 name=user2@otherdomain.com 51 name=user3@domain.com 15 name=user4@athirddomain.com zimbra@mb31:~$
Great! We then ran the four zmsoap commands for each of the accounts above, and haven’t seen a CPU spike since.
Wrap-Up (As of April 2025)
Zimbra Support quickly identified the root cause of the CPU spike and is now working on the root cause of the issue. Within a few days, you should be able to follow Zimbra’s progress on pm.zimbra.com and if this bug is important to your environment, vote for the bug to get its fix prioritized higher. In the interim, you have two workarounds above.
If you need professional services help improving the performance of your Zimbra environment, just fill out the contact form and we’ll be right back in touch!
Hope that helps,
L. Mark Stone
Mission Critical Email LLC
22 April 2025
The information provided in this blog is intended for informational and educational purposes only. The views expressed herein are those of Mr. Stone personally. The contents of this site are not intended as advice for any purpose and are subject to change without notice. Mission Critical Email makes no warranties of any kind regarding the accuracy or completeness of any information on this site, and we make no representations regarding whether such information is up-to-date or applicable to any particular situation. All copyrights are reserved by Mr. Stone. Any portion of the material on this site may be used for personal or educational purposes provided appropriate attribution is given to Mr. Stone and this blog.