Skip to content

[BUG] High CPU usage after container update #536

Closed

Description

@Elbullazul

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

After Watchtower updates the container, it progressively starts using more and more CPU until requests start failing for lack of resources. On Grafana, it looks like this (auto-updates are set for 2:00 AM):

Image

Expected Behavior

The container should update without exhausting CPU resources afterwards

Steps To Reproduce

  1. Enable auto-updates with Watchtower and wait for an update to occur
  2. After updating, the container's CPU usage increases until it exhausts available resources

Environment

- OS: Debian Trixie
- How docker service was installed: Docker's install script

CPU architecture

x86-64

Docker creation

services:
  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Toronto
    volumes:
      - ${BINDS}/nextcloud/config:/config
      - ${BINDS}/nextcloud/data:/data
    depends_on:
      nextcloud-db:
        condition: service_healthy
      nextcloud-cache:
        condition: service_healthy
    restart: unless-stopped
    networks:
      - backend
      - proxy_nextcloud
    labels:
      com.centurylinklabs.watchtower.enable: true
      com.centurylinklabs.watchtower.depends-on: "/nextcloud-db, /nextcloud-cache"

  nextcloud-db:
    image: postgres:17
    container_name: nextcloud-db
    volumes:
      - ${BINDS}/nextcloud/pgdb:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: ${DB_NAME}
      POSTGRES_USER: ${DB_USER}
      POSTGRES_PASSWORD: ${DB_PASS}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d ${DB_NAME} -U ${DB_USER}"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    networks:
      - backend
    labels:
      com.centurylinklabs.watchtower.enable: true

  nextcloud-cache:
    image: redis:alpine
    container_name: nextcloud-cache
    environment:
      - TZ=$TIMEZONE
      - PUID=1000
      - PGID=1000
    volumes:
      - cache:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 60s
      timeout: 20s
      retries: 5
    restart: unless-stopped
    networks:
      - backend
    labels:
      com.centurylinklabs.watchtower.enable: true

volumes:
  cache:

networks:
  backend:
  proxy_nextcloud:
    external: true

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 33.0.0-ls418
Build-date: 2026-02-18T13:49:46+00:00
───────────────────────────────────────
    
using keys found in /config/keys
Initializing nextcloud 33.0.0.16 (this can take a while) ...
Upgrading nextcloud from 32.0.6.1 ...
Setting permissions
Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.21.0
Updating <oauth2> ...
Updated <oauth2> to 1.21.0
Updating <password_policy> ...
Updated <password_policy> to 5.0.0-dev.0
Updating <user_ldap> ...
Updated <user_ldap> to 1.24.0
Updating <activity> ...
Updated <activity> to 6.0.0-dev.0
Updating <circles> ...
Updated <circles> to 33.0.0
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.17.0
Updating <dav> ...
Fix broken values of calendar objects

 Starting ...

Clean up old calendar subscriptions from deleted users that were not cleaned-up

    0/0 [>---------------------------]   0% Starting ...

