Skip to main content

Cache ZCatalog results with memcached - experimental

Project description

Introduction
============
collective.catalogcache uses memcached to cache ZCatalog search results.

Caching is transparent. Invalidation code is called at appropriate
places to ensure that the state of the cached results remains consistent.

The use of memcached enables the safe use of caching in a distributed
environment.

*** WARNING ***
collective.catalogcache is a big plaster to put over your site while you
determine why things are slow. Use in production is recommended for the brave /
foolhardy.

Requirements
============
Zope 2.9.6 - Zope 2.10.6. Other versions are possibly supported but not
tested.
memcached. Any recent version should work. Download from
http://www.danga.com/memcached.
python-memcached. Download from
http://pypi.python.org/pypi/python-memcached.

If memcached or python-memcached is not available the catalog will
function as usual.

Installation
============
A buildout is provided at
http://dev.plone.org/collective/browser/collective.catalogcache/trunk/buildout.cfg.
The buildout is for Plone 3, but the product can be used with plain Zope.

To enable collective.catalogcache for an existing installation ensure
that the following is present in your buildout.cfg

In the eggs section collective.catalogcache

In the zcml section collective.catalogcache

You must edit your zope.conf to declare eg.
<environment>
MEMCACHE_SERVERS 127.0.0.1:11211,127.0.0.1:11212
</environment>

You *must* ensure that different logical Zope instances do not use the
same memcache servers. Naturally Zeo clients *must* use the same set of servers.

Run ./bin/buildout -Nv and restart your instance.

Notes on memcached
==================
memcached is designed to run in a distributed environment, hence it is a
good idea to run at least two instances on a single machine. More is possibly
better depending on your hardware.

To start up two memcached instances for use with the example
MEMCACHE_SERVERS declaration do

memcached -u root -d -m 256 -l 0.0.0.0 -p 11211
memcached -u root -d -m 256 -l 0.0.0.0 -p 11212

Changelog
=========

0.2
---

* Better documentation

* Handle infrequent KeyErrors gracefully

0.1
---

* Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.catalogcache-0.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

collective.catalogcache-0.2-py2.4.egg (21.5 kB view details)

Uploaded Source

File details

Details for the file collective.catalogcache-0.2.tar.gz.

File metadata

File hashes

Hashes for collective.catalogcache-0.2.tar.gz
Algorithm Hash digest
SHA256 b7259953af3a13b2ed341678c86d6a801b4b0c848afb78ff1c9e975eaf1e1a1b
MD5 9f654ddea5a241c004c5b346b1602de1
BLAKE2b-256 782354e79b00b61b11ded9d4783b7585f84014d79061355a70f492277a1c4b1f

See more details on using hashes here.

File details

Details for the file collective.catalogcache-0.2-py2.4.egg.

File metadata

File hashes

Hashes for collective.catalogcache-0.2-py2.4.egg
Algorithm Hash digest
SHA256 ecf06d8a5121228218f197e68504bae9576aa9820a2d3eb6c2f6bb8477d49069
MD5 1b45b1781ff4f1a8a36c594c8d81cc0a
BLAKE2b-256 e5b77eb9a2d385f04724d3ef6799bf52407e9b7ae300eaee2c246ee3d72c444b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page