High CPU Usage in Firefox

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).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.9
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian Trixie on client, Bookworm on server
  • Web server and version (e.g, Apache 2.4.25):
    • n/a
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n/a
  • PHP version (e.g, 8.3):
    • n/a
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • n/a
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • n/a
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I see a high CPU usage on the client, specifically related to my Nextcloud browser tab.

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

  1. Install Nextcloud.

  2. Open a browser and point to the Nextcloud server, eg. viewing the Calendar.

  3. Open ‘top’ or ‘htop’ on the client and observe a high CPU load. Or, just listen to the fans howling.

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.

n/a

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Firefox 144

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

n/a

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - app_api: 5.0.2
  - appointments: 2.6.1
  - bruteforcesettings: 4.0.0
  - calendar: 5.5.7
  - checksum: 1.2.6
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - contacts: 7.3.5
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - duplicatefinder: 1.7.3
  - event_update_notification: 2.7.0
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_accesscontrol: 2.0.2
  - files_archive: 1.2.7
  - files_automatedtagging: 2.0.0
  - files_downloadlimit: 4.0.0
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - files_versions_s3: 1.2.0
  - group_default_quota: 0.1.11
  - groupfolders: 19.1.8
  - impersonate: 2.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - mail: 5.5.11
  - metadata: 0.23.0
  - nextcloud_announcements: 3.0.0
  - notes: 4.12.3
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
- quota_warning: 1.22.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - tasks: 0.17.0
  - terms_of_service: 4.6.0
  - text: 5.0.0
  - theming: 2.6.1
  - theming_customcss: 1.19.0
  - twofactor_backupcodes: 1.20.0
  - twofactor_totp: 13.0.0-dev.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflow_script: 2.0.0
  - workflowengine: 2.13.0
Disabled:
  - admin_notifications: 1.0.2 (installed 1.0.2)
  - apporder: 0.15.0 (installed 0.15.0)
  - comments: 1.21.0 (installed 1.3.0)
  - deck: 1.15.3 (installed 1.15.3)
  - electronicsignatures: 3.0.5 (installed 3.0.5)
  - encryption: 2.19.0 (installed 2.5.0)
  - external: 5.5.2 (installed 5.5.2)
  - federation: 1.21.0 (installed 1.3.0)
  - files_downloadactivity: 1.18.1 (installed 1.18.1)
  - files_markdown: 2.4.1 (installed 2.4.1)
  - files_rightclick: 1.6.0 (installed 1.6.0)
  - firstrunwizard: 4.0.0 (installed 2.4.0)
  - notify_push: 1.2.0 (installed 1.2.0)
  - richdocuments: 8.7.6 (installed 8.7.6)
  - spreed: 21.1.5 (installed 21.1.5)
  - suspicious_login: 9.0.1
- talked: 0.5.0 (installed 0.5.0)
  - twofactor_gateway: 0.20.0 (installed 0.20.0)
  - twofactor_nextcloud_notification: 5.0.0
  - user_external: 3.4.0 (installed 3.4.0)
  - user_ldap: 1.22.0
  - user_usage_report: 1.14.0 (installed 1.14.0)

As you can see, the process with the Nextcloud tab uses ~80% of the CPU. It sometimes uses less, but often more than that, even, and this is not a slow machine (AMD 8845HS CPU with enough memory). Cross-checking with Chromium yields that in Chromium, almost no CPU is being used. I’ve tried clearing the cache etc. on Firefox already, but to no avail. But I also can’t switch to Chromium, due to other problems with that browser.

in my quick test I can see firefox causing CPU spike when something happens, e.g. during login, switching between different apps (40-100%) on Debian Trixie and 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz laptop cpu but it is back to almost 0 after 2-3-4 seconds. at the end it is normal behaviour - as long you have the resources usually you want the website to load quickly rather save cpu and process longer.. and yes Chome is more optimised than FF.

the URL ..login/v2/flow/ belongs to a app password login experience Login Flow — Nextcloud latest Developer Manual latest documentation (likely initiated by desktop client) and I expect frequent polls there - but this should not occur during normal operation.

..maybe look at dev tools if you find something suspicious. quick check in my console log immediately shows possible issue:

Notifications permissions not yet requested NotificationsApp.vue:466:12
Has notify_push enabled, slowing polling to 15 minutes NotificationsApp.vue:230:12
Polling interval updated to 900000 NotificationsApp.vue:412:12
Started background fetcher as session_keepalive is enabled NotificationsApp.vue:279:13
Failed sending heartbeat, got: undefined UserStatus.vue:159:1
Got notification data, restoring default polling interval.

if there is no notify_push the browser polls frequently - but IMO still there should no constant load..

I have no idea how we could help here, I would recommend to get in touch with firefox community and try to get into.

I’ve enabled notify_push and tried to quit the desktop client, which doesn’t work (it restarts immediately), which was and is in “paused” state, anyway. The process from the desktop client looks quite different (‘/usr/bin/nextcloud --background’, not something with firefox). Despite the notify_push add-on being enabled, the browser issues a ‘PROPFIND’ request to the calendar every 30 seconds. Nothing is happening on the calendar, though, but in the Firefox Console, I can see Javascript errors. However, I have 8 calendars enabled and 8 more calendars disabled, mostly various calendars for holidays in other countries, if that matters. The JavaScript errors might be part of the problem, but otherwise, I’d expect the browser to should just sit idle, as it does under Chromium.