httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: non-buffered CGIs suck
Date Fri, 06 Mar 1998 18:30:09 GMT
On Thu, 5 Mar 1998, Dean Gaudet wrote:

> On Thu, 5 Mar 1998, Marc Slemko wrote:
> > Look at it this way: is it worth it to use 1/8th of the system calls
> > (non-mmap, of course) for reading and sending the body data in exchange
> > for giving up 28k of memory?  
> I'm not interested in non-mmap and performance really... the systems we
> don't do mmap on aren't typically going to be used in performance critical
> situations. 

Except that the world isn't static content.

On Thu, 5 Mar 1998, Dean Gaudet wrote:

> On Thu, 5 Mar 1998, Marc Slemko wrote:
> > The problem is that Apache is making this possible by disabling Nagle, so
> > we should deal with all the consequences of disabling Nagle or not do it.
> i.e. we tell CGI authors "it's your responsibility".
> How about someone go and get some random CGIs from the public repositories
> of them and see if this is even an issue.  I don't think it's an issue.

Consider how many people always set "$| = 1" in their perl scripts.  While
that alone won't cause problems... if they are doing anything that blocks
it will.

For example:

$| = 1;
print "Content-type: text/plain\n\n";
while (</etc/*>) {
        printf ("haha: ");
        system ("ls -ld $_");

normally results in one packet for each haha, and one for each ls output,
at least on the systems I tried it.  

While there are better ways to implement this in perl with a lot less
overhead all around, the script isn't doing anything that is so wrong.  It
has to enable autoflushing in perl because of the system call.  It can't
gather writes nicely because the whole idea is that each file has to be
passed to some external program. 

Or is there less overhead in all this from just enabling Nagle while
sending the CGI then disabling it?

View raw message