Delete log data of deleted sites can cause huge spike in connections and CPU usage. #20221
Labels
Stability
For issues that make Matomo more stable and reliable to run for sys admins.
Milestone
Recently, we've seen a huge amount of connections to our database for a short time. This was likely caused by the PrivacyManager task that deletes logs for a deleted site.
We've seen quite a few
DELETE log_visit FROM log_visit log_visit WHERE log_visit.idsite = ?
and similar queries during that short time. While there is an index on most of the queries, maybe if there's a lot of data to be deleted it may still queue a lot of issues or maybe specific log tables cause locks. It's actually a recurring even that Monday evening we see a higher DB connection and CPU usage for a short time.Can we look at solutions for this like deleting data in bulk say 100,000 records at a time so that in between afterwards a few requests can be processed?
The text was updated successfully, but these errors were encountered: