Nextcloud page load slow since Nginx 1.25

Nextcloud version (eg, 20.0.5): 27.1.5.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.25
PHP version (eg, 7.4): 8.2

The issue you are facing:
Since the update of Nginx from 1.18 to 1.24 and then also to 1.25, Nginx uses 100% CPU during the initial page load of Nextcloud and the page load takes about 10 seconds. With Nginx 1.18, the page load took less than 2 seconds and did not use much CPU. I have reviewed and looked at all configurations for Nginx and phpFPM and no longer know what else could be causing this. After the initial page load, the navigation is fast and does not require much CPU, but when Nextcloud is reloaded without cache (Ctrl + F5), the problem persists again.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

Operate Nextcloud with Nginx 1.25

The output of your Nextcloud log in Admin > Logging:

nothing special

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "ehv.ch",
            "cloud.ehv.ch"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.1.5.1",
        "overwrite.cli.url": "https:\/\/cloud.ehv.ch",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "pipe",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "default_language": "de",
        "force_language": "de",
        "default_locale": "de-ch",
        "force_locale": "de-ch",
        "knowledgebaseenabled": false,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "updater.release.channel": "stable",
        "filesystem_check_changes": 1,
        "skeletondirectory": "",
        "ldapUserCleanupInterval": 51,
        "mysql.utf8mb4": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "filelocking.ttl": 3600,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpsecure": "ssl",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "user_sql",
            "printer",
            "files_trackdownloads",
            "files_antivirus",
            "twofactor_admin",
            "impersonate",
            "integration_moodle",
            "twofactor_reminder"
        ],
        "sharing.enable_share_accept": true,
        "sharing.force_share_accept": true,
        "trashbin_retention_obligation": "auto, 90",
        "activity_use_cached_mountpoints": true,
        "default_phone_region": "CH",
        "data-fingerprint": "184fa324e61214b0666d98b10940648a",
        "maintenance_window_start": "1",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
    }
}

This behaviour makes me think it might be a specific app or resource in NC. Can you take a look at your browser’s network log and see what takes the longest to load?

The most time it is inactive:

In network there are two points.
core-common.js:


Download of Files?

merged-template-prepend.js:


Waiting on server answer?

i’ve found the problem. It was my brotli compression level 11 :upside_down_face:. Thanks for your hint.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.