Roundcube Community Forum

 

Performance issues under Nginx?

Started by dwasifar, July 23, 2014, 11:27:41 AM

Previous topic - Next topic

dwasifar

Recently I switched from Apache to Nginx and I am seeing performance problems in Roundcube on initial load of large mailboxes.  Mailbox will take 20 or 30 seconds with "loading" displayed before it populates. 

This installation has been working fine on Apache since November.  AfterLogic and Rainloop webmail clients do not have this issue.  I've tried a few things, like enabling db message caching, but I'm really just stabbing in the dark and don't know where I should be looking to address the problem.

Roundcube version is 1.0-b.  Nginx version is 1.6.0.  OS is Debian Wheezy. 

Here is my Nginx virtual host config, if it helps.  (Actual URL is masked.)

# HTTPS server
#
server {
   listen 443;
   server_name .xxxxxx.net;

   root /var/www/xxxxxx.net/ssl_html;
   index index.html index.htm index.php;

   ssl on;
   ssl_certificate /etc/ssl/ssl.crt/www.xxxxxx.net.pem;
   ssl_certificate_key /etc/ssl/ssl.key/www.xxxxxx.net.key;

   ssl_session_timeout 5m;

   ssl_protocols SSLv3 TLSv1;
   ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
   ssl_prefer_server_ciphers on;

   location ~ \.php$ {
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
   
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_index index.php;
      include fastcgi_params;
   }

   location / {
      try_files $uri.html $uri $uri/ =404;
   }
}

dwasifar

Well, I upgraded to the latest version of Roundcube and it's better.  I wish I understood why it happened, though.

dwasifar

More information on this.

I still felt it could have been faster, so I poked around at a few things.  Tried using a different IMAP daemon (dovecot instead of courier), with no particular improvement.  Then a friend suggested I increase memory_limit in php.ini, so I changed it to 512M from 128M, and that seems to help a lot more.  I don't know why it should need more memory under nginx than it did under Apache, but apparently it does.  And it was always only Roundcube with the issue; other webmail clients were fine.  But between that, and archiving about half the mailbox, it's down to loading in about 2 seconds, which is acceptable and a vast improvement over the 30 seconds it was taking previously.

Yoni

To me it sounds more like a PHP specific thing instead of Nginx. I have deployed several Roundcube instances on Nginx and I have never assigned more than 128MB RAM to any of these installations. That's running Plugin Manager in most of them which should be way heavier (php wise) than a plain Roundcube install.

So if giving more RAM to PHP processes did the trick you should look for anything leaking RAM in your installation. Plugins/configuration come to my mind...