Topic: roundcube php timeouts, custom nginx configuration possible?
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.4
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Ubuntu 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello,
lately it happens from time to time that my roundcube application has increased loading times. More specifically the PHP process. The server itself is not overloaded, nor do I see any errors in the PHP log, it just takes a little longer sometimes.
This is then expressed in the nginx error log like this:
2023/08/08 12:50:02 [error] 1195#1195: *4831 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 91.x.x.x, server: _, request: "GET /mail/?_task=mail&_refresh=1&_mbox=INBOX HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "mail.example.org", referrer: "https://mail.example.org/mail/?_task=mail&_action=compose&_id=censoredrandomstring"
And ends for the customer with a 504 timeout.
As a temporary workaround I added the following lines to /etc/nginx/templates/fastcgi_php.tmpl:
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
Will this setting survive an iRedMail update, or will it be overwritten?
And is there possibly a better solution?
php slow log looks like this:
[09-Aug-2023 10:21:46] [pool www] pid 136255
script_filename = /opt/www/roundcubemail/index.php
[0x00007f3a67c13db0] fgets() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap_generic.php:212
[0x00007f3a67c13d10] readLine() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap_generic.php:332
[0x00007f3a67c13c20] readReply() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap_generic.php:772
[0x00007f3a67c13a30] authenticate() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap_generic.php:991
[0x00007f3a67c13930] connect() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap.php:172
[0x00007f3a67c13800] connect() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap.php:248
[0x00007f3a67c13790] check_connection() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap.php:2955
[0x00007f3a67c13650] list_folders_subscribed_direct() /opt/www/roundcubemail-1.3.0/program/lib/Roundcube/rcube_imap.php:2914
[0x00007f3a67c13570] list_folders_subscribed() /opt/www/roundcubemail-1.3.0/program/actions/mail/check_recent.php:53
[0x00007f3a67c13300] run() /opt/www/roundcubemail-1.3.0/program/include/rcmail.php:282
[0x00007f3a67c131d0] action_handler() /opt/www/roundcubemail-1.3.0/index.php:278
Don't be fooled by the version number 1.3.0, that's just the name of the folder where I put the in-place upgrades.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.