Updated <dav> to 1.36.0
Updating <files> ...
Updated <files> to 2.5.0
Updating <files_sharing> ...
Updated <files_sharing> to 1.25.2
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.23.0
Updating <files_versions> ...
Updated <files_versions> to 1.26.0
Updating <sharebymail> ...
Updated <sharebymail> to 1.23.0
Updating <webhook_listeners> ...
Updated <webhook_listeners> to 1.5.0
Updating <workflowengine> ...
Updated <workflowengine> to 2.15.0
Updating <logreader> ...
Updated <logreader> to 6.0.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 5.0.0
Updating <notifications> ...
Updated <notifications> to 6.0.0
Updating <systemtags> ...
Updated <systemtags> to 1.23.0
Updating <theming> ...
Updated <theming> to 2.8.0
Updating <app_api> ...
Updated <app_api> to 33.0.0
Updating <dashboard> ...
Updated <dashboard> to 7.13.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.23.0
Updating <files_downloadlimit> ...
Updated <files_downloadlimit> to 5.1.0-dev.0
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 6.0.0-dev.0
Updating <files_reminders> ...
Updated <files_reminders> to 1.6.0
Updating <firstrunwizard> ...
Updated <firstrunwizard> to 6.0.0-dev.0
Updating <privacy> ...
Updated <privacy> to 5.0.0-dev.0
Updating <profile> ...
Updated <profile> to 1.2.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.23.0
Updating <recommendations> ...
Updated <recommendations> to 6.0.0-dev.0
Updating <related_resources> ...
Updated <related_resources> to 4.0.0-dev.0
Updating <settings> ...
Updated <settings> to 1.16.0
Updating <survey_client> ...
Updated <survey_client> to 5.0.0-dev.0
Updating <text> ...
Updated <text> to 7.0.0-dev.3
Updating <twofactor_backupcodes> ...
Updated <twofactor_backupcodes> to 1.22.0
Updating <twofactor_totp> ...
Updated <twofactor_totp> to 15.0.0-dev.0
Updating <user_status> ...
Updated <user_status> to 1.13.0
Updating <viewer> ...
Updated <viewer> to 6.0.0-dev.0
Updating <weather_status> ...
Updated <weather_status> to 1.13.0
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level
Initializing finished
[custom-init] No custom files found, skipping...
[ls.io-init] done.
    0/0 [->--------------------------]   0%[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 33.0.0-ls418
Build-date: 2026-02-18T13:49:46+00:00
───────────────────────────────────────
    
using keys found in /config/keys
[custom-init] No custom files found, skipping...
[ls.io-init] done.
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 33.0.0-ls418
Build-date: 2026-02-18T13:49:46+00:00
───────────────────────────────────────
    
using keys found in /config/keys
[custom-init] No custom files found, skipping...
[ls.io-init] done.

Activity

  1. Elbullazul commented on Feb 19, 2026

    @Elbullazul
    Author

    Additional logs: nextcloud.log

  2. j0nnymoe commented on Feb 19, 2026

    @j0nnymoe
    Member

    Couple of things, first of all, we don't support nor recommend automatically updating containers, it can lead to problems.
    What process within the container is causing the usage? Does this happen if you manually restart the container?

  3. Elbullazul commented on Feb 19, 2026

    @Elbullazul
    Author

    The problem goes away after restarting the container.

    I didn't see what process was causing it, I'll post an update with that info whenever the bug happens again.

  4. j0nnymoe commented on Feb 19, 2026

    @j0nnymoe
    Member

    If it's only happening when Watchtower is triggering an update, I suspect that's causing the problem.

  5. j0nnymoe commented on Feb 19, 2026

    @j0nnymoe
    Member

    Just noticed as well, it probably didn't help that you've auto updated to a major version, so it's likely a upgrade process that's got stuck causing the cpu usage.

  6. Elbullazul commented on Feb 20, 2026

    @Elbullazul
    Author

    that's what I thought too. I was wondering if it might happen in other circumstances as well, which is why I opened the issue.

  7. Wdavery commented on Feb 22, 2026

    @Wdavery

    There's more going on here than a stuck upgrade process. See: nextcloud/server#57894

  8. j0nnymoe commented on Feb 22, 2026

    @j0nnymoe
    Member

    No one really had provided enough evidence of what it is causing the CPU usage. The few people that have responded use auto updates and upgrades across a major version.

    Not uncommon for nextcloud to have weird quirks between major versions but without any more detailed information, it's hard for us to troubleshoot. I'm holding off my upgrade until I see more details so I can monitor mine.

  9. lldsolitude commented on Feb 23, 2026

    @lldsolitude

    Same issue here. If I only restart the existing container, multiple php-fpm processes immediately begin to spawn and hog the CPU. The issue goes away only after recreating the container and only for a while. The next morning there are again many php-fpm processes and CPU usage is 100%.

  10. Kasalla10 commented on Feb 24, 2026

    @Kasalla10

    Kind of the same problem here. Since Nextcloud 33 (I guess ls418?) my container randomly crashes. The CPU utilization rises to ~40% and I simply can't access the Web UI. Sometimes it happens 10 seconds after the container restart. Sometimes it takes more than one day.

    Logs are flooded with the following message: "Error Call to undefined method OC\DB\QueryBuilder\QueryBuilder::execute()"
    But I guess that has nothing to do with the crashes as those error timestamps do not correlate with the crashes.

  11. Amusable-design commented on Feb 24, 2026

    @Amusable-design

    Same - using with Synology docker. Manually updated, but was not expecting a major Nextcloud update.

    Suspect all my PHP-fpm processes are being launched to build thumbnails or other image previews.
    Disabled recognize, Memories, preview generator to get my instance as close to vanilla as possible and issue persists.

    Have yet to come across any useful diagnostic info to share on this thread, but I’ll keep looking.

  12. j0nnymoe commented on Feb 24, 2026

    @j0nnymoe
    Member

    Seems to be an issue with one of the included apps of Nextcloud: nextcloud/privacy#1263
    Out of our control. Would suggest rolling back to a previous version/restore your backups or try disabling that privacy app (not sure what its actually used for.

    And just as a reminder, this is one of the primary reasons we as a group don't recommend automatic updates.

  13. Amusable-design commented on Feb 25, 2026

    @Amusable-design

    A bit more research - looks like my issue is indeed related to preview creation and is known.
    nextcloud/server#58058 or nextcloud/server#58415

    Not a docker issue - sharing in the event someone else is looking for a reason to delay updating.

  14. 11 remaining items

  15. NobleKangaroo commented on Apr 8, 2026

    @NobleKangaroo
    Contributor

    It's specific to the nextcloud version, they haven't merged it/cut a new release to include it yet.
    Quietsy does state that it needs to be reapplied if you update but nextcloud include the patch.

    I hadn't previously applied it as I didn't experience it for a while. I tried my luck when NobleKangaroo reported some luck in his earlier post after I experienced the high CPU bug a couple of times in the last week. Unfortunately no luck for me. I am unsure if this release I am on contains the fix already or not.

    Interesting. I'm not sure how or why the update worked for me, but it did. I'm using image: linuxserver/nextcloud:33.0.2 which looks like it's pulled version 33.0.2.2 after checking the container logs.

    [ ... ]
    ───────────────────────────────────────
    Linuxserver.io version: 33.0.2-ls423
    Build-date: 2026-04-02T09:39:30+00:00
    ───────────────────────────────────────
        
    using keys found in /config/keys
    Initializing nextcloud 33.0.2.2 (this can take a while) ...
    Setting permissions
    Initializing finished
    [custom-init] No custom files found, skipping...
    [ls.io-init] done.
    [ ... ]
    

    Things still look fine this morning.
    Image

    Previews still being generated on-demand.

    Now, granted, a single thread spikes a little when I browse to a folder of over 7,130 InstantUpload pictures and videos.
    Image

    However, the folder loaded after about 15 seconds and the spike went away.
    Image

    Curious to see what version you're running, and if it's perhaps different than what I'm on. For what it's worth, I did not have to apply the patch after updating my docker-compose to use 33.0.2 .

  16. jerheij commented on Apr 8, 2026

    @jerheij

    It's specific to the nextcloud version, they haven't merged it/cut a new release to include it yet.
    Quietsy does state that it needs to be reapplied if you update but nextcloud include the patch.

    I hadn't previously applied it as I didn't experience it for a while. I tried my luck when NobleKangaroo reported some luck in his earlier post after I experienced the high CPU bug a couple of times in the last week. Unfortunately no luck for me. I am unsure if this release I am on contains the fix already or not.

    Interesting. I'm not sure how or why the update worked for me, but it did. I'm using image: linuxserver/nextcloud:33.0.2 which looks like it's pulled version 33.0.2.2 after checking the container logs.

    [ ... ]
    ───────────────────────────────────────
    Linuxserver.io version: 33.0.2-ls423
    Build-date: 2026-04-02T09:39:30+00:00
    ───────────────────────────────────────
        
    using keys found in /config/keys
    Initializing nextcloud 33.0.2.2 (this can take a while) ...
    Setting permissions
    Initializing finished
    [custom-init] No custom files found, skipping...
    [ls.io-init] done.
    [ ... ]
    

    Things still look fine this morning.

    Previews still being generated on-demand.

    Now, granted, a single thread spikes a little when I browse to a folder of over 7,130 InstantUpload pictures and videos.

    However, the folder loaded after about 15 seconds and the spike went away.

    Curious to see what version you're running, and if it's perhaps different than what I'm on. For what it's worth, I did not have to apply the patch after updating my docker-compose to use 33.0.2 .

    This is the version I am currently running:

    b7ec9fd8a0dd[36141]: ───────────────────────────────────────
    b7ec9fd8a0dd[36141]: Linuxserver.io version: 33.0.2-ls424
    b7ec9fd8a0dd[36141]: Build-date: 2026-04-07T12:44:02+00:00
    b7ec9fd8a0dd[36141]: ───────────────────────────────────────
    

    Unfortunately overnight the high CPU usage had been happening again after the scheduled restart of the container for some backupping etc. It's hard to troubleshoot I find, the issue doesn't happen at set times and not even every time you restart.

    All is working fine and suddenly I am being met with my dav provider on my phone reporting connection errors.

  17. jerheij commented on Apr 9, 2026

    @jerheij

    Also, when I try to apply patch:

    root@b7ec9fd8a0dd:/# cd /app/www/public/
    root@b7ec9fd8a0dd:/app/www/public# wget https://github.com/nextcloud/server/pull/58403.diff
    Connecting to github.com (20.26.156.215:443)
    Connecting to patch-diff.githubusercontent.com (20.26.156.215:443)
    saving to '58403.diff'
    58403.diff           100% |**************************************|  1015  0:00:00 ETA
    '58403.diff' saved
    root@b7ec9fd8a0dd:/app/www/public# git apply --check ./58403.diff
    error: patch failed: lib/private/Preview/PreviewMigrationService.php:161
    error: lib/private/Preview/PreviewMigrationService.php: patch does not apply
    
  18. quietsy commented on May 3, 2026

    @quietsy
    Member

    Also, when I try to apply patch:

    root@b7ec9fd8a0dd:/# cd /app/www/public/
    root@b7ec9fd8a0dd:/app/www/public# wget https://github.com/nextcloud/server/pull/58403.diff
    Connecting to github.com (20.26.156.215:443)
    Connecting to patch-diff.githubusercontent.com (20.26.156.215:443)
    saving to '58403.diff'
    58403.diff           100% |**************************************|  1015  0:00:00 ETA
    '58403.diff' saved
    root@b7ec9fd8a0dd:/app/www/public# git apply --check ./58403.diff
    error: patch failed: lib/private/Preview/PreviewMigrationService.php:161
    error: lib/private/Preview/PreviewMigrationService.php: patch does not apply
    

    The patch has been included in the latest nextcloud release and there's no longer a need to apply it manually.
    If anyone still has issues make sure to pull the latest image, otherwise reach out to us via our support channels.

  19. moved this from Issues to Done in Issue & PR Trackeron May 3, 2026
  20. ErikDB87 commented on May 3, 2026

    @ErikDB87

    @quietsy, I'm running version 33.0.3-ls428, and I still faced this issue, as stated here: nextcloud/server#57894 (comment).

    I'm not sure what you meant with "your support channels"? It sounds like you don't really want someone posting here (like I'm doing now), but I'm not sure what I should do instead.

  21. j0nnymoe commented on May 3, 2026

    @j0nnymoe
    Member

    Isn't that a different bug to the one originally referenced in this issue?

  22. ErikDB87 commented on May 3, 2026

    @ErikDB87

    Isn't that a different bug to the one originally referenced in this issue?

    Maybe; I wasn't able to quite figure out what exatcly was the issue mentioned in the first post. But the issue I refered to, was already mentioned a few times here as well. And the symptom of 100 % CPU usage is also the same as described.

  23. Sukecz commented on May 11, 2026

    @Sukecz

    33.0.3-ls429 same problem with 100% cpu usage

  24. arktisk-varg commented on May 17, 2026

    @arktisk-varg

    I would like to add I am also on the latest version and still experience this issue:

    Maximum execution time of 3600 seconds exceeded at /app/www/public/lib/private/Config/PresetManager.php#57

  25. jerheij commented on May 17, 2026

    @jerheij

    Unfortunately still experienced this issues as well:
    lscr.io/linuxserver/nextcloud:33.0.3-ls428

  26. perahoky commented on May 31, 2026

    @perahoky

    Hello, i'm having the same problem. cannot find any related logs (e.g. connections or redundant log messages or errors).
    nextcloud
    Linuxserver.io version:- 33.0.4-ls433 Build-date:- 2026-05-28T18:26:57+00:00
    takes 100% CPU through multiple php-fpm processes. the website itself is very slow.

  27. arktisk-varg commented on Jun 1, 2026

    @arktisk-varg

    Yes, I would kindly ask to re-open this issue or that someone create a new one.

  28. jerheij commented on Jun 1, 2026

    @jerheij

    Yes, I would kindly ask to re-open this issue or that someone create a new one.

    I wouldn't mind doing it but I don't have any logs or anything showing the errors, just the symptoms experienced through usage.

    Created new ticket referencing to this one: link

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions