if I upload a file (size doesn’t matter, e.g. 3MB) to my Nextcloud instance, it uploads it complete, but it not finishes the upload process (uploading progress 3MB / 3MB).
Then I look into the process list (htop) and one php-fpm process (with ~80%) and redis (with ~55%) has high cpu load for about 20 seconds. After the high cpu load of these two processes is gone, the upload process is completed.
But while the client who is still uploading and waiting for completing the upload process, other clients are already downloading the new uploaded file.
It is very annoying to have the slow upload performance. I had to increase the timeout value in nginx, so the client doesn’t abort the upload. Any other things on my Nextcloud instance have good performance.
Nextcloud version: 13.0.4 Operating system and version: CentOS 7.5 Apache or nginx version: nginx 1.15.0 PHP version: 7.2
Is this the first time you’ve seen this error? (Y/N): N
Steps to replicate it:
Upload file
The output of your Nextcloud log in Admin > Logging: nothing in log
The output of your Apache/nginx/system log in: nothing in log
No, Download is no problem. I already enabled the slow query log.
There are not much slow statements in there and it has nothing to do with file operations.
Here are two examples which are in the mariadb-slow.log:
42s query time is a lot. Is the news app filling the database too much? And nearly 20s for authtoken is also a lot, do your cronjobs run on a regular basis (check on your admin page when the cronjob ran for the last time).
Regarding redis, I haven’t seen many configuration problems with it. Perhaps check the log level that it tells you more in the logs. If it’s on the same host, you can connect to it through a socket, this is more secure and perhaps a bit faster.
On CentOS, it might be a good idea to keep an eye on SELinux, it can block certain things and lead to strange behaviour of other services.
I had heavy load on my server a few days ago. In normal operation there are no slow queries in the log (e.g. the last days). The news app has ~14k entries and cronjob is running fine every 15 min. So that is no problem at all.
Redis is running mostly in default configuration (official docker container). I will check a better log level. Maybe I can find something there.
The SELinux thing sounds very interesting. I can imagine that this could be the problem. I will investigate.
Thank you very much for your good input and advice! I need some time for it to check your points. I have atm not much free time to look at it. Thanks!
I just found the problem which caused the upload freezes:
I have >15k directories in the preview folder and ~1k from them had the attribute “size” set to -1 in the corresponding entry of the database table oc_filecache. Which triggers a scan each upload process and caused the freezes.
After running occ files:scan-app-data the entries gone away and the problem was fixed.