RoundCube Webmail Performance

For the past few months I’ve been having some major performance problems with RoundCube Webmail on my web host, A2Hosting. RoundCube is a great web mail application and A2Hosting is a fantastic host, but at some point mail access just got sluggish.

This article explains how I traced the source of the problem. Hopefully it can point you in the right direction for diagnosing your own performance issues with RoundCube WebMail.

Troubleshooting Performance in RoundCube Webmail

RoundCube provides a Performance Tuning How-To on their website. I tried a number of their suggestions but none of them seemed to solve the problem, so I set out to fix the issue myself.

Testing Other Access Methods

Next I tried accessing my email through Outlook, which seemed as speedy as ever. I also had the option of accessing my email through Squirrel Mail, so I tried that. Again, access was very fast. At this point it was safe to assume that RoundCube itself was the performance issue, not my network connection or the IMAP server.

MySQL Database Optimization

My third idea was to run an OPTIMIZE on all the database tables used by RoundCube. This had very little effect on it’s performance. Next idea.

Enable RoundCube Logging

My fourth idea (which quite honestly should have been my first) was to use RoundCube’s built-in logging features to diagnose the problem. In the RoundCube main.inc.php configuration file you can enable various levels of logging. I changed lines 16 – 21 as follows:

$rcmail_config['imap_debug'] = true;
$rcmail_config['imap_delimiter'] = '.';
 
// system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
$rcmail_config['debug_level'] = 8;

This configures RoundCube at it’s most detailed logging level. After updating the configuration I checked my email again (to populate the log files with data), then viewed the logs (check the value of the log_dir configuration option in main.inc.php if you’re not sure where your log files are stored. The log files showed a number of SQL errors related to the cache and message tables. This took me full circle, back to the recommendation in the Performance Tuning How-To to disable caching.

What’s important to understand is that caching is really only useful if IMAP and RoundCube are not located on the same physical server, and in fact enabling caching in such an environment can degrade performance. I disabled caching via the enable_caching option in main.inc.php by setting it to false.

Disable caching completely solved my problem. Logging into the system is almost immediate and my folders and emails display lightning fast. After verifying that everything in RoundCube was still working I set my logging settings back to their original values.

Summary

The lesson I hope you take away from this article is to do as I say, not as I did. RoundCube Webmail has some great debugging features and if you’re having any sort of problem, whether it be a total failure of the software, the inability to access your mail, or performance problems, you should use them to diagnose your problems. Had I looked to my log files first I would have immediately found the problem and saved a lot of time and frustration.