ERP5 KM

ŁukaszNowak

Łukasz Nowak

Email: <lukasz.nowak AT SPAMFREE ventis DOT com DOT pl>

Personal notes about ERP5

getNextNegativeInventoryDate

  • Q: How to ask this method about next negative inventory date from specified date? from_date do not works.
  • f'(Q): Why you are asking?
  • A(f'(Q)): Imagine sale system, which was implemented without purchasing resources. And there is coming a day, when such need happens.
  • A: Short: You need to repair it.

Long:

So you want to monitor stock? Great. First there will be Inventory day - that day, when you count stock of all your resources. Before that day you need to "cheat" your stock. Create Order Builder, which will build Internal Packing List, fill it properly. Set proper Movement Groups. In Predicate choose resource type you were selling (eg. Product). Set Profile. Invoke it. Internal Packing List will appear. Now your stocks will be 0 in future. Great. So now create and validate inventories. Your future stocks will be "real" - some of them will be 0 (no sell after inventory date) some will be negative and...yes - getNextNegativeInventoryDate will return dates in future. Good luck.

expand performance

expand method performance is quite low (waiting for confirmation).

  • Q1: Does it has to be so slow?
  • A(Q1): Yes.
  • Q2: If Q1 == true how to cluster it (split into autonomous invocation of children expand methods in activities)

  • A(Q2): Is it not possible to split it into more invocations without quite heavy recoding.
  • Q3: How to make it faster?
  • A(Q3): Make it less generic.

About Q2. I tried quick and dirty hack replacing smth.expand(...) with smth.activate(after_path=smth.getPath()).expand(...) in ERP5/Document/*py but not tested enough (and might do not work). BTW - on HEAD expand invocation has changed much, I'm using quite old 15401.

ZEO

It is possible. Set up ZEO as you like.

The only additional thing is to configure portal_activities to use ZEO clients properly.

Just add ZEO clients in load balancing tab of portal_activities. What I found as quite nice trick to make user experience better: left few clients without invoking activities, and configure your system to use those clients via WEB. Then even if there are some quite intensive tasks going on activities, those clients won't be burden with these tasks.

Remember to monitor and remove dead ZEO clients from load balancing of activities - distribution node will send activities to work with, but they won't be ever executed.

I think that activities with using more than one ZEO client works like this:

  • you have one distributing node DN

  • you have n working nodes WN

  • DN might be (but do not have to be?) WN

  • DN looks for activities with processing_node == -1 and send messages (using some algorithm) to one of WN (might be self)

Hope it helps someone.

ZEO Performance and Problems Hiding Tips

To tune up any ERP system it is quite good to use any type of clustering, load balancing and tricking users. ERP5 system is quite generic, which is great for development, but it has price - sometimes performance impact is so big, that it is unacceptable. But from other point of view - ERP5's mechanisms gives you clustering system out-of-the-box - using ZEO and portal_activities balancing system.

For busy sites, which are involving much of simulations that's what I done:

  • created ZEO
  • created amount of cores Zope clients to ZEO + 1

  • configured amount of cores Zope clients as WN (see above)

  • configured one Zope client as MN (see above), but NOT WN

  • used MN and not WN Zope client as HTTP client for users.
  • tricked ;) users, by putting much, and more, and more heavy and generic methods (like expand) into activities and relied on portal_activities balancing system

What I gained:

  • didn't have (at least for now) to make degeneralisation changes to such complicated (and generic) methods like expand - usage of original code as long as possible
  • great user's experience, as they do not feel any problems with performance, and do not have to wait for background process to finish
  • less pain more fun, easier debugging, using original code
  • got time to slowly and cool analysis of system, as everything is working acceptable, and I'm able to concentrate on real problems, and not on tiny optimisations
  • warm server room ;)

Additional issues

I found out (on revision 15401), that full reindex is generating many conflict errors from ZEO. It might be good idea to down and remove from portal_activities all other nodes. I might be wrong.

While making any install/upgrade/uninstall with Business Templates I found many errors, if more than one client was working. So it might be good idea to have only one node while upgrading site and/or installing new Business Templates.

ERP5 in Debian

Using packages from http://erp5.niema.pl/packages/ and instructions http://code.google.com/p/deb4erp5/wiki/HowToRunERP5OnDebian you will be able to set up properly running site (for now with Zope 2.7). I confirm its usability as developer site in 100%, and production site in 99% (well...100% will be in future...long distant future - but we are using it in production).


CategoryHomepage

ŁukaszNowak (last edited 2008-02-25 09:44:43 by ŁukaszNowak)

Page
  • Immutable Page
  • Info
  • Attachments
User
Learn about new ERP5 releases,technical articles, events and more.

Subscribe to the monthly ERP5 Newsletter!