High apache disk usage after file uploading

I am using Nextcloud in a virtual server; having sda for system and sdb for web+data.

When uploading big files (>5Gb) disk usage from apache block all other processes. The problem happens when upload finish, so it may be related to how Nextcloud rebuild the file and/or move it to folder.

I changed temp folder at php.ini; but it don’t grow much when uploading the file. Any hint of how to improve “uploading_last_step”?


What is your system configuration? Number of cores, clock speed, RAM allocation, etc.?

It is a 10Gb ram machine, virtualized and single core. After some digging I started to think it was a lock problem. I found some posts in the forum about a race condition and Redis was locking files for longer than expected. The problem appear to be solved after:

  • Enabling TRANSACTION_READ_COMMITTED (explained in nextcloud install documentation, I may missed it because my system comes from and old owncloud installation)
  • Disabling php buffer (it was suggested in sabre documentation)
    Now the server experience a high load, but don’t completely freeze for ~15 minutes.