I'm having some issues on various D7 sites with some cache tables growing stupidly large (e.g cache_metadata or cache_menu) which then makes drush cc all very slow (more than 1 minute).

Do you think that there is any problem if I setup a nightly linux cronjob which will be truncating cache and cache_* tables apart from cache_form? And after that I plan on executing a drush cc all for safety.

p.s I do not plan on investigating and trying to fix the root cause that makes those tables grow large.


Cron job to truncate the tables might cause some metadata locks due to the TRUNCATE command being a DDL statement; depends on how busy your server is. What APDQC does is a table rename swap and then truncate; if you did something similar then you should be ok. APDQC will also use gzip to make the table sizes smaller; something that would be a benefit in your case. Without compression our DB cache tables would take about 50GB, they now take about 12gb.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.