Re: installing Fast CGI with PERL on Solaris 2.5

Ken Alexander (kalex@eecs.umich.edu)
Thu, 8 May 1997 13:28:03 -0400 (EDT)

Date: Thu, 8 May 1997 13:28:03 -0400 (EDT)
From: Ken Alexander <kalex@eecs.umich.edu>
Message-Id: <199705081728.NAA02989@quip.eecs.umich.edu>
To: fastcgi-developers@OpenMarket.com
Subject: Re: installing Fast CGI with PERL on Solaris 2.5

> > *BUT* after all this, sfio fcgi perl has a nasty problem.
> > When running several fastcgi processes, and requests come in close together,
> > the process will exit and the client will hang.  The fcgi module bombs in
> > an accept() call, which causes the perl "while(FCGI::accept() >= 0)" loop
> > to exit.  I have no idea why this is.  So, I went back to using fcgi_stdio.
> ...
> Is this a problem that other people have been having on other platforms?

I have the sfio-bombs-in-accept() problem on solaris 2.5, and two other
people have mentioned the same problem.  One of them was solaris 2.5,
and I think the other one was also though he didn't explicitly say.

The problem can be demonstrated by running two fcgi's side by side.
===== Make a frameset something like:

<frameset cols=*,*>
     <frame src="/fcgi-bin/sfiotest.fcg">
     <frame src="/fcgi-bin/sfiotest.fcg">
</frameset>

===== and make sfiotest.fcg be something like

#! /l/p5sf/bin/perl
use FCGI;
main: {
    while (each(%ENV)) {}       # Workaround env bug.
    while(FCGI::accept() >= 0) {
        print "Content-type: text/html\n\nIt is working now.\n";
    }
}

=====

Set up your apache server to start two sfiotest.fcg processes:
    AppClass /l/httpd/fcgi-bin/sfiotest.fcg -processes 2

And then reload the frameset a few times until one of the frames hangs.
It usually dies after only a few tries, and the error_log will mention
that the fcg process has been restarted.  If you compile perl with
debugging, a (C-language) accept() call is failing with an error of
"protocol error", which makes the perl FCGI::accept() return an error
and fall out of the while() loop.

If you can keep on reloading and it keeps working after a dozen tries,
then you don't have the problem.  (Make sure your browser does multiple
"simultaneous network connections"; my netscape's default is 4.)

--
 Ken Alexander          JSTOR / UMDL                +1 313 647 6316 
 kalex@umich.edu        University of Michigan      +1 313 647 6897 fax