RE: [Zope] CacheManagers are cool :)

2001-01-30 Thread Seb Bacon

 anybody tried expiring an object,? say after 300 secs, the cached object
 expires, get invalidated and a new cached object is created when somebody
 requested the page.
 is there any simple way to expire a RAM Cache?

haven't tried this yet.

 also, for those who tried caching.  what do you guys do?  cache
 the methods
 that make up the bigger method?  or just cache the bigger method?

 e.g dtml method a is made from method b, c, d,...n
 do you cache a, or selectively cache b and/or c, d, ...

it depends on what's in each element.  the design of the caching system is
such that you can have as fained-grained a control as you wish.  the
decision is entirely up to you.  my fairly amateurish tests suggest that the
benefits of caching only really manifest themselves at high levels of
concurrency.  if the method (a) contains a little logic, items (b),(c) and
(d) are images, and the whole page is very frequently accessed, you'd
probably benefit from caching (a) in RAM, and using the HTTP Cache manager
for the other elements.  OTOH, you could expect proxies and browser caches
to handle elements such as images fairly well, so I imagine most of the
benefit would come from caching only the element of the page which contains
the logic.  If the page is accessed only a hundred times a day, you will see
little benefit from caching it, at the cost of some memory on your server.

in a scenario where (b), (c) and (d) each contain their own snippets of
logic, you would be wise to cache them all.  Otherwise you would lose the
benefits of caching (a), because to build the page, Zope is still making
hits to disk each time.

well, that's how I assume it works, anyway.  time for more tests, i think...

seb


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] CacheManagers are cool :)

2001-01-29 Thread ender

On Monday 29 January 2001 10:15, Seb Bacon wrote:
 I've just been experimenting with the RAM Cache manager, and FWIW I thought
 I'd share my findings:

 I ran some simple tests using ab against a single, dynamic page which has
 some display logic both in the filesystem product and dtml.  I cached the
 index_html using the default RAM Cache Manager settings.

 Without caching, response time appeared to increase in direct proportion to
 the number of simultaneous requests up to 10.  Above 10 connections,
 response time worsened dramatically.  When there were 15 simultaneous
 connections, the response time averaged at approximately 10 seconds.  The
 relationship looked logarithmic, but I didn't really take enough samples to
 be sure.  Plus, the system I tested it on only has 96Mb RAM, and it was
 swapping a bit.

 In all cases the cache improved performance.  The average response time was
 improved by up to 70% where more than 10 concurrent users were simulated.
 There was an improvement of 20% - 25% between 5 and 10 concurrent requests.
 There was no significant improvement where there were no concurrent
 requests.  The relationship between the number of simultaneous requests and
 the response time remained linear across all measured levels of
 concurrency.


very cool. although i find the lack of improvement on a non concurrent 
requests a bit strange if its a the dtml is doing real computation vs. 
serving a string from memory.

 Not exactly a real-life usage scenario, but it sounds impressive :)  Not
 sure I understand what the cache keys are for though... is there any more
 documentation forthcoming on this?


so you can cache requests based on dynamic input. 

useful for authentication to present different cache pages to different 
users, and also to present common request dependent information from cache.

as for real documentation, use the source luke

k

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] CacheManagers are cool :)

2001-01-29 Thread Seb Bacon

  I've just been experimenting with the RAM Cache manager, and FWIW I thought
  I'd share my findings:
...
  There was no significant improvement where there were no concurrent
  requests. 
 
 very cool. although i find the lack of improvement on a non concurrent 
 requests a bit strange if its a the dtml is doing real computation vs. 
 serving a string from memory.

so do I :)

the dtml only iterates over some objects.  each object has a method
which checks the authenticated user and serves up content
accordingly.  in the test case the user is served the default view of
the object, so there's not really all that much logic going on.
perhaps this is why non concurrent, cached requests showed only a
1.3% speed improvement over uncached requests.  anyone?

  Not exactly a real-life usage scenario, but it sounds impressive :)  Not
  sure I understand what the cache keys are for though... is there any more
  documentation forthcoming on this?
 
 
 so you can cache requests based on dynamic input. 
 
 useful for authentication to present different cache pages to different 
 users, and also to present common request dependent information from cache.

I already read this in the online help, but for some reason my brain
only chose to understand it just now ;)
 
 as for real documentation, use the source luke

hmm, just had a quick 20 minute poke around, and I get the gist, but
I'd be happier if some obi-wan could guide me with the api docs
promised in the fishtank proposal

seb.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] CacheManagers are cool :)

2001-01-29 Thread [EMAIL PROTECTED]



  Not exactly a real-life usage scenario, but it sounds impressive :)  Not
  sure I understand what the cache keys are for though... is there any more
  documentation forthcoming on this?

 so you can cache requests based on dynamic input.

 useful for authentication to present different cache pages to different
 users, and also to present common request dependent information from cache.

 as for real documentation, use the source luke

anybody tried expiring an object,? say after 300 secs, the cached object 
expires, get invalidated and a new cached object is created when somebody 
requested the page.
is there any simple way to expire a RAM Cache?

also, for those who tried caching.  what do you guys do?  cache the methods 
that make up the bigger method?  or just cache the bigger method?

e.g dtml method a is made from method b, c, d,...n
do you cache a, or selectively cache b and/or c, d, ...

confusedly, yours


 k

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

-- 

http://www.kedai.com.my/kk 
http://www.kedai.com.my/eZine 

Help me save me from myself...


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )