Controlling the cache size when using database as a backend Magento

If you have been using the database as a cache storage mechanism (Eg. ) and you have a large number of SKUs, you will start to see a database that increases in size by quite a measure. A customer of ours with around 160k SKUs, had a “core_cache” table that had grown to just under 10Gb and around 960k rows – causing difficulties during some operations due to table locks. Whilst it is safe to empty the table, truncating a 10Gb table will take quite a long time, and all the while it will be locked, causing connections to queue up, eventually maxing out the available connections for your MySQL user/total – not good. To make it a little more manageable, we quickly added a little intelligence to the table, so that it can “self-rotate”. This could be applied in the PHP itself, but for now, it was quicker to … Continue reading