mail
mail copied to clipboard
Memory management: Nextcloud Mail blocks all the requests done to Nextcloud
Steps to reproduce
- Open Nextcloud Mail
- Select a folder with a LOT of mails in it
- Chances are that Nextcloud will be restarted when on Kubernetes
Expected behavior
Nextcloud Mail has the right to hang, especially when dealing with so much mails, but it should not interfere with the main Nextcloud behavior.
Actual behavior
When Nextcloud Mail is working too hard, the entire Nextcloud instance is unable to reply to requests unrelated to the Mail service:
<Kubernetes requests /status.php for liveliness probe, but it does not seem to be treated by Apache according to the logs>
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 500 977 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 500 911 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 500 911 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 500 911 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 500 911 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 500 911 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "GET /apps/mail/api/a/lot/of/requests HTTP/1.1" 200 992 "-" "User Agent"
1.2.3.4 - - [Date/Of/Day:HH:MM:SS +0000] "POST /apps/mail/api/mailboxes/123/sync HTTP/1.1" 500 911 "-" "User Agent"
<Kubernetes considers Nextcloud hangs, so it kills the container>
[Date/Of/Day:HH:MM:SS +0000] [mpm_prefork:notice] [pid 1:tid 1] AH00170: caught SIGWINCH, shutting down gracefully
Mail app version
5.1.0
Nextcloud version
31.0.2
Mailserver or service
Stalwart
Operating system
Debian 12 Bookworm (official Nextcloud container)
PHP engine version
PHP 8.3
Nextcloud memory caching
No response
Web server
Apache (supported)
Database
PostgreSQL
Additional info
No response
Thank you for the report.
Can you give more details? What kind of resource limit does the app cause?
Unfortunately, I can't give you more precise logs, because the behavior I found is as following:
- I open Nextcloud Mail
- The app has to fetch a LOT of messages, which is a task that needs a lot of resources to work
- Apache no longer seem to receive any request
- Kubernetes does not receive any reply for its liveliness requests, so it kills the container
Could this be a sub-optimal configuration of Apache?
Have a look at your access logs. You should be able to see requests that take most time.
Hi there! It looks like this issue hasn’t seen much activity for a while and might need a bit more information to move forward. If we don’t hear back soon, we may close it to keep things organized. Thanks again for your contributions – we really appreciate it!