High Cpu Usage Docker

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 6.0
  • Operating system and version (e.g., Ubuntu 24.04):
    • Docker
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version (e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • It occurs every two weeks, only on Mondays.
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Every two weeks, only on Mondays, the CPU usage spikes to 2000% starting in the early morning. This makes it impossible to access Nextcloud. Around 1 PM, the system recovers on its own. According to the Docker logs, MySQL is consuming nearly 2000% of the CPU during this time.

[…]

Steps to replicate it (hint: details matter!):

  1. Wait until Monday morning.
  2. Observe the system as CPU usage spikes.
  3. Access to Nextcloud becomes unavailable.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

This is not a valid Nextcloud Server version.

Which Docker image are you using? There are many…

Unfortunately we can’t do much else other than speculate since you didn’t provide any information to really go on.

I would suggest:

  • Checking your Nextcloud log during that time window
  • Checking your installed apps that may be run background jobs on that schedule
  • Maybe enabling additional logging just before the next time you’re expecting it to happen

Hi,

I apologize for not providing this information. the version of the docker image I am using is 26.0.5.

That’s still not enough to go on if you would like us to help you. As I said, there are multiple images. The information requested in the support template is important. Without it, we can’t really help you.

Let’s try this:

  • Upgrade to a supported version of Nextcloud (see below) [either v29 or v30]
  • Confirm the problem still occurs
  • Review your Nextcloud log from during the time period of one of the CPU spike incidents (you likely have historical logs)
  • Post your Nextcloud config (occ config:list system)
  • Post your apps list (occ app:list)
  • Post your Docker Compose file

26.0.5.

Also, unfortunately, v26 reached end-of-life awhile ago. And even within v26 you’re running a very outdated version: the final maintenance release of v26 was v26.0.13.

Hello again

I am currently using version 26.0.5 and running it on docker. Can I upgrade directly to version 30.0 or should I upgrade to version 27.0 and then to version 28? I would appreciate it if you could give me information about stable releases.

You cannot skip a major version in Nextcloud.
You will need to bump to a v27 image then a v28 image, etc.

I still have no idea which Docker image you’re using. It could be the micro-services one, the AIO one, third-party ones LSIO, etc.

In general, most of the images out there support version tags. For example, the micro-services image let’s you specify image: nextcloud:28-apache (or similar, depends on the variation of the image you’re using and will be different for other Nextcloud Docker images).

Refs: