Constant disk writes

Hello, I have Nextcloud (currently 27.1.3 on Ubuntu server 22.04) running on Proxmox and just wondered if this disk I/O frequency and write size (~900kb every 5 minutes) looks normal for a server that is currently only in active use by myself. I assumed it was the cron job but when I disabled the job the I/O pattern continued like this. It has been happening since version 22.x.x on Ubuntu server 20.04. Any ideas on what else it could be from? I know it’s not very excessive but I’m trying to preserve the life of my SSD for as long a possible.

please describe your setup.
Nextcloud in VM or lxc
Disc formatted as ext4 or zfs?

Greetings

It’s running on ext4 in a full VM. I tried disabling www-data’s nextcloud cron job again and the writes every 5 minutes dropped down to ~560kb. I checked root and the main system user’s crontab and they were both empty and there were no */5 jobs in the cron files in /etc either. I can’t seem to figure out what’s still writing that ~560kb every 5 minutes.

Actually the kb written didn’t change, it seems to have just split over 2 minutes for about six writes and then went back to how it was before (see image). The www-data user’s crontab is still disabled also.

[Edit]
Since I disabled www-data’s crontab Nextcloud is now complaining that the background job hasn’t been running, so It must be something other than the background job I assume.

When you disabled the cron job, did you make sure it was stopped also?

Did you make sure also no request was incoming with the same timing as the disk writes?

I’m not sure but just guessing here, could it be Nextcloud configured to log to a file and that’s what it’s doing periodically?

I’m out of guesses here. You could instrument Nextcloud with xdebug. There’s a function traces mode which prints function calls as soon as they get done.

If background jobs are truly disabled, the only way I can think of that Nextcloud could be generating this is if there is inbound traffic (e.g. client connections and/or activity via the web interface).

Some ideas:

  • Use ./occ background-job:list --limit=200 (the 200 is arbitrary but if you don’t specify it limits to only 10 jobs) to see what background jobs are in-place and when each last ran
  • Check your nextcloud.log (or equivalent) for transactions during the time periods in question
  • Check system cron in /etc/cron* since not all system cron jobs are defined under users
  • See what process pops to the top every 5 minutes or so via htop or top (or similar)
1 Like

Thank you for all the great suggestions. In searching I stumbled across a utility called fatrace so I installed it from my repo. It looks like it could be very useful for finding what is being written to disk, and what’s doing the writing, in real time. I will report back if I find the answer.

Thank you for all the great suggestions. In searching I stumbled across a utility called fatrace so I installed it from my repo. It looks like it could be very useful for finding what is being written to disk, and what’s doing the writing, in real time. I will report back if I find the answer.

fatrace will be on all my installs from now on. :slight_smile: The culprit was redis creating a full db snapshot every 300 seconds. Changing my redis config to use AOF instead of RDB mode persistence drastically reduced the amount of data it was writing to disk. Now to figure out if I even need redis at all with my installation (I had followed a Nextcloud setup guide in the beginning that suggested it).

Thanks again everyone.

Hi,
Can you share where you changed the Redis config, i have same issue with a snap installation on proxmox