Fabien

OK, I think I'm getting it. Indeed, in my loops (to fake a very long request 
with a Python bottleneck), I was doing something like:

while True:
  pass


I just compared, in Java two threads doing that make both of my CPU peak at 
100% while they peak at only around 70% using Python/OpenERP, so that's because 
of Python GIL. The good news is that a thread is never totally blocked by the 
other, both of them continue to progress even if they don't maximize the two 
CPU usage.

Now, of course, if I throw C lib calls inside those loops, I'll launch things 
that are out of the GIL and easily reach 100% on both CPU.

Meaning that a fast CPython at the price of the GIL is a very good option for 
something like OpenERP because you will actually use your CPU even on 
multi-core servers when used in normal circumstances (with C lib calls). And 
when Unladen brings JIT while not adressing the GIL, it's a very good fit for 
OpenERP used under normal circumstances (not hundreds of truely concurrent 
requests).

I was used to Ruby. Now I think the GIL is much more an issue in the Ruby world 
just because CRuby is much slower the CPython (JRuby is faster then CPython and 
has no GIL) so Ruby easily becomes a hot spot and you hardly maximize you 
multi-core CPU's with C lib calls. That's why they spool several processes much 
like PHP (and thus killing memory usage), using several Mongrel instance for 
instance.


Very interesting findings.

Raphaël Valyi

------------------------
http://www.smile.fr




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=34438#34438

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to