Drupal Database size was very huge in production. As we are using memcache, apc and varnish for cache, Database should not be more. But cache_form we are using drupal database. So we want to find the size of each tables in the database.
First we wrote a query to find Database size
SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
From the above query, we able to get the each database size. it shows 1038mb as our database size.
Next we wrote one more query to find the each table size in our database
SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "db_name" ORDER BY (data_length + index_length) DESC;
result shows, cache_form table alone occupies 750 mb, others are 10mb or below. So this confirms that, we need to work on how to reduce the cache_form table size.
There was more resources was available in the internet to resolve this issue, some of them are
https://github.com/saitanay/force_fct
http://drupal.stackexchange.com/questions/11321/how-to-keep-cache-form-small
http://drupal.stackexchange.com/questions/69803/cache-form-table-size-is-enormous
http://drupal.stackexchange.com/questions/96744/cache-form-drupal-change-expire-time
we adapted solution which clears the cache_form table in corn
DELETE FROM {cache_form} WHERE expire < now();
Add new comment