|Version 7 (modified by alec, 3 years ago) (diff)|
There are many configuration options with inpact on performance in Roundcube. As Roundcube installation administrator you can set them to some defaults and prevent users to change them by using the 'dont_override' option.
Here's the list of options with impact on performance
Messages listing is a main task of a mail client. Sorting is expensive. First of all you should use an IMAP server with SORT capability. If message list displaying is still too slow you should set 'message_sort_col' to an empty string ('None' in messages list menu). The order (ASC/DESC) is not important.
'pagesize' (and 'max_pagesize')
To display message subjects/senders/dates/etc., Roundcube fetches the headers. So, to increase performance, don't set 'pagesize' too high.
To keep the IMAP session open, Roundcube is sending a request to the IMAP server every 'keep_alive' seconds. When a user has a mail task window open, Roundcube will also check for new mail using this interval. To decrease the load, don't set this too low.
This really slows things down. With 'skip_deleted' enabled, Roundcube needs to check the status of each message when displaying the list, count the messages, etc. E.g. to count all messages in a folder we must call SEARCH ALL UNDELETED instead of simple SELECT. The same with messages listing: SEARCH instead of the faster SORT or even direct FETCH.
Usually Roundcube searches for recent messages in INBOX. You can configure it to check all folders, but e.g. if you you have many folders and especially when you also have 'skip_deleted' (see above) active, this is very expensive. Even more so if your IMAP server does not use indexing.
Displaying a message in preview_pane is less expensive, because in "full window" mode Roundcube will need to update page controls and message counters on every page load.
With enabled caching, Roundcube stores message counts, folder list and message headers in the database. You should consider enabling this if access to your database server is faster than access to the IMAP server. The caching is not always faster though, and cache update operations are expensive.
If, with enabled caching, your database is growing too fast, you can lower the lifetime to not store old messages.
If you know what type of authorization your IMAP and SMTP servers are using, you can speed up the connection process by setting this. E.g. if 'imap_auth_type' is set to 'check' (default), Roundcube will detect the auth method. It will try to authorize using CRAM-MD5 if supported and finally fall back to PLAIN. As you see, you can skip two steps if your server only allows PLAIN login (for security you should only do this when Roundcube runs on the same server as the IMAP service, or when the connection is secure).
If you know your imap's root directory and its folder delimiter, you can specify them here. This will save one NAMESPACE and one LIST call.
If your server is under heavy load, you should probably disallow doing clean up on every logout.
Use a caching IMAP proxy
If you are experiencing delays when clicking on a message or folder (>0.5 sec) try adding a caching IMAP proxy on the webserver. Roundcube creates a new IMAP connection (which is expensive) every time a user clicks on a message. A caching IMAP proxy will reuse IMAP connections on a per user basis. There are reports of performance going from ~3 sec per click, to ~0.5 sec per click. ImapProxy is a GLD'd IMAP proxy that is easy to use and works great for Unix-like OSes.
Messages threading is an expensive operation. Use IMAP server with THREAD=REFS capability (e.g. dovecot 1.2) for best performance.
Disable SSL for IMAP/SMTP
If your IMAP/SMTP servers are on the same host or are connected via a secure network, not using SSL connections improves performance.
Disable TLS for SMTP connections (on the same host)
It is not possible in Roundcube (before 0.4 version) to force unencrypted connections to the SMTP server. If the server returns the STARTTLS capability, a TLS connection will be established. If Roundcube runs on the same host as the SMTP server, disabling TLS is safe and will improve performance.
In Postfix 2.2 or later, you can do this with 'smtpd_discard_ehlo_keyword_address_maps' (http://www.postfix.org/postconf.5.html#smtpd_discard_ehlo_keyword_address_maps)
smtpd_discard_ehlo_keyword_address_maps = hash:/etc/postfix/discard_ehlo
and in /etc/postfix/discard_ehlo: