Ticket #2483 (new defect)

Opened 8 years ago

Last modified 8 years ago

Make RAM Caches ZEO aware

Reported by: gracinet Owned by: gracinet
Priority: P2 Milestone: CPS 3.6.1
Component: CPS (global) Version: 3.5.2
Severity: normal Keywords: cache ram ZEO


In general RAM Caches are local to a given ZEO client (with exceptions, such as CPSPortlet's caches). This means that the client code has to be aware that there could be stale entries, etc. Usually the answer is to avoid overly aggressive settings.

The timestamp based system of CPSPortlets is good enough (once #2482 is done) to be generalized and provided in CPSUtil

There are lots of caches in CPS that would benefit from a ZEO-aware variant of RAMCacheManager: CPSUserFolder's user cache, CPSDirectory request caches (ZODB, LDAP…).

Current Plone documentation suggests registering a local utility providing  http://memcached.org/ Memcached support for that kind of purposes.

I'm not sure at this point whether this kind of approach is doable in the 3.5 branch, and we'd need a self-standing solution (not memcached, though it's neat) anyway. Factorizing caches out of CPSPortlets is relatively easy, and most of the refactor work would be needed to switch to support the interface that Plone propones.

In any case, implementation must be compatible with Plone's

Change History

comment:1 Changed 8 years ago by gracinet

Link in plone.caching documentation:  http://pypi.python.org/pypi/plone.app.caching#the-ram-cache By compatible, I meant to comply (not necessarily import) the same interface.

comment:2 in reply to: ↑ description Changed 8 years ago by madarche

Replying to gracinet:

[...] Current Plone documentation suggests registering a local utility providing  http://memcached.org/ Memcached support for that kind of purposes.

Being able to use a key-value cache like memcached would be nice.

And to be complete one should mention Redis  http://redis.io/clients that I prefer, because this key-value cache has more commands to be able to explore what's in the cache, and its store is persistent (while memcached store is lost when the program stops or restarts). And at last Redis is supposed to be as fast as memcached  http://antirez.com/post/redis-memcached-benchmark.html . That would be cool to have Redis support.

comment:3 Changed 8 years ago by gracinet

Yes, I've heard of Redis too. It's very clear on plone.caching documentation that the Memcached support is an easily plugged example, thanks to the ZCA. It's quite likely that there is already an implementation in some community package.

But that's for the future, and having a self-contained solution is necessary.

comment:4 Changed 8 years ago by gracinet

  • Milestone changed from CPS 3.5.4 to CPS 3.6.1

Big rewrite -> 3.6, of course.

Note: See TracTickets for help on using tickets.