Historical log data deletion not deleting data



We have tried a number of times to delete historical log data via the dashboard.

We can see CPU utilization on the server go up when this starts, but data doesn’t seem to ever actually be deleted.

I see queries like this run, and run for a long time.

SELECT idvisit FROM piwik_log_visit WHERE idvisit > ‘0’ AND visit_last_action_time < '2017-04-21 0

INSERT IGNORE INTO piwik_tmp_log_actions_to_keep SELECT idaction_url FROM piwik_log_link_visit_actio

And then eventually the server goes back to normal utilization and the database size status screen seems unchanged.

Is there a more reliable way to initiate the process or gather information regarding any errors? There is nothing relevant that I can see in the Apache error log.



I do see this in the logs

[Thu Apr 11 23:37:46.417919 2019] [php7:notice] [pid 7938] [client xxx.xxx.xx.xx:55805] Error in Matomo: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, referer: http://analyticsbeta.xxxxxxx.com/index.php?module=PrivacyManager&action=privacySettings&i

Is there anything that can be done? It seems this is due to the 100+GB size of our database.