Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: waster2009 on May 20, 2009, 04:01:07 AM

Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 20, 2009, 04:01:07 AM
Hello,

I've recently installed Roundcube 0.2.1 for our users on 1024 RAM with 3Mhz cpu server. But the problem was appear with high CPU load. According to the logs we have about 500 messages sent everyday and about 2500 successfull and non sucessfulls logins. In some periods of the day, for example 00:00 - 10:00 we had a CPU load about 2 and it caused by Apache processes. That is very strange because in that period almost all users are sleep and we have only few logins and sent messages. This is only one virtual host running on the host. I've tried to use Debian Etch and Lenny.

I guess the problem is in Roundcube somewhere?

Thanks.
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 21, 2009, 09:21:02 AM
Second day. Average load increased to 4. Very strange.
Title: roundcube causes cpu high load with apache
Post by: chrisgu on May 22, 2009, 04:41:30 AM
I've been noticing the same problem, were running on FreeBSD. No real pattern can't figure out whats causing it. Looking at the processes it seems to be stuck in the RUN status, also the lsof output for the affected process  shows both network (client and IMAP) connection are closed so not sure what its doing.

Once I kill the httpd process the load drops back down.

Anyone got any ideas?
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 22, 2009, 09:06:32 AM
Well, here are my tries. First of all I've tried to install imapproxy in front of RC. After that CPU load terribly increased to 70! I mentioned that number of concurrent IMAP connections was always the same in that case and was equal to 10. Bingo! I have courier-imap as IMAP server and MAXPERIP setting was 10. That was the point. All other IMAP connections above 10th gave such terrible load. I increased this setting to 100 for the IP-address of RC and deinstalled imapproxy because unfortunately it creates too much concurrent ESTABLISHED connections to the IMAP server and causes "mini DOS attack" as I called it...:)

Now I have CPU load about 0.4. Will observe for that now.
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 24, 2009, 03:14:36 PM
Unfortunately, high load is still exist. Don't know why now. It slowly increasing along all day and now is about 3. Besides, there was an hour when a load was incredibly high again and was in 17 - 40 range with 120-170 processes! Can anyone from developers explain what is going on with RoundCube? I guess it is very major problem.
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 25, 2009, 01:31:13 AM
Also, can confirm that after apache restarting high load goes down to 0.3-0.4. So as the temporary solution will use "apache restart" instead "apache reload" in logrotate config.
Title: roundcube causes cpu high load with apache
Post by: chrisgu on May 26, 2009, 09:28:35 AM
Problem still happening for me if I do a top on the machine I get the following and can see the problems processes.

   last pid: 51489;  load averages:  2.44,  2.24,  2.19   up 33+16:12:40  14:31:44
49 processes:  3 running, 45 sleeping, 1 zombie
CPU: 98.5% user,  0.0% nice,  1.1% system,  0.4% interrupt,  0.0% idle
Mem: 78M Active, 212M Inact, 102M Wired, 11M Cache, 60M Buf, 87M Free
Swap: 666M Total, 15M Used, 651M Free, 2% Inuse

  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
48057 www         1 104    0 30356K 18884K RUN    195:58 39.26% httpd
47983 www         1 104    0 30356K 19136K RUN    195:51 38.09% httpd
51458 www         1  20    0 25236K 15588K lockf    0:01  1.07% httpd
51321 www         1  45    0 27284K 17580K select   0:06  0.78% httpd
51468 www         1  20    0 26260K 16312K lockf    0:01  0.68% httpd
51460 www         1  20    0 25236K 15380K lockf    0:01  0.59% httpd
  607 root        1  44    0  4672K   936K select   4:35  0.00% ntpd
85753 root        1  44    0 23188K 13052K select   1:06  0.00% httpd
  713 root        1  44    0  5876K  1712K select   0:49  0.00% sendmail
  684 mysql       9  20    0 56392K 24308K sigwai   0:20  0.00% mysqld
  723 root        1   8    0  3212K   672K nanslp   0:16  0.00% cron
  515 root        1  44    0  3184K   664K select   0:10  0.00% syslogd
  717 smmsp       1  20    0  5876K  1404K pause    0:02  0.00% sendmail
51459 www         1  20    0 26260K 16544K lockf    0:02  0.00% httpd
51436 www         1  20    0 25236K 15608K lockf    0:02  0.00% httpd
51457 www         1  20    0 25236K 15524K lockf    0:01  0.00% httpd

As soon as I restart apache it drop back to normal. If I run an lsof against these processes I can see that the network connection are all closed, just looks like the httpd proccess isn't closing when the user disconnects.

Is there any way to timeout or close old roundcube connected?

Chris.
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 27, 2009, 08:07:09 AM
Dear RC developers. So can you comment this situation? Why it can happen?
Title: roundcube causes cpu high load with apache
Post by: rosali on May 27, 2009, 08:21:17 AM
Devolopers are extremely seldom here. Please use RoundCube Mailing Lists (http://lists.roundcube.net).
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 27, 2009, 09:48:34 AM
rosali, thank you...will try to post there.
Title: roundcube causes cpu high load with apache
Post by: waster2009 on May 28, 2009, 02:27:15 AM
It seems that users mailing list is not very popular according to number of messages and answers, at least in May. Posted the problem there anyway.
Title: roundcube causes cpu high load with apache
Post by: thiagopramos on June 10, 2009, 10:13:59 AM
HI, I have the same problem.
2 in 4 server have this problem, and I donĀ“t find difference between them.
Restart apache solved problem for 1 or 2 days.
Any idea?
Title: roundcube causes cpu high load with apache
Post by: waster2009 on June 11, 2009, 02:05:27 PM
Still did not find a reason and corresponding solution for that high load. Don't get any answers from developers in mailing list too. I guess it is a problem if someone besides me encounter such problem. Any ideas?
Title: roundcube causes cpu high load with apache
Post by: jay on June 12, 2009, 05:16:59 AM
I have the same problem. Please let me (or better us here in the forum) know when you have some news. thanks j
Title: roundcube causes cpu high load with apache
Post by: closer9 on June 16, 2009, 11:53:33 AM
I'd also like to see a solution to this issue. I've searched and searched as to why this happens but keep coming up empty.

If anyone finds a solution to this issue, please post it here.
Title: roundcube causes cpu high load with apache
Post by: fooman on June 18, 2009, 10:17:00 AM
Same problem here running debian 4.0 & latest roundcube release.

Apache's server-status shows that the cpu hogging pids get stuck with "W" Sending Reply, but the request that got stuck seem to vary greatly.

With the huge user base that I have, this requires frequent apache restarts to keep se webmail-service even remotely usable, and thus it's very annoying.
Title: roundcube causes cpu high load with apache
Post by: fooman on June 24, 2009, 03:41:25 AM
Well it seems I finally got my load issues fixed.

I installed imap proxy and configured my imap servers to allow more imap instances. I think that the huge load was caused by imap connections dropping before the job was done. I allso dropped the timeout from apache to a small enough value so that in case something still gets hang up the proces wont stay up hogging cpu for too long.

From the looks of it, some of my imap servers are quite ancient, so they might be causing some problems as well.

Before the changes, my load was peaking close to 60 and now my average seems to hover around 5.
Title: roundcube causes cpu high load with apache
Post by: waster2009 on July 06, 2009, 09:48:36 AM
It seems that I've found the problem. In my case authentication is based on LDAP information but there are many records in LDAP tree which does not have corresponding physical mailbox on the server. I guess the high load was caused by this issue. I've deleted such user records and now average load is about 0.3. Actually I don't know why some apache processes are hang if there is no mailbox on the server. Is that IMAP server or RC problem?
Title: High over CPU
Post by: algodas on July 06, 2009, 06:40:56 PM
Hi fooman, i have install a imapproxy but the problem about the high over cpu continued. What change you do in IMAP . I'm alter the MAXPERIP but don' t solve. Can you help me ? Thank's
Title: roundcube causes cpu high load with apache
Post by: thiagopramos on August 06, 2009, 09:10:36 AM
Change imap number of connection work a few situations.
But same server dont work with workaround.
Title: roundcube causes cpu high load with apache
Post by: fooman on August 10, 2009, 03:48:11 AM
I removed the connection limit per ip completely because the majority of the connections come through the proxying server. The amount of connections from one ip is insane in my case.

I'm still having issues with imap connections when people open up huge inboxes or use the personal settings/folders tab.

The folder tab seems to show way much stuff by default. Would be nicer if it would not show the content of all the folders immediately when you open the tab. In some cases the amount of files it wants to list reaches up to thousands depending what people have stuffed into their home folders etc.

Still working to improve the things more. I'm hoping that the .3 stable release really improves the imap performance.
Title: roundcube causes cpu high load with apache
Post by: jamesjames on August 12, 2009, 10:16:26 AM
I too am suffering from this issue, unfortunately can't add anything else to help find a solution
Title: please help ...
Post by: Floy on August 27, 2009, 09:06:50 AM
download attachment from roundcube.
"top" freebsd 7.2, apache 2.2.11, php 5.2.9, dovecot, exim:

68688 www          1 107    0 26192K 16972K RUN      0:15 52.29% httpd
  816 squid        1   4    0 81196K 77020K kqread   1:30  0.00% squid
  920 root         1  44    0  5012K  2156K select   1:16  0.00% ppp
 2994 root         1  44    0  8428K  2828K select   0:03  0.00% sshd
  865 root         1   4    0  3128K  1156K kqread   0:01  0.00% dovecot
  699 bind         4   4    0 29556K 22908K kqread   0:01  0.00% named
60247 root         1  44    0 20048K 11312K select   0:01  0.00% httpd
  805 root         1  44    0 10852K  8360K select   0:01  0.00% perl5.8.9
  868 root         1   4    0  3864K  1584K kqread   0:00  0.00% dovecot-auth
  800 root         1  44    0  6004K  2808K select   0:00  0.00% proftpd
  822 squid        1  -8    0  1376K   636K piperd   0:00  0.00% unlinkd
  628 root         1  44    0  3184K  1032K select   0:00  0.00% syslogd
  898 root         1   8    0  3212K  1076K nanslp   0:00  0.00% cron
 2998 root         1   8    0  4396K  1888K wait     0:00  0.00% bash
 2450 root         1   8    0  3464K  1248K wait     0:00  0.00% sh
68849 root         1   4    0  3864K  1744K kqread   0:00  0.00% dovecot-auth
 2430 mailnull     1  45    0  9220K  2564K select   0:00  0.00% exim-4.69-3

Please solve this problem !
I want to use this program, but this problem does not allow :(
Title: roundcube causes cpu high load with apache
Post by: John5788 on November 04, 2009, 03:12:09 AM
hello, I am running across same problem with roundcube 0.3 on gentoo with apache2.

it took me a while, but I narrowed the issue down to roundcube and it makes my server completely unresponsive. when I have a tab with roundcube open, I can easily watch the server load rise consistently, and once I kill apache, the server load goes back down to a sane level.

If I dont access roundcube at all, my server loads remain sane until I log back into roundcube again, at which point it will climb until the server has effectively DOS'ed itself.

I am looking for a solution.
Title: roundcube causes cpu high load with apache
Post by: yota79 on November 05, 2009, 08:19:54 AM
Hi , I have the same problem.

My version of Roundcube is the 0.2.1.

I have three server that work fine for 4 months, and now I see the the CPU load average go up to 120 and then the server crash.

If I restart the httpd, the load of server go down and ok, but the webmail not work. I see that is a problem with mysql , that have a lot of connection of select in rmail database.

I not try to delete this table becouse the server is in production. I use the cache becouse the imap server not in in the same server, and i have cache_lifetime 10 days .

Anything have a solution? Thank you.

p.s: The same problem have the other 2 servers , the load average up but not work when i restart httpd. The 3 server have the same table rmail... is this the problem?
Title: roundcube causes cpu high load with apache
Post by: SKaero on November 05, 2009, 08:36:36 AM
Quote from: yota79;22803
My version of Roundcube is the 0.2.1.
Does it happen with RoundCube 3.1?
Title: roundcube causes cpu high load with apache
Post by: yota79 on November 05, 2009, 09:47:44 AM
Quote from: skaero;22805
Does it happen with RoundCube 3.1?


I don't know, but my version is the 0.2.1.
Title: roundcube causes cpu high load with apache
Post by: corbosman on November 06, 2009, 05:27:10 AM
Everyone should try 0.3.1 , it has some fixes for sorting problems. If you have a LOT of email, anything pre-0.3.1 could be quite busy trying to sort all your email.

Make sure you turn indexsort on.

One thing I dont get from one of the previous replies. Why would RC/Imap see thousands of files? You should configure your imap server to have a specific directory for imap folders, and nothing else. Or are you saying you have thousands of mail folders? No imap server is going to like thousands of folders.
Title: roundcube causes cpu high load with apache
Post by: yota79 on November 06, 2009, 07:41:43 AM
I try to poweroff two of three server and reboot but the problem persist. I set mysql in local and work fine. When i use the mysql on the other machine the problem return.

The problem is in the mysql , but in the session or in the cache?

There is a method to flush the session or cache table ?