Nextcloud Snap excessive disk writes

Nextcloud version (eg, 20.0.5): 27.1.4 (Snap)
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): Default that came with Snap package
PHP version (eg, 7.4): Default that came with Snap package

The issue you are facing:

Issue is quite simply the amount of disk writes Nextcloud does. Below is a picture from my Proxmox-host under which the Ubuntu-VM running Nextcloud runs.

The dip in the graph is the moment I stopped Nextcloud just to verify the situation. Nextcloud quite literally does 99.9% of the diskwrites. My VM storage can handle this, but I still find this a little weird. Iotop reports mysql writes from Nextcloud every 5-10 seconds. Nextcloud logs (when loglevel set to debug) show constant cronjobs running. All this when there is literally zero user action going on.

I did notice some repetetive reqIds when going through logs, but I have no knowledge if this is an actual problem. No errors or anything worth mentioning outside of this in the logs.

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

The output of your Nextcloud log in Admin > Logging:

{"reqId":"altV5DcKFGvs62NX8wBw","level":0,"time":"2024-01-21T22:00:32+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 14459","userAgent":"--","version":"27.1.4.1","data":{"app":"cron"}}
{"reqId":"altV5DcKFGvs62NX8wBw","level":0,"time":"2024-01-21T22:00:32+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 14460","userAgent":"--","version":"27.1.4.1","data":{"app":"cron"}}
{"reqId":"altV5DcKFGvs62NX8wBw","level":0,"time":"2024-01-21T22:00:32+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 14461","userAgent":"--","version":"27.1.4.1","data":{"app":"cron"}}
{"reqId":"altV5DcKFGvs62NX8wBw","level":0,"time":"2024-01-21T22:00:32+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 14501","userAgent":"--","version":"27.1.4.1","data":{"app":"cron"}}
{"reqId":"altV5DcKFGvs62NX8wBw","level":0,"time":"2024-01-21T22:00:32+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 16107","userAgent":"--","version":"27.1.4.1","data":{"app":"cron"}}

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

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => ,
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
  ),
  'trusted_proxies' =>
  array (
  ),
  'lost_password_link' => 'disabled',
  'datadirectory' => '/data',
  'overwrite.cli.url' => '',
  'dbtype' => 'mysql',
  'version' => '27.1.4.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'loglevel' => 1,
  'default_phone_region' => '',
  'mail_from_address' => '',
  'mail_smtpmode' => '',
  'mail_sendmailmode' => '',
  'mail_domain' => '',
  'mail_smtpsecure' => 'ssl',
  'mail_smtphost' => '',
  'mail_smtpport' => '',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'auth.webauthn.enabled' => false,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' =>
  array (
    0 => 'admin',
    1 => 'users',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
);

Just reporting that I seem to have solved this.

Earlier I changed my cron.php to run as follows:

sudo snap set nextcloud nextcloud.cron-interval=10m

That however seemed to be the culprit. The cronjobs somehow bugged and would just repeat constantly for some reason. This also explains the numerous cronjob logs with same reqId.

I changed the interval back to default 5 min and after initial cronjobs the writes decreased. Now the cronjob runs every 5 minutes, but the rest of the time there is hardly any writes going on. Everything is now as it should.

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