Webware vs. PHP - performance comparision!!!

Ian Bicking ianb at colorstudy.com
Mon Oct 6 11:15:00 EDT 2003


On Mon, 2003-10-06 at 05:55, JZ wrote:
> Hello Ian,
> 
> Monday, October 6, 2003, 10:39:19 AM, you wrote:
> 
> > I don't think this testing code is reliable.  When I use ab
> > (ApacheBench, comes with the Apache distribution)
> 
> Hmm, I am trying to solve problem with my Webware application. It's
> behavior is strange. It works quite good.... but sometime it hangs for
> several seconds and I do not why. I changed max. nr of concurent
> servlets from 20 to 100 but it did not helped? :( I am finding
> solution so I check the problem from different points of view.

There was also a problem in your code,

if 0 < i < 100: ...

This isn't proper Python, it's interpreted as (0 < i) < 100.  Since you
are using wget with the mirror option, the stalling is probably in how
wget interprets the pages -- does it mirror 100 pages (the loop size in
PHP), or does it mirror until it decides there's an infinite depth of
pages?

> > I get something like 130 requests/sec for the Python servlet, and
> > 250 requests/sec for the PHP script (though without MMCache).
> 
> But PHP is still faster, isn't it? MMCache can speed up PHP to 10x.

Yes, PHP is faster in this instance.  As some other people have noted,
Webware has more intermediary steps for each request.  I don't know much
about MMCache, but I doubt it can do anything close to 10x when
presented with a trivial script, and I expect the benchmarking of
significant applications give much different results than this
benchmarking of a trivial application.  A trivial application only
measures the basic connection overhead.

> But the real problem is as I wrote abowe. My Webware&Cheetah
> application hangs for several seconds. It appears from time to time.
> It is confusing.
>
> > To do the tests I run "ab -n 1000 http://localhost/whatever"
> 
> Where can I find binary version?

It comes with Apache.  Since you are on Windows, I don't know where in
the Apache distribution it would be.  Debian puts it in /usr/sbin/ab

> > To test *Python's* speed vs. PHP, you'd have to use mod_python -- it's
> > the only Python *environment* that is equivalent to PHP (well, PHP as
> > CGI is like Python as CGI, but that's not a realistic test
> 
> I am using mod_webkit.dll which is even faster than mod_python
> acordint to manual:
> http://webware.sourceforge.net/Webware-0.8.1/WebKit/Docs/InstallGuide.html#mod-python

That's in the context of Webware.  Webware's ModPythonAdapter doesn't
actually run servlets in the Apache process, it just uses a mod_python
handler to connect to the separate Webware process.  mod_webkit does the
same thing, only written in C.

  Ian







More information about the Python-list mailing list