Discussion:
[Erp5-dev] Memcached usage in selection tool
Łukasz Nowak
2008-08-28 08:06:56 UTC
Permalink
Hello,

In selection tool (portal_selections/manage_configure) it is possible to
use Persistent Mapping or Memcached Tool.

I'd like to know what is the status and advantages of using Memcached
Tool instead of Persistent Mapping. Would be memcached faster on busy
site? It will be faster/more scalable, isn't it?


I've been using it for some time, and while most things works, setting
relation by 'Set Relation' does not works (rev 23134). Correct me if I'm
wrong, but Memcached is not used in test runs for
ERP5Form/tests/testSelectionTool.py?

So - should be memcached in selection tool used on production
environment? What is its status? Alpha, beta,
ready-for-community-testing?

Regards,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.
Łukasz Nowak
2008-08-28 08:41:59 UTC
Permalink
Hello,
Post by Łukasz Nowak
Hello,
In selection tool (portal_selections/manage_configure) it is possible to
use Persistent Mapping or Memcached Tool.
Well - by the way I tried to run test on selection tool with Memcached
as storage. There are some failures.

Is my patch ok to be committed?

Regards,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ERP5Form-testSelectionTool-test-memcached-storage.patch
Type: text/x-patch
Size: 874 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080828/3890ba91/attachment.bin>
Kazuhiko Shiozaki
2008-08-28 09:16:16 UTC
Permalink
Hello Luke,
Post by Łukasz Nowak
Post by Łukasz Nowak
In selection tool (portal_selections/manage_configure) it is possible to
use Persistent Mapping or Memcached Tool.
Well - by the way I tried to run test on selection tool with Memcached
as storage. There are some failures.
Is my patch ok to be committed?
Thanks for your patch. But afterSetup() should be like the following,
because TestSelectionTool.afterSetUp() tries to set/modify some
selections, so we need to switch to memcached storage beforehand.

+ def afterSetUp(self):
+ self.portal.portal_selections.setStorage('Memcached Tool')
+ TestSelectionTool.afterSetUp(self)
+

After this change, testGetSelectionContainer fails at the following:
self.portal_selections.getSelectionNameList()
But this it the limitation of memcache, i.e. we cannot get the keys of
the storage. So in case of memcache storage, this should be tested by
assertEquals([], ...)

Could you please modify these two, and commit it?
Thanks again.
--
Kazuhiko Shiozaki, Nexedi SA Senior Consultant
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
Łukasz Nowak
2008-08-28 09:40:32 UTC
Permalink
Hello Kazuhiko,
Post by Kazuhiko Shiozaki
Hello Luke,
Post by Łukasz Nowak
Post by Łukasz Nowak
In selection tool (portal_selections/manage_configure) it is possible to
use Persistent Mapping or Memcached Tool.
Well - by the way I tried to run test on selection tool with Memcached
as storage. There are some failures.
Is my patch ok to be committed?
Thanks for your patch. But afterSetup() should be like the following,
because TestSelectionTool.afterSetUp() tries to set/modify some
selections, so we need to switch to memcached storage beforehand.
+ self.portal.portal_selections.setStorage('Memcached Tool')
+ TestSelectionTool.afterSetUp(self)
+
Yes, you are right - I was too fast.
Post by Kazuhiko Shiozaki
self.portal_selections.getSelectionNameList()
But this it the limitation of memcache, i.e. we cannot get the keys of
the storage. So in case of memcache storage, this should be tested by
assertEquals([], ...)
Could you please modify these two, and commit it?
Done in revisions: 23213, 23214 and 23215. As I introduced new test
class I created new method for testing with memcached tool - hope it is
ok.

But what I see right now, that case of set relation using memcache tool
as storage for portal selections is not tested in testSelectionTool
class. Shall it be here, or is it (it shall be) in other test?
Post by Kazuhiko Shiozaki
Thanks again.
No problem.

Regards,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.
Yoshinori Okuji
2008-08-28 10:39:49 UTC
Permalink
Post by Łukasz Nowak
Hello,
In selection tool (portal_selections/manage_configure) it is possible to
use Persistent Mapping or Memcached Tool.
I'd like to know what is the status and advantages of using Memcached
Tool instead of Persistent Mapping. Would be memcached faster on busy
site? It will be faster/more scalable, isn't it?
As far as I see, the speed is not that different. But it makes a lot of
difference in data size, since memcached does not store old data. Also, even
though Selection supports a conflict resolution, memcached is usually faster
when conflicts in selection objects happen frequently, because memcached does
not recognize transactions, and a conflict resolution requires more
interactions with a storage.
Post by Łukasz Nowak
I've been using it for some time, and while most things works, setting
relation by 'Set Relation' does not works (rev 23134). Correct me if I'm
wrong, but Memcached is not used in test runs for
ERP5Form/tests/testSelectionTool.py?
It should be tested there. I don't remember why any test was not written for
that, though.
Post by Łukasz Nowak
So - should be memcached in selection tool used on production
environment? What is its status? Alpha, beta,
ready-for-community-testing?
In reality, it is pretty stable, and used in production. Note that, however,
it slightly changes the user-visible behaviors, because selections would be
lost when restarting memcached. If you don't like this, it is necessary to
use either ZODB or a memcached-compatible persistent storage (which is more
or less slower than memcached).

YO
--
Yoshinori Okuji, Nexedi KK President / Nexedi SA CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.co.jp/
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com/
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org/
Loading...