Discussion:
[Erp5-dev] Memcached tool
Pelletier Vincent
2006-12-06 14:07:33 UTC
Permalink
Hi.

I just added a memcached tool.
This tool provides an interface to a memcached server.

It is disabled by default because it would ad a dependence on python-memcached
and we want it to fail loudly if python-memcached is not present and the tool
is needed.

Features :

- Presents memcached as a dictionary
- Allows multiple uses of the same memcached using one connection
- Reads are cached during the transaction : prevents multiple reads of the
same value from memcached
- Writes to memcached are queued until transaction ends : prevents duplicate
writes
Remember : Each time memcached is restarted, the content is lost.

Quick tutorial :

In all cases (part 1) :
- Install python-memcached (see links below)
- Install & start a mamcached server somewhere on your network (see links
below)
- touch Products/ERP5Type/USE_MEMCACHED_TOOL (otherwise the tool will be in
disabled mode)

If you're updating from an older site :
- Update your products to get the latest version
- Go to Zope Managment Interface on your portal object (most likely /erp5)
- Select 'ERP5Type Tool' in the 'add' menu
- Select 'ERP5 Memcached Tool' in the offered choices
- Click 'Add'

In all cases (part 2) :
- Go to portal_memcached management screens
- Setup tht ip:port of your memcached server

It's ready to use !

Quick sample script :

# Begin
memcached_dict = context.getPortalObject().portal_memcached.getMemcachedDict(key_prefix='my_first_test')
value = memcached_dict['some_key']
print value
if value is None:
value = 0
memcached_dict['some_key'] = value + 1
return printed
# End

The printed values should be None, then 1, then 2, ...
If you restart memcached, the count wil stall at None until python-memcached
reconnects to memcached.

Memcached : http://www.danga.com/memcached/
python-memcached : ftp://ftp.tummy.com/pub/python-memcached/
(linked from the "client API" page on memcached site)
--
Vincent Pelletier
Alexandre Boeglin
2006-12-06 14:59:35 UTC
Permalink
Post by Pelletier Vincent
- touch Products/ERP5Type/USE_MEMCACHED_TOOL (otherwise the tool will be in
disabled mode)
Heu, ?a serait pas plus simple d'en faire une propri?t? du tool ? Ou il
y a besoin de red?marrer le site lors d'une activation/d?sactivation ?

Alex
Alexandre Boeglin
2006-12-06 15:00:27 UTC
Permalink
[...]
Sorry, I intended to reply to Vincent privately...
Kevin Deldycke
2006-12-07 10:53:50 UTC
Permalink
Post by Pelletier Vincent
- Install python-memcached (see links below)
FYI, i've just include python-memcached RPM inside our Mandriva 2006
repository.
--
Kevin Deldycke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20061207/56d29c1d/attachment.pgp>
Yoshinori Okuji
2006-12-07 11:30:23 UTC
Permalink
Post by Kevin Deldycke
Post by Pelletier Vincent
- Install python-memcached (see links below)
FYI, i've just include python-memcached RPM inside our Mandriva 2006
repository.
Also, FYI, some RPMs for 2006 are broken. libmysql15-static-devel cannot be
installed due to a cpio error. OpenOffice.org 2 sometimes crashes due to a
missing symbol.

I installed official RPMs from openoffice.org because of this problem. I don't
use libmysql15-static-devel for now, so I haven't done anything about this.

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
Kevin Deldycke
2006-12-07 17:08:57 UTC
Permalink
Post by Yoshinori Okuji
Post by Kevin Deldycke
FYI, i've just include python-memcached RPM inside our Mandriva 2006
repository.
Also, FYI, some RPMs for 2006 are broken.
Thanks for the bug reports.
Post by Yoshinori Okuji
libmysql15-static-devel cannot be installed due to a cpio error.
I've updated our 2006 repository with the latest MySQL 5.0.27. I've made the
test and libmysql15-static-devel is now Ok.
Post by Yoshinori Okuji
OpenOffice.org 2 sometimes crashes due to a missing symbol.
I installed official RPMs from openoffice.org because of this problem.
I personally use OpenOffice.org v2.0.3 which is on our 2006 repository. This
version come from the official RPMs.

What is the version of the previous unworking OOo2 RPMs ? Where did they come
from ?
--
Kevin Deldycke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20061207/547c5a7e/attachment.pgp>
Yoshinori Okuji
2006-12-07 18:01:46 UTC
Permalink
Post by Kevin Deldycke
Post by Yoshinori Okuji
Post by Kevin Deldycke
FYI, i've just include python-memcached RPM inside our Mandriva 2006
repository.
Also, FYI, some RPMs for 2006 are broken.
Thanks for the bug reports.
You are welcome.
Post by Kevin Deldycke
Post by Yoshinori Okuji
libmysql15-static-devel cannot be installed due to a cpio error.
I've updated our 2006 repository with the latest MySQL 5.0.27. I've made
the test and libmysql15-static-devel is now Ok.
Thank you.
Post by Kevin Deldycke
Post by Yoshinori Okuji
OpenOffice.org 2 sometimes crashes due to a missing symbol.
I installed official RPMs from openoffice.org because of this problem.
I personally use OpenOffice.org v2.0.3 which is on our 2006 repository.
This version come from the official RPMs.
What is the version of the previous unworking OOo2 RPMs ? Where did they
come from ?
From nexedi's repository.

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
Kevin Deldycke
2006-12-07 14:26:41 UTC
Permalink
Post by Kevin Deldycke
Post by Pelletier Vincent
- Install python-memcached (see links below)
FYI, i've just include python-memcached RPM inside our Mandriva 2006
repository.
If you tried to install the python-memcached RPM, you've probably experienced
some errors. This was due to missing requirement in memcached. Please update
your local repository and try again to install the package: everything should
be good now.
--
Kevin Deldycke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20061207/80bfbdc5/attachment.pgp>
Loading...