ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

db_cache folder always grows to take a large amount of disk space

January 19, 2008 12:24am

Subscribe [2]
  • #1 / Jan 19, 2008 12:24am

    44sunsets

    42 posts

    For some reason the cache seems to grow and take up huge amounts of disk space, 60MB or more. This is a big problem because my client’s hosting account only allows 200MB of space usage, and we already use up 150MB out of the box, with the cache empty. Every couple of days, my client gets “You are running low on disk space” warning emails from the webhost.

    Does anyone know why the cache keeps growing so big? I’ve set “Maximum Number of Cacheable URIs” to 5, but when I FTP into the site and look at the db_cache folder, there are currently 55 subfolders in there, and its taking up a lot of space.

    Is this some kind of bug? I’ve already tried clearing all the caches using the utility section in the Control Panel, which fixes things temporarily, but the cache always grows back to really large sizes.

    I’ve also tried manually deleting all the db_cache folder and all that, and the chmod permissions are correct, set to 777.

    I am using ExpressionEngine 1.6.1

  • #2 / Jan 20, 2008 11:26am

    Robin Sowell

    13255 posts

    For a temp fix, we could setup an EE cron to clear all caches every 12 hours or so.  For longer term- I need to talk to the crew.  I do replicate- cut the max cache down to 5, turned on db caches, and my sql_cache folder is holding more than five now.  However- I’m not sure a file dead matches up to a ‘uri’, so I need to do a bit of poking.

    About the only place I can track down the max_cache setting affecting things is in db.mysql.php- and that’s for the db_cache folder:

    //$max = ( ! $PREFS->ini('max_caches') OR ! is_numeric($PREFS->ini('max_caches')) OR $PREFS->ini('max_caches') > 1000) ? 100 : $PREFS->ini('max_caches');
        
                    if ($i > 150)
                    {
                        $this->delete_directory($this->cache_dir);
                    }

    Looks like a hard coded limit of 150 files in db_cache.  If you were just plain curious, you could remove the comments and switch out $max for $i- but for long term, I really want to talk to the crew and see what’s up.  If that code is commented out, it’s for a reason.

  • #3 / Jan 20, 2008 1:00pm

    Robin Sowell

    13255 posts

    Another suggestion if space is at a premium is to turn database caching off for the time being.  Depending on the host, they may already be caching queries- in which case, performance would actually increase.  And in either case, it would eliminate the folder size problem.

  • #4 / Jan 21, 2008 4:02am

    44sunsets

    42 posts

    Thanks for the reply, Robin. I’ve turned DB caching off, I don’t think it’ll impact performance very much.

    It would be good if you could talk to the crew to see if this behaviour is a bug or not. Granted, it’s unusual that the hosting account only has 200MB of space, but it’s the client’s account and not mine, so there’s not much I can do about the lack of space 😊

  • #5 / Jan 21, 2008 10:30am

    Robin Sowell

    13255 posts

    Well- if most of the site is being handled by EE, not a need for a ton of space.  And yep, I’ve dropped a word with the crew and will let you know what they have to say.  Our server guru has already chimed in- noting that on mysql 4/5, there should already be query caching going on, making the EE caching redundant.  On EH, he prefers us to run with it turned off, as it’s actually faster.  But… server setups vary, so I can’t say for sure you’ll see the same results on the client site.  (And I’m curious as to how max_cache should be coming into play myself- so the crew has been alterted.)

    Will let you know when I know.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases