serverinfo icon indicating copy to clipboard operation
serverinfo copied to clipboard

Monitoring endpoint very slow with php 7.4

Open ebogaard opened this issue 4 years ago • 3 comments

We use the serverinfo endpoint for our monitoirng needs. After upgrading from php 7.3 to 7.4, we needed to increase the timeout for retrieving the xml or json response from the severinfo endpoint from 5 sec to 45 sec to be able to succesfully retrieve the information.

Steps to reproduce

  1. Make sure Nextcloud 18.0.6 runs on php 7.4.7
  2. Use curl to GET the endpoint: date -R ; curl -u admin:xxx https://xxx/ocs/v2.php/apps/serverinfo/api/v1/info ; date -R
  3. Note the timestamp before giving the curl command and the timestamp after Note that we have LDAP and SAML authentication enabled and use a LDAP user for authentication when accessing this endpoint.

Expected behaviour

I expect the results to be returned in less than 5 seconds

Actual behaviour

It takes about 30 seconds to retrieve the information.

Server configuration

Operating system: Centos 7 x64

Web server: httpd 2.4.43

Database: MariaDB 10.2

PHP version: 7.4.7

Nextcloud version: 18.

Where did you install Nextcloud from: tar.bz

List of activated apps:

Enabled:
  - accessibility: 1.4.0
  - activity: 2.11.0
  - admin_audit: 1.8.0
  - cloud_federation_api: 1.1.0
  - comments: 1.8.0
  - dav: 1.14.0
  - deck: 1.0.3
  - drawio: 0.9.6
  - federatedfilesharing: 1.8.0
  - files: 1.13.1
  - files_automatedtagging: 1.8.3
  - files_fulltextsearch: 1.4.2
  - files_markdown: 2.3.0
  - files_pdfviewer: 1.7.0
  - files_rightclick: 0.15.2
  - files_sharing: 1.10.1
  - files_trashbin: 1.8.0
  - files_versions: 1.11.0
  - files_videoplayer: 1.7.0
  - firstrunwizard: 2.7.0
  - fulltextsearch: 1.4.1
  - fulltextsearch_elasticsearch: 1.5.1
  - impersonate: 1.5.2
  - lookup_server_connector: 1.6.0
  - nextcloud_announcements: 1.7.0
  - notes: 3.5.1
  - notifications: 2.6.0
  - oauth2: 1.6.0
  - password_policy: 1.8.0
  - photos: 1.0.0
  - privacy: 1.2.0
  - provisioning_api: 1.8.0
  - recommendations: 0.6.0
  - richdocuments: 3.7.2
  - serverinfo: 1.8.0
  - settings: 1.0.0
  - sharebymail: 1.8.0
  - spreed: 8.0.9
  - support: 1.1.1
  - systemtags: 1.8.0
  - text: 2.0.0
  - theming: 1.9.0
  - twofactor_backupcodes: 1.7.0
  - updatenotification: 1.8.0
  - user_ldap: 1.8.0
  - user_saml: 3.0.1
  - viewer: 1.2.0
  - workflow_pdf_converter: 1.3.2
  - workflowengine: 2.0.0
Disabled:
  - encryption
  - federation
  - files_external
  - logreader
  - survey_client

Nextcloud configuration:

{
    "system": {
        "version": "18.0.6.0",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxx",
            "yyy"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "session_keepalive": true,
        "session_lifetime": 1209600,
        "remember_login_cookie_lifetime": 1209610,
        "overwrite.cli.url": "https:\/\/xxx",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "ldapIgnoreNamingRules": false,
        "theme": "xxxx",
        "maintenance": false,
        "sharing.minSearchStringLength": 2,
        "upgrade.disable-web": true,
        "simpleSignUpLink.shown": false,
        "log_type": "file",
        "syslog_tag": "nextcloud",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "log_rotate_size": "104857600",
        "loglevel": 2,
        "logtimezone": "Europe\/Amsterdam",
        "logdateformat": "Y-m-d H:i:s",
        "lost_password_link": "https:\/\/xxx\/reset-password",
        "trashbin_retention_obligation": "auto, 60",
        "versions_retention_obligation": "auto",
        "preview_libreoffice_path": "\/opt\/libreoffice6.4",
        "cache_path": "\/opt\/repo\/nc_cache",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "app_install_overwrite": [
            "fulltextsearch"
        ]
    }
}

Client configuration

Browser:

Operating system:

Logs

Nextcloud log (data/owncloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

ebogaard avatar Jun 23 '20 21:06 ebogaard

Same with 20.0.1 have to wait for 45 sec or longer

poltrian avatar Nov 05 '20 08:11 poltrian

After a php 7.4 update it works well again

poltrian avatar Nov 08 '20 10:11 poltrian

I'm having the same issue with latest apache Docker version

adripo avatar Nov 09 '21 00:11 adripo

Storage stats collection has since been moved (#297) to a background task:

https://github.com/nextcloud/serverinfo#configuration

This was a key contributor to slowness on the endpoint (and db server load for that matter).

joshtrichards avatar Jun 05 '23 16:06 joshtrichards