there must be an equivalent way of using fastCGI+perl as with php-cgi. 
i've found some servers but they are pure perl and i think they won't be 
very efficient, i guess there has to be a C implementation aroun there 
but i haven't found it.



Gunnar Wolf escribió:
> Stefan de Konink dijo [Sun, Feb 08, 2009 at 10:19:17AM +0100]:
>   
>> Chav Paskov wrote:
>>     
>>> Help me to understand something here.
>>>       
>> Please post to the mailinglist.
>>
>>     
>>> i Do have a FCGI perl script that works under apache as we speak
>>> i did not have to set unixsocket  or  port in order to run it .
>>> Can you pls give me a hint  how to create the socket?
>>>       
>> In that case most likely you are talking about a CGI script.
>>     
>
> ...But if you are talking about a CGI script, you are _not_ talking
> abouty high performance ;-)
>
> To write a Perl program using FastCGI, you should use the FCGI module
> [1]. Quoting from the man page: 
>
>     use FCGI;
>
>     my $count = 0;
>     my $request = FCGI::Request();
>     
>     while($request->Accept() >= 0) {
>         print("Content-type: text/html\r\n\r\n", ++$count);
>     }
>
> So, basically: You need to change the way your program works, if you
> are working in a traditional CGI way, so that instead of producing the
> output each time the script is invoked, the setup (i.e. all needed
> initialization - database connection, etc.) is performed once at the
> beginning, and a request loop is created inside which each program
> call is received and served.
>
> There are several additional modules you might want to look into, such
> as FCGI::Async (for asynchronous use), with slightly different
> semantics, FCGI::Spawn (if you want to code closer to the bones), or
> Mojo::Server::FCGI::Prefork (a preforking FastCGI implementation using
> FCGI, with several simplifications). 
>
> You might be tempted to keep your old-fashioned code basically just by
> replacing the CGI module for CGI::Fast - DON'T do it. CGI::Fast is not
> threadable and requests will block each other.
>
> Greetings,
>
> [1] http://search.cpan.org/~skimo/FCGI-0.67/FCGI.PL
>
>   

_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to