Web Development

CGI::Cache perl extension doesn't care for max_size disk space limiter

CGI::Cache is a great little perl module that takes advantage of Cache::SizeAwareFileCache to enable web site caching …

Features:

  • Can be easily added to any CGI script

  • mod_perl compatible

  • Rich control over caching policies

  • Auto-generation of cache keys from CGI parameters

and believe me… it's FAST - much faster than 1 SQL query (except you need at least 1 live Query in your application) and zillions faster than n x SQL + n x XML-http requests …

The only problem in the latest version 1.4142

line 226

</p>

  # Set default value for max_size

  ->{max_size} = ::SizeAwareFileCache::NO_MAX_SIZE

	<p>

must be fixed with

</p>

  # Set default value for max_size

  ->{max_size} = ::SizeAwareFileCache::NO_MAX_SIZE

    unless defined ->{max_size};

	<p>

to make sure the maximum cache size is taken care of…

I just noticed this at a 94% full disk – carrying a 40+ GB disk cache :-)

so the latest version – probably all of the versions – simply ignore the setting for max_size and fill up your hard-disk until you unix demons crash because they can't write their logs… :-)

I wrote David Coppit – the author already, so expect a bugfix soon – meanwhile you can dare to edit your /usr/lib/perl5/site_perl/5.8.0/CGI/Cache.pm with this extra…

But be warned: cleaning a 40GB cache down to 1 GB or whatever you want it eats up all the server space… I will probably opt in for a compete rebuild of the cache over time to avoid an hourlong downtime here…

Average rating
(0 votes)

Similar entries

  • I finally got on-site caching enabled, using the MT-plugin simply called “Cache”... Example here: my kingdom for a local cache of ORF.AT, local TV station. I just wonder to make it possible to enable site-search in the cached pages aswell…...

  • Experiences and tips and tricks for using wordpress as a content aggregator – 100,000 posts are not the average weblog volume

  • wow debugged to fix some real bad issues on this server …...

  • Over the last 2 weeks I’ve had problems on three sites with the exact same problem.

    The watchdog table grew FASTER than the cron job (which should delete old log entries older than e.g. 3 days) would have deleted it.

    This again ended in a “device full” last night when one watchdog table became 5 gigs.

    (and I had a “table full” problem on another site last week – tough 64bit MYSQL should be able to do 4TB spaces, that one was 4GB only)

    Now, it’s obvious that disk full problems shouldn’t be a problem for a content management system like Drupal to take care about,

  • Post about the advantage of Drupal for multi-site setups, hosting many different web sites from one codebase.