[Zope] Running ZopeHTTPServer and PCGI together = a bad thing ?

Michel Pelletier michel@digicool.com
Mon, 7 Jun 1999 00:58:00 -0400


> -----Original Message-----
> From: Jim Fulton [mailto:jim@digicool.com]
> Sent: Friday, June 04, 1999 6:40 PM
> To: Michel Pelletier
> Cc: 'Tony McDonald'; Zope List
> Subject: Re: [Zope] Running ZopeHTTPServer and PCGI together = a bad
> thing?
> 
> 
> 
> 
> Michel Pelletier wrote:
> > 
> (snip)
> 
> > A wafer-thin CGI program is forked for every request, this 
> is used to
> > connect up Apache and the Zope long running process.  So yes, this
> > expensive fork happens for every request. 
> 
> It's not *that* expensive.  This is a very thin wrapper.
> 
> > It's no different, however, then other CGI overhead. 
> 
> It's reallu much lower than typical CGI overhead.  Most CGI
> scripts are written using interpreters (e.g. sh, perl, Python).
> Cranking up an interpreter is much more expensive than cranking up
> the pcgi_wrapper.
> 

I was sort of thinking about before the actual exec'ing of the CGI
program, whether it be fast compiled C or the more common monstrosity of
an interpreter (and I don't mean Python either).

> > One of these days, someone is going to write a
> > mod_pcgi module for Apache, and take that expensive fork 
> out.  For light
> > loads, it's really not noticeable, but for heavy loads, one fork per
> > request gets heavy. 
> 
> I think a site could sustain a million hits a day using pcgi 
> on moderately
> fast hardware.

I agree, a million forks per day is not a heavy load, but I bet it's
fairly measureable.  Tack onto that the need for apache to pre-fork and
re-fork servers all the time, and you could hit a pretty hard limit, but
I am talking with no actual numbers here, I do seem to remember
somewhere statistics on the number of milliseconds a fork took on
various platforms and hardware... hmm, where did that go?  For linux I
seem to remember it being somwhere on the order of 100 or so
milliseconds, (I'm reaching) on something like a 486 66mhz machine.

> 
> > ZServer is noticably faster in this regard than
> > Apache.
> 
> True.  An an apache module would definately be a good thing.
> 
Yes, I am curious to see how many milliseconds could be taken off the
request round trip time by taking thw whole fork exec cycle out of the
request loop?  It would probably come into speed with ZServer (if there
are enough apaches preforked) since the mechanism at that point is the
same, a select() loop.  At this point apache's need to context switch
would probably even out with ZServer's interpreter overhead, but once
again, what the hell do I know?

> BTW, ZServer supports PCGI, so you *can* use Apache+PCGI+ZServer.
> This is useful, for example, if you want to use Apache to do SSL
> while using ZServer for other HTTP requests and FTP.

Another beauty of apache is that it's got GOBS of little gizmos and
knobs on it.  And the real workd security issues have been though about
by thousands of more experts for apache than ZServer. A double ended
light saber no doubt, but I'm sure Darth Fulton could find something to
do with them. ;)

-Michel

> 
> Jim
> 
> --
> Jim Fulton           mailto:jim@digicool.com   Python Powered!        
> Technical Director   (888) 344-4332            http://www.python.org  
> Digital Creations    http://www.digicool.com   http://www.zope.org    
> 
> Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
> address may not be added to any commercial mail list with out my
> permission.  Violation of my privacy with advertising or SPAM will
> result in a suit for a MINIMUM of $500 damages/incident, $1500 for
> repeats.
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>