Historical log data deletion not deleting data

Hi,

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.

Thanks!

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
dSite=1&period=day&date=yesterday

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

Any thoughts on why this is failing? We have data since 2003 and we need to clean it up. Is there a manual or command line process that won’t timeout/fail?

I have a pwiki instance since 2000 with 1 TB with same behavior.

I also wait a command line or sql to clean up my database.