1

Topic: Slow Down Roundcube Webmail

======== Required information ====
- iRedMail version: 0.8.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 5.10 64Bits
- Related log if you're reporting an issue:
====

Hi, good mornig gentleman.
I have a situation on a new server...

I have iredmail on a virtualized CentOS 5.10 64bits. Its virtualized on another CentOS 5.10 64bits.
My server is a HP with a 4 core xeon 3.10Ghz, 8GB of RAM, hardware RAID level 10 with 4 disks Seagate 7200RPM.
It`s virtualized with Virtualbox. Roundcube Version: 0.9.5

Everyday, many times a day, the server is slowing down, the load average goes from 1.2 to 12 or 21...after some seconds or one minute or two it backs to normal

We have only 95 mail accounts. All the accounts read mail throught webmail. The virtual server have 4GB of RAM.

I checked php.ini, httpd.conf, /var/log/httpd*, /var/log/maillog. All of them looks normal, no errors.
I made tests with different configurations in php, apache, roundcube and nothing solved the problem.

The RAM memory only uses 50, 60%, the processor most of time is in idle.

So I checked I/O of the disk and them I saw the problem. The I/O when the server slow down is in 99%. Various imap processes running in 99%. I added the option "noatime" on the fstab trying to speed up a little bit the harddrive but its not enought.

If I restart Apache when the load starts to increase the load back to normal, but it`s not a solution.

The filesystem is EXT3, and the partitioning is made in encrypted LVM. Is this a bad idea?

The /vmail have 290GB of e-mail. Can anyone please help me to solve this problem?

I attached a screenshot of what happens.

Best Regards,
Robert

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Slow Down Roundcube Webmail

Sorry, I made a mistake with the attachment.


Best Regards,

Post's attachments

screenshot.png
screenshot.png 241.46 kb, 1 downloads since 2014-03-07 

You don't have the permssions to download the attachments of this post.

3

Re: Slow Down Roundcube Webmail

rhedler wrote:

If I restart Apache when the load starts to increase the load back to normal, but it`s not a solution.
The filesystem is EXT3, and the partitioning is made in encrypted LVM. Is this a bad idea?

If it shows IMAP processes running in 99%, and restarting Apache fixes it, it might be caused by Roundcube webmail + Dovecot (IMAP server).

Currently, it's hard to say why roundcube webmail causes this issue, so you have to find a explicitly way to reproduce this issue.

Some hints maybe help a little:

*) Do your mail users search mail content (in mail body) frequently? Did this issue happen when someone searching mailbox?
*) Does every mail user have many mail messages in mailbox?

4

Re: Slow Down Roundcube Webmail

Hi good morning. sorry for being slow to respond...

Thanks for the fast support.

*) Do your mail users search mail content (in mail body) frequently? Did this issue happen when someone searching mailbox?
R: yes

*) Does every mail user have many mail messages in mailbox?
R: yes

Some users have 2 and even 3 thousand mails in some boxes.

I saw that imap was slowing down the server so I try so disable some non essential disk read write access.
I made changes in the Dovecot.conf and Config,inc.php

Here comes the changes in Dovecot 1.2.17 (add lines):
login_processes_count = 4
login_max_connections = 192
fsync_disable = yes
protocol lda {
  fsync_disable = no
}
mmap_disable = yes
maildir_very_dirty_syncs = yes
maildir_copy_with_hardlinks = yes
maildir_stat_dirs = no
maildir_copy_preserve_filename = yes
dotlock_use_excl = yes # enable this line, it was commented
-----------------------------------------------------------------------------------------
Here comes the changes in Config.inc.php:
// Minimal value of user's 'refresh_interval' setting (in seconds)
$rcmail_config['min_refresh_interval'] = 120; # change from 60 to 120

// Default interval for auto-refresh requests (in seconds)
// These are requests for system state updates e.g. checking for new messages, etc.
// Setting it to 0 disables the feature.
$rcmail_config['refresh_interval'] = 180; # change from 60 to 180

// If true all folders will be checked for recent messages
$rcmail_config['check_all_folders'] = false; # change from true to false

// If true, after message delete/move, the next message will be displayed
$rcmail_config['display_next'] = false; # change from true to false
--------------------------------------------------------------------------------------------------------------
Yesterday, the server serve about 120-140 connections, all the users access the webmail simultaneously, some of the users open two sessions on the browser, reading two differents mailboxes.
The load server was normal for the entire day, no slow down, no freezing, no apache restarts. I will monitor for one more week to see if its really solve the problem.

So, can you say to me if the changes that I made to the server can be dangerous? Dovecot is working in security mode, not performance mode.

Thanks a lot.

Best regards,
Robert.

ZhangHuangbin wrote:
rhedler wrote:

If I restart Apache when the load starts to increase the load back to normal, but it`s not a solution.
The filesystem is EXT3, and the partitioning is made in encrypted LVM. Is this a bad idea?

If it shows IMAP processes running in 99%, and restarting Apache fixes it, it might be caused by Roundcube webmail + Dovecot (IMAP server).

Currently, it's hard to say why roundcube webmail causes this issue, so you have to find a explicitly way to reproduce this issue.

Some hints maybe help a little:

*) Do your mail users search mail content (in mail body) frequently? Did this issue happen when someone searching mailbox?
*) Does every mail user have many mail messages in mailbox?

5

Re: Slow Down Roundcube Webmail

rhedler wrote:

So, can you say to me if the changes that I made to the server can be dangerous? Dovecot is working in security mode, not performance mode.

For Roundcube part, all is ok.

*) For Dovecot part, about "fsync", you should check its document here: http://wiki2.dovecot.org/MailLocation/L … k#Fsyncing
Personally, i think it's fine to disable it but leave it enabled for LDA in your case (all clients use webmail), just like what you already did.

rhedler wrote:

maildir_very_dirty_syncs = yes
maildir_copy_with_hardlinks = yes
maildir_stat_dirs = no

You can find them in Dovecot wiki tutorial: http://wiki2.dovecot.org/MailLocation/M … imizations
I think it's safe to use them in your case.

rhedler wrote:

dotlock_use_excl = yes # enable this line, it was commented

I don't think this is necessary, because it's enabled (=yes) by default, and it's used for only NFSv2.

6

Re: Slow Down Roundcube Webmail

Hi, many thank for your help.

About the link, I already read and follow these links in dovecot page, I only do what I think secure, so I don`t enable performance mode.

Until now, everything is normal on the server, lets see the next days.

Thanks for your analisys of my configuration.

I guess that this case is solved. What we do now?

Best regards,
Robert.