You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by BeerBong <al...@samara.net> on 2001/02/08 08:20:33 UTC

Re[2]: File::Cache problem

Hello DeWitt,

Wednesday, February 07, 2001, 6:51:24 PM, you wrote:


DC> On Wed, Feb 07, 2001 at 04:02:39PM +0400, BeerBong wrote:

>> Cache size after 24 hours of working

>> via 'du -s' - 53M
>> via 'perl -MFile::Cacje -e"print File::Cache::SIZE('PRTL')"' - 10M

DC> That looks like a serious bug.  Can you double check on that?  Where
DC> are you running the "du -s"?

maul:/tmp/File::Cache/apache# ls
PRTL  PRTLDev
maul:/tmp/File::Cache/apache# du -s *
27924   PRTL
536     PRTLDev
maul:/tmp/File::Cache/apache# perl -MFile::Cache -e"print File::Cache::SIZE('PRTL')"
4178662
maul:/tmp/File::Cache/apache# perl -MFile::Cache -e"File::Cache::REDUCE_SIZE(1000000,'PRTL')"
maul:/tmp/File::Cache/apache# perl -MFile::Cache -e"print File::Cache:SIZE('PRTL')"
4178662
maul:/tmp/File::Cache/apache# 

DC> The SIZE( ) method returns the total size of the objects in the cache,
DC> not including the overhead of directories themselves.  As the
DC> documentation explains, it isn't a perfect mechanism, but it should be
DC> a lot closer than you experienced.

I understand that, but it is not a problem. Why size of cache is not
reduced ? There are not any warnings, just nothing happens.


>> What is the best way to limit cache ?
>> May be variant when File::Cache::REDUCE_SIZE(10485760) in cron.dayly
>> will be better solution ? I this case max_size doesnt need to specify
>> in object initialization params...

DC> I personally prefer using a cron job to periodically limit the size of
DC> the cache.  I don't like using "max_size" because of the overhead
DC> involved on every set.  I'd rather just fine tune the number of times
DC> a cron script is executed (i.e., once an hour vs. once a day).



>> Another kind of problem appears recently.
>> 
>> In logs
>> [Wed Feb  7 15:42:57 2001] [error] Couldn't rename /tmp/File::Cache/.description.tmp13984 to /tmp/File::Cache/.description at /usr/web/inc/WebCache.pm line 15
>> [Wed Feb  7 15:44:37 2001] [error] Couldn't rename /tmp/File::Cache/apache/PRTL/b/5/a/b5a261aa13cf0ddfd41beb7d64960248.tmp13441 to
>> /tmp/File::Cache/apache/PRTL/b/5/a/b5a261aa13cf0ddfd41beb7d64960248 at /usr/web/inc/WebCache.pm line 87
>>         ...propagated at /usr/web/inc/Apache/Portal.pm line 109.
>> 
>> What I can do ?

DC> Unfortunately the error message doesn't tell me enough.  If you can,
DC> please modify lines 1578 and 1579 of Cache.pm to read as follows:

DC>    rename ($temp_filename, $filename) or
DC>      croak("Couldn't rename $temp_filename to $filename:  $!");


DC> The next time it hangs, the error message will have more information.

DC> I'll fix that in the next version of File::Cache.

Done...
Wait for errors now.

--------------------------------------------
Sergey Polyakov               aka "BeerBong"
Chief of WebZavod     http://www.webzavod.ru
Tel. +7 (8462) 43-93-85 | +7 (8462) 43-93-86
mailto:alexei@samara.net