[horde] Cache slowly filling up with driver File

Michael J Rubinsky mrubinsk at horde.org
Mon Apr 27 01:05:34 UTC 2015


Quoting Arjen de Korte <arjen+horde at de-korte.org>:

> I use the filebased cache, which stores data on a tmpfs. Works fine  
> except for one slight problem, the number of files cached doesn't  
> stabilize at all, it keeps growing.
>
> Right after cleaning the cache partition, almost all cached files  
> are listed in the 'horde_cache_gc', so eventually these will be  
> caught during garbage collection. But I also see the number of files  
> that are *not* listed growing every day (which as far as I can see,  
> means these will never be removed).
>
> I see that in many places, no explicit lifetime is set when storing  
> an entry in the cache (for instance, the information retrieved by  
> the weather info), so these will never be GC'd as only files with  
> non-zero lifetime will make it into the 'horde_cache_gc'.

This isn't 100% true. When a cache value is requested from the cache,  
a $lifetime parameter can also be supplied. So, e.g., in the case of  
Horde_Service_Weather, we specify the $lifetime when reading the  
cache. If the $lifetime expired, then the cache library will (in the  
case of a file based backend) unlink the cache file. Granted, since  
this only happens when the specific cache key is requested, I see how  
this could lead to certain cache files perhaps never being GC'd if,  
again using Horde_Service_Weather as an example, weather location was  
requested once, and never requested again.

> Wouldn't it be a better idea to let *any* file stored in the  
> filebased cache timeout to prevent them from piling up?

For some data, sure, it might make sense to add a $lifetime parameter  
to the set() method if it doesn't already exist, but not all data  
necessarily should be automatically expired.



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5869 bytes
Desc: S/MIME Signature
URL: <http://lists.horde.org/archives/horde/attachments/20150426/adbbfacf/attachment.bin>


More information about the horde mailing list