We have a large Drupal site with lots of menus and lots of content and recently upgraded to D6. Our site backups (mysql dump files) just after upgrade were about 150MB each. Then they grew to over 400MB.

I ran "show table status" in mysql and it appears the cache_menu table is over 300MB! It seems a bit excessive.

What's worse is it appears whenever I make changes to a menu, the next backup gets even larger. Last night's backup was over 600MB! That's up almost 200MB from the night before and I only changed a couple of menu entries.

Is there anyway to reduce the size of these? Is it something I should be concerned about?

Comments

chrism2671’s picture

I have the same problem. What did you conclude in the end?

schildi’s picture

is there a solution around for this problem? There are a lot of posts concerning large cache_menu table. But in D-6.20 the effect is still present.

ophelia’s picture

I have the same issue and I'm using Drupal 6.22. The database is too big to import via phpMyAdmin (for example, if I need to revert to a previously backed-up version of my db) because the cache_menu table is enormous and is the main reason my database size is too big to import. I could keep manually emptying it (is that bad? because I have no idea what purpose it serves), but that is not a feasible long-term plan.

schildi’s picture

In my case the garbage is cleared when calling manually "/update.php". But I have to do this every single day.

digger3d’s picture

Huge cache_menu table, grows like 400 mb per day with relatively small amounts of traffic. Any ideas how to fix?

lekvarnik’s picture

Same problem here. I have to flush cache manually every day.

schildi’s picture

Please compare new issue 231587#comment-4804234 against D8

digger3d’s picture

Quick and dirty
file: /includes/cache.inc

function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) {
// inserted the following:
  if ($table == 'cache_menu') {
  db_query("TRUNCATE `cache_menu`;");

      return;
        }
//end insert
  $serialized = 0;
  if (is_object($data) || is_array($data)) {
    $data = serialize($data);
    $serialized = 1;
  }
  $created = time();
  db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid);
  if (!db_affected_rows()) {
    @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, $created, $expire, $headers, $serialized);
  }
}