[CDBUG-talk] Slow webmail

Patrick Muldoon doon at inoc.net
Fri May 15 09:01:38 EDT 2009


  On May 15, 2009, at 8:39 AM, Jaime wrote:

> I have a webmail system at work (apache 1.3.x + PHP5 + SquirrelMail)
> that became slow quite suddenly a few weeks ago.  It can take 40-60
> seconds just to send a 1 line message to myself and then return to the
> index of all email messages.
>
> By setting up Apache + PHP5 + SquirrelMail on another box and pointing
> it to the same IMAP and SMTP servers, I can get much better
> performance (2-10 seconds for the same send/index process as above).
>
> On the problemative box, I've updated Apache from 1.3.36 to 1.3.42,
> PHP from 5.2.3 to 5.2.9, and SquirrelMail from 1.4.10a to 1.4.17.  No
> improvement.
>

go to squirrelmail 1.4.18 :)  (but if on a 64 bit system, be aware  
that user prefs directory  can change  if you use hash directories due  
to the CRC hashes changing.. was bit by that and had to migrate 6K+  
user profiles to their correct hashes...)

TCP dump traffic between the web and the and the IMAP/SMTP servers,  
and see if you can see where the slowdown is happening.  Does the smtp  
connection take a long time connect, or is the opening/closing of the  
imap connections taking  up the time..  Also I've found either  
dropping your own logging code, or simple statements that just send  
you email with timestamps at various points inside the deliverMessage  
function (in src/compose.php) can help  bunch to figuring out what is  
going on.

If you watch Squirrelmail will open and close imap connections on  
every request, and sometimes multiple times per request, i've actually  
sent some patches in for bugs where the connection counting was wrong,  
or they would open up multiple imap connections to the sever, when  
they already have a valid connection (but those are already in 1.4.17.)

If you aren't running imapproxyd  on your webserver, you might want to  
look into it.  It proxies the imap connections from squirrelmail and  
keeps them open/recycled between requests,  We noticed at 2-3x  
speedup, especially mailboxes with lots of messages stored in them.

Also try turning off using the send folder, etc to see if the problem  
is related to that.

Also I would look at your mail server and see if it is doing anything  
to slow down the email.  Ie rate limiting or the like due to all the  
messages from that single IP (just a WAG based on the fact it is fast  
from another box :)) .

Hope that helps,

-Patrick

--
Patrick Muldoon
Network/Software Engineer
INOC (http://www.inoc.net)
PGPKEY (http://www.inoc.net/~doon)
Key ID: 0x370D752C

My Other machine is your Linux Box




More information about the CDBUG-talk mailing list