Zope and Dual-CPU machines.
Does Zope run better on dual-processor machines ? (using FreeBSD or Linux). I know that this might seem like a silly question but some applications, like MySQL, sometimes see worse performance on dual-CPU boxes than similar single-CPU boxes. It may be a moot point if the limiting factor is going to be bandwidth/network (on a PIII, 512 MB RAM box) but it'd would be nice to know if dual-CPU machines are worth it; Sorry, I realise that this just screams "it depends" since disk I/O and load vary from machine to machine, and application to application. Personally I'm more of a "stick lots of smaller frontline webservers in front of a monster DB" guy, but bandwidth costs are proportional to the number of servers I colocate at my access provider. Thanks in advance for any advice from chas ps. Just as a slightly off-topic question, this has made me wonder : If you have a dual processor machine, what needs to be changed in an application to make it "dual processor compatible ?" Or should the OS take care of all of that and do the load-balancing between the CPU's ? I guess that I won't have to change my Zope application at all ... just leave Zope to work it out. But I'm also creating some Python scripts to handle RPC services... or will the underlying Python interpreter handle all of that without me having to know ?
chas wrote:
Does Zope run better on dual-processor machines ? (using FreeBSD or Linux).
No exauhstive benchmarking has been done.
ps. Just as a slightly off-topic question, this has made me wonder : If you have a dual processor machine, what needs to be changed in an application to make it "dual processor compatible ?" Or should the OS take care of all of that and do the load-balancing between the CPU's ? I guess that I won't have to change my Zope application at all ... just leave Zope to work it out. But I'm also creating some Python scripts to handle RPC services... or will the underlying Python interpreter handle all of that without me having to know ?
There are many issues here. If the program is 'multi-process' (ie, composed of multiple processes in seperate process spaces, like Apache) the the OS will handle scheduling processes on different processors. if the program is 'multi-threaded' (like Zope and Zeus) then the OS will also handle scheduling of threads on multiple processors, as long as none of the threads are blocking each other with things like locks and semaphores. If a program is single threaded (like ZServer or squid) then it will only ever run on one processor at one time (there is no saying that that OS cannot move that one processes *between* processors, however). There is one caveat with Zope. Zope is multi-threaded, but the Python interpreter has one large global lock that does not allow multiple threads to run python code simultaneously. Now, lots of C code in Zope and the DAs and various python modules do "release" this lock when apropriate, but generally, interpreted python byte-code is serialized and only one thread of execution can run at one time regardless of the number of processors. So two processors will help some, but more than that probably won't. Further, with two processors you won't find a "doubling" in performance. "Fixing" this is beyond the scope of Zope; it is a Python issue. There is work being done on different projects to address this issue. I remember someone quoting someone else on this list (I think it was AMK or Aaron Watters doing the quoting... I forget who was quoted). The gist of the quote is that multi-threaded programming is very, very hard. There are all kinds of little goblins and gotchas hiding in what can apear to be very straight forward coding. -Michel
participants (2)
-
chas -
Michel Pelletier