I have seen similar questions to this before but they do not solve my problem. This is Drupal 8.
Today the watchdog table on one of our sites exploded to 12GB in size. No other table in the DB is above a few dozen MBs if that.
Logging was only set to record the last 1000 events. I then turned even that down to 100 and ran cron a few times.
It dropped back down to 1GB... then up to 5.9GB in about 30min. When I try to inspect it with brush wd-show --count=1000
or something like that it only shows about 100 entries.
What is all the size coming from?
Additionally, the mysql database is still showing a disk as reported by du
of 12GB...
I've also tried flushing and clearing the cache query in mysql and restarting mysql.
I only have 20GB of space on this server and it is not a very big site, what is going on and how can I stop it? If this goes on it will crash the site.
I was messing around with a view that used a contextual filter to a taxonomy term name with multiple values. Ok, I could see that using up some cache or throwing some errors... but 12GB!
EDIT: Ok the size on disk after deletion can be fixed by Optimizing the table: OPTIMIZE TABLE sitedb.watchdog
. However, I still would like to know if there is someway to stop watchdog growing out of control this way? I had already limited the entries so I do not understand how it could get so big...
DELETE
s records from that table, andDELETE
doesn’t reclaim disk space until youOPTIMIZE
. If you have a lot of turnover on that table, it’ll use a lot of disk space. Fixing the underlying problems that are causing it to fill up would be best, but you could also consider running a cron job to truncate the table (which reclaims the disk space immediately), or just turn it off altogether and replace with syslog as 4k4 mentioned