Server very slow doing file move and other similar operations

There is nothing in the kernal log other than expected iptables stuff. I really don’t think the overall system is having a problem. For example, there’s a daily rsnapshot that runs on all 115,000 files and backs up to a sluggish USB drive and that runs in a reasonable amount of time. And like I previously mentioned, thumbnail generation is fairly quick.

File system is ext4.

Interestingly the occ command line file move also takes a long time (10s for this 380k image). Simply copying the same file to /tmp takes 6ms. Moving a file within the NC data directory using “mv” is similarly fast.

/var/www/nextcloud# time sudo -u www-data php occ files:move  chris/files/Pictures/Autoupload/test-image2.png chris/files/Pictures/Screenshots/test-image.png
real    0m10.151s
user    0m0.344s
sys     0m0.065s

No external mounts for NC; no encryption; no anti-virus.

There are a few sql queries slower than 2s (mostly slightly over 2s) but I don’t see any logged when I do the command line file move above.