CacheManager missing in 2.6.2b4 :-(
Hi, I introduced a cache manager on http://www.bay-c.co.uk to cache the page templates that generate the two lower boxes in the right column, sincethese don't change very often. When I first did this, all worked amazingly well. However, I just checked the cache manger stats page today and I'm getting 25 misses per hit, not very good at all :-( To boot, there are 193 entries in the cache for a method that doesn't change, and they're taking up 350kb of RAM for no good reason. Is this likely to be a bug in 2.6.2b4 or could I haev tweaked something to get these kind of bad results? thanks for any help, Chris
Chris Withers wrote:
However, I just checked the cache manger stats page today and I'm getting 25 misses per hit, not very good at all :-( To boot, there are 193 entries in the cache for a method that doesn't change, and they're taking up 350kb of RAM for no good reason.
Did you define a non-empty set of request variables? If so its entirely possibly thats why there are different entries for the same method. Is the method a page template? RAM Cache Managers are lousy at caching page templates because page templates store data in their keywords which can change as the memory usage of your zope process changes and python re-orders things. Finally, remember that 350k is an aproximation garnered by the pickle size of the cached content, its not an exact reflection of the actual memory consumption, its only ment as a rough guide.
Is this likely to be a bug in 2.6.2b4 or could I haev tweaked something to get these kind of bad results?
Its probably just reflective of some of the design choices behind RAM Cache Manager. I wrote a diatribe on caching 2 months ago, check it: http://marc.theaimsgroup.com/?l=zope&m=105460381811223&w=2 -- Jamie Heilman http://audible.transient.net/~jamie/ "We must be born with an intuition of mortality. Before we know the words for it, before we know there are words, out we come bloodied and squalling with the knowledge that for all the compasses in the world, there's only one direction, and time is its only measure." -Rosencrantz
Jamie Heilman wrote:
Did you define a non-empty set of request variables?
Nope, I got a empty check box...
method. Is the method a page template? RAM Cache Managers are lousy at caching page templates because page templates store data in their keywords which can change as the memory usage of your zope process changes and python re-orders things.
Ah, these are page templates, but I never used to haev this problem. What do you mean by "page templates store data in their keywords"? I would have thought that ram cache menagers would just cache the result of the call, which should be a string, right?
Its probably just reflective of some of the design choices behind RAM Cache Manager. I wrote a diatribe on caching 2 months ago, check it: http://marc.theaimsgroup.com/?l=zope&m=105460381811223&w=2
That link was pretty slow, in fact it times out. Anywhere I can read aforementioned diatribe? cheers, Chris
Chris Withers wrote:
Jamie Heilman wrote:
That link was pretty slow, in fact it times out. Anywhere I can read aforementioned diatribe?
any zope list archive (though marc appears to be up for me) subject is "caching in zope; tips, tricks, & lessons learned" a google search on the phrase will give you a good number of options -- Jamie Heilman http://audible.transient.net/~jamie/ "Paranoia is a disease unto itself, and may I add, the person standing next to you may not be who they appear to be, so take precaution." -Sathington Willoughby
Jamie Heilman wrote:
any zope list archive (though marc appears to be up for me) subject is "caching in zope; tips, tricks, & lessons learned" a google search on the phrase will give you a good number of options
Had a look, wow, that does suck :-( What's the best way we can fix the problems you describe? cheers, Chris
Chris Withers wrote:
Jamie Heilman wrote:
any zope list archive (though marc appears to be up for me) subject is "caching in zope; tips, tricks, & lessons learned" a google search on the phrase will give you a good number of options
Had a look, wow, that does suck :-(
What's the best way we can fix the problems you describe?
That depends on the cache replacement policy you need. If you're not tied to LFU then you can just switch to using my MemoryCache product. (With all the various caveats surrounding it, of course, python 2.2, patching Zope, etc.) I designed it so I could work around all those issues. Another alternative is to track down exactly why PageTemplate hands cache managers those dictionaries, I'm not convinced the reasons are rooted in sensibility, but I haven't researched it in depth. As far as RAM Cache Manager just generally being wasteful with memory, well thats just a design choice, I don't expect it will change. -- Jamie Heilman http://audible.transient.net/~jamie/ "Most people wouldn't know music if it came up and bit them on the ass." -Frank Zappa
[moving to ZPT list]
issues. Another alternative is to track down exactly why PageTemplate hands cache managers those dictionaries, I'm not convinced the reasons are rooted in sensibility, but I haven't researched it in depth.
Anyone here know why ZPT's are doing their best to make RAM cache managers useless? ;-) *grinz* Chris
On Tue, 05 Aug 2003 12:40:44 +0100 GMT (..13:40 where i live(GMT+2) ) Chris Withers asked the Zope mailinglist about the following:
Hi,
I introduced a cache manager on http://www.bay-c.co.uk to cache the page templates that generate the two lower boxes in the right column, sincethese don't change very often.
When I first did this, all worked amazingly well.
However, I just checked the cache manger stats page today and I'm getting 25 misses per hit, not very good at all :-( To boot, there are 193 entries in the cache for a method that doesn't change, and they're taking up 350kb of RAM for no good reason.
What REQUEST variables have you set for the cache manager ? It wil store one entry for each unique combination of REQUEST variables defined for the cache manager. so.. if you leave it at the default "AUTHENTICATED_USER" each user will have his own version stored.. If the methods are truly non-changing, leave that box all empty :) -- Geir Bækholt
Geir Bækholt wrote:
What REQUEST variables have you set for the cache manager ?
None! These methods can be chaches irrespective of any variables...
If the methods are truly non-changing, leave that box all empty :)
it is :-) cheers, Chris
participants (3)
-
Chris Withers -
Geir Bækholt -
Jamie Heilman