Skip to content

Memory management: Nextcloud Mail blocks all the requests done to Nextcloud #11202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DodoLeDev opened this issue May 26, 2025 · 3 comments
Open

Comments

@DodoLeDev
Copy link

Steps to reproduce

  1. Open Nextcloud Mail
  2. Select a folder with a LOT of mails in it
  3. 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

@DodoLeDev DodoLeDev changed the title Memory management: Nextcloud Mail hangs all the Nextcloud operations Memory management: Nextcloud Mail blocks all the Nextcloud operations May 26, 2025
@DodoLeDev DodoLeDev changed the title Memory management: Nextcloud Mail blocks all the Nextcloud operations Memory management: Nextcloud Mail blocks all the requests done to Nextcloud May 26, 2025
@ChristophWurst
Copy link
Member

Thank you for the report.

Can you give more details? What kind of resource limit does the app cause?

@DodoLeDev
Copy link
Author

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

@ChristophWurst
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants