Delete all logs over 180 days - high traffic

Dear Matt,

all the best for 2013 to you and the team!

I have posted previously about an error with my piwik installation, the sites stops for several hours and then starts working again by itself. Today i finally figured out where it comes from, it is the “delete old logs” function. It is running to long and it blocks access to the DB (table lock for delete records?) Currently i have set it to run weekly and delete all logs over 180 days. My current tables are:


label,data_size,index_size,row_count
piwik_log_action,195772416,28901376,1218006
piwik_log_conversion,16384,32768,0
piwik_log_conversion_item,16384,16384,0
piwik_log_link_visit_action,11511267328,8775532544,156250701
piwik_log_visit,8493662208,4490264576,32455313

How can i solve this problem?

Regards Mike

try to disable OPTIMIZE TABLE queries as per this FAQ: Troubleshooting - Analytics Platform - Matomo

This should help with this issue. if you still have it reply here, thx

Thank you Matt,

i have configured the new option and i will report back in one week if it works, can the date when the purge is running be configured?

Regards Mike