Score:2

Webmail application (php) slow when consulting messages via IMAP. What to optimize to improve speed?

us flag

I have configured a couple of webmail applications (open source), to consult external email accounts (gmail). The applications are in Php and Mysql. Once installed, I can link my mail through IMAP. And consult the mail from these applications.

Opening or reading a message is a request and it has taken me on average 1 to 2 seconds with the Roundcube application and GroupOffice. With Rainloop and snappymail it went better, I got 150 to 350ms. Without optimizing anything in the installed applications, in all cases and with the same resources (cpu, ram and disk). Apparently the IMAP server is not a problem, as it is very fast.

I think the problem is in where the application has been installed, I think there are several things to optimize. I was checking the documentation and I find the following:

"Webmail systems make lots of imap connections. It's wise to use imapproxy to cache connections to the IMAP server. Install imapproxy on the web server and configure it to proxy the imap server." In addition I have read documentation where I am recommended to install: mem cache, redis, imapproxy.

I am tempted to install Sogo or Nextcloud, but without knowing what to optimize, I think I will get the same result.

My question is: What should I take care of, configure or optimize to get a fast query speed?

Wilson Hauck avatar
jp flag
FIRST thing to optimize is your MySQL - we need additional DB information request, please. RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post TEXT data on justpaste.it and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions.
Jhoedram avatar
us flag
Thanks for your answer, actually mysql intervenes little or not at all in this case. And if it does, it works great. The applications mentioned, have tools such as calendars, these are hosted in a database. And the queries are very fast, I have checked them and there are no problems. Only the webmail when doing IMAP queries is what is slow.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.