I noticed that Matomo was doing a large amount of disk writes. Looking into it, I found that on every API request, Matomo was recreating index files for a number of directories in
tmp/ even though these files already exist. These unnecessarily writes are causing high disk I/O wait when under heavy load.
Live.getVisitorProfile API call (it might apply to other methods -- I haven't checked).
On every call:
Filechecks::mkdir()with these directories:
Filechecks::createIndexFilesToPreventDirectoryListing()is invoked on each directory, writing a new
index.phpeach time (even though they already exist)
I think the code should be optimised so that it doesn't perform these unnecessary writes. At the very least, check that these index files don't exist before writing to them.