nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.89k stars 4.02k forks source link

Cron and OCC appear to leak massive amounts of memory when a cache is enabled #26184

Closed NotAFile closed 3 years ago

NotAFile commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Add any kind of cache declaration to the config e.g. 'memcache.local' => '\\OC\\Memcache\\Redis', (it doesn't actually have to work)
  2. run cron or any OCC command, such as occ list
  3. watch the memory usage rocket to gigabytes in seconds until the system grinds to a halt

Expected behaviour

occ list should not exhaust system memory

Actual behaviour

occ list exhausts system memory

Server configuration

Operating system: Ubuntu 20.04

Web server: Apache2

Database: Postgresql 12

PHP version: 7.4

Nextcloud version: (see Nextcloud admin page) 21.0

Updated from an older Nextcloud/ownCloud or fresh install: I tried both

Where did you install Nextcloud from: updater.phar as well as nextcloud.com zip

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.7.0 - activity: 2.14.3 - calendar: 2.1.3 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - dav: 1.17.1 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_automatedtagging: 1.11.0 - files_external: 1.12.0 - files_pdfviewer: 2.1.0 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - firstrunwizard: 2.10.0 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - nextcloud_announcements: 1.10.0 - notifications: 2.9.0 - oauth2: 1.9.0 - password_policy: 1.11.0 - photos: 1.3.0 - privacy: 1.5.0 - provisioning_api: 1.11.0 - recommendations: 1.0.0 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - support: 1.4.0 - survey_client: 1.9.0 - systemtags: 1.11.0 - text: 3.2.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.0 - updatenotification: 1.11.0 - user_status: 1.1.1 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 Disabled: - admin_audit - encryption - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost:8180", "example.com", "nextcloud.example.com" ], "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "https:\/\/nextcloud.example.com", "dbtype": "pgsql", "version": "21.0.0.18", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "UTC", "installed": true, "maintenance": false, "theme": "", "loglevel": 0, "log_type": "syslog", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpsecure": "ssl", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "updater.release.channel": "stable", "app_install_overwrite": [ "calendar", "direct_menu", "keeporsweep" ], "encryption.legacy_format_support": false, } } ```

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: N/A

Operating system: N/A

Logs

N/A, no output appears to be produced on stdout or any of the logs.

beankylla commented 3 years ago

Hello, Thank god i found this ticket! I have the same issue with a similar setup: I just use nginx instead of apache and APCu.

Fun fact: i commented the APCu line in my config.php and after running the cron without problem (for the first time since updating to NC21) i reopened the config.php and the line is completely gone.

i didn't erase it but it's gone. Pure magic

vorlon commented 3 years ago

Same issue here with a fresh 21.0.1 on Debian buster with "PHP 7.3.27-1~deb10u1" and APCu enabled as memcache.local. Commenting it out helped. #26154 probably describes the same/a similar issue.

kesselb commented 3 years ago

Closing in favour of https://github.com/nextcloud/server/issues/25742

qinohe commented 3 years ago

@Fuzzillogic , spoke too soon, you're right I do see the memory spike after enabling apcu cache and the command gets killed.:-( (see) https://github.com/nextcloud/server/issues/26472#issuecomment-816895068 Sorry posted in the wrong thread, will post it again in #25742