Hi! I've written a quick manual about Roundcube configuration and performance. You can extend this or comment it here. But it would be nice if someone will reformat this and add to our wiki.
There are many configuration options with inpact on performance in Roundcube. As Roundcube installation administrator you can. set them to some defaults and disable possibility of change by your users using '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 IMAP server with SORT capability. If messages list displaying is still too slow you should set 'message_sort_col' to 'date' and enable 'index_sort'. The order (ASC/DESC) is not important.
'max_pagesize' (and 'pagesize') To display messages subjects/senders/dates/etc Roundcube fetches the headers. So, to increase performance don't set 'pagesize' too high.
'min_keep_alive' ('keep_alive') To keep session Roundcube is sending a request to server every 'keep_alive' seconds. If you're already in mail task window Roundcube will also check for new mail using this interval. To decrease load don't set it too low.
'skip_deleted' This really slows things down. With 'skip_deleted' enabled Roundcube needs every time to check messages status, when displaying the list, counting 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 faster SORT or even direct FETCH (index_sort).
'check_all_folders' Roundcube searches for recent messages in INBOX. You can configure it to check all folders, but e.g. if you you have many folders, enable also 'skip_deleted' and your IMAP server isn't using indexing this could be realy expensive operation.
'preview_pane' 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 (if it isn't already cached by browser).
'enable_caching' With enabled caching Roundcube stores message counters, folders list and message headers in database. You should consider enabling this if access to your DB server is faster than access to IMAP. The caching is not always faster, also cache operations are expensive if mailbox cache is not complete (cache is "dirty").
message_cache_lifetime' If with enabled caching your database is growing too fast, you can lower lifetime to not store old messages.
'imap_auth_type', 'smtp_auth_type' If you know what type of authorization your servers are using, you can speed up connection process setting type directly. E.g. if 'imap_auth_type' is set to 'check' (default) Roundcube will detect auth method, then will try to authorize using CRAM-MD5 if supported and finally using PLAIN. As you see, you can skip two steps if your server allows PLAIN login (for security you should do this only on the same host or using secure connection).
'logout_purge' 'logout_expunge' If your server is heavy loaded you should probably disallow doing clean up on every logout.
If your SMTP/IMAP servers are on the same host or are connected with secure network, would be better to not use SSL connections.
It is not possible in Roundcube to force plain connection with SMTP server. If server returns STARTTLS capability TLS connection will be established. If you're on the same host, 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_ma...)
Add in /etc/postfix/main.cf file: smtpd_discard_ehlo_keyword_address_maps = hash:/etc/postfix/discard_ehlo and in /etc/postfix/discard_ehlo file: 127.0.0.1 starttls,silent-discard
Hi,
On 2009-10-12 17:58 UTC A.L.E.C wrote:
Hi! I've written a quick manual about Roundcube configuration and performance. You can extend this or comment it here. But it would be nice if someone will reformat this and add to our wiki.
This is useful.
I made some changes (please check that I didn't change the meaning, Alec) and formatted it for the TRAC Wiki. I think 'Howto_Performance_tuning' would be a good page name. Unfortunately I seem to not have enough rights to create a Wiki page (that's a weird policy, if you ask me... it's a Wiki!). The Wiki told me so on pressing the 'save' button...
So if someone can give me the rights to create Wiki pages, I'll submit it (user 'patrick'). In case that's not possible or undesirable for whatever reason, I have attached the article I tried to create as a text file (to prevent my MUA from inserting useless line breaks).
Patrick.
A.L.E.C wrote:
Hi! I've written a quick manual about Roundcube configuration and performance. You can extend this or comment it here. But it would be nice if someone will reformat this and add to our wiki.
You would also mention imapproxy (up-imapproxy) in SERVER HINTS.
Vladislav _______________________________________________ List info: http://lists.roundcube.net/dev/
Patrick Nagel wrote:
I made some changes (please check that I didn't change the meaning, Alec) and formatted it for the TRAC Wiki. I think 'Howto_Performance_tuning' would be a good page name. Unfortunately I seem to not have enough rights to create a Wiki page (that's a weird policy, if you ask me... it's a Wiki!). The Wiki told me so on pressing the 'save' button...
Currently I have no rights to create a page too. I'm sure it was possible before... In the mean time, thanks for your correction there's only one misunderstanding.
"The caching is not always faster though, and cache update operations are expensive."
This is not exactly what I'd like to say about the cache update process. Roundcube is always making a check of cache completeness. In general, it compares messages counts in the server and in the cache, it also checks UIDs of some (most recent) messages. If something differs the cache is assumed dirty and is updated (fetching headers of messages for current list page from IMAP server). Let's suppose a folder with 1k of messages. Not every message have been viewed or listed by Roundcube, so cache contains, let's say, a hundred. In this simple and common case the cache will be always dirty until you will list each message. This probably should be fixed in future versions, but that's how it works.
Also we could add:
=== 'imap_root', 'imap_delimiter' ===
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.
I added the page, and did some brief formatting: http://trac.roundcube.net/wiki/Howto_Performance
[ Sorry about the issues, but we had to take away/restrict page creation because of the ongoing spam outbreaks. ]
On Tue, Oct 13, 2009 at 9:01 AM, A.L.E.C alec@alec.pl wrote:
Patrick Nagel wrote:
I made some changes (please check that I didn't change the meaning, Alec) and formatted it for the TRAC Wiki. I think 'Howto_Performance_tuning' would be a good page name. Unfortunately I seem to not have enough rights to create a Wiki page (that's a weird policy, if you ask me... it's a Wiki!). The Wiki told me so on pressing the 'save' button...
Currently I have no rights to create a page too. I'm sure it was possible before... In the mean time, thanks for your correction there's only one misunderstanding.
"The caching is not always faster though, and cache update operations are expensive."
This is not exactly what I'd like to say about the cache update process. Roundcube is always making a check of cache completeness. In general, it compares messages counts in the server and in the cache, it also checks UIDs of some (most recent) messages. If something differs the cache is assumed dirty and is updated (fetching headers of messages for current list page from IMAP server). Let's suppose a folder with 1k of messages. Not every message have been viewed or listed by Roundcube, so cache contains, let's say, a hundred. In this simple and common case the cache will be always dirty until you will list each message. This probably should be fixed in future versions, but that's how it works.
Also we could add:
=== 'imap_root', 'imap_delimiter' ===
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.
-- Aleksander 'A.L.E.C' Machniak http://alec.pl gg:2275252 LAN Management System Developer http://lms.org.pl Roundcube Webmail Project Developer http://roundcube.net _______________________________________________ List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/