1
2
FastCgiExternalServer /tmp/myapp.fcgi -host localhost:8888
Alias /myapp /tmp/myapp.fcgi/
1 2 3 4 5 6 7 8 9 10
BEGIN { $ENV{FCGI_SOCKET_PATH} = "localhost:8888"; $ENV{FCGI_LISTEN_QUEUE} = 100; } use CGI::Fast; ... my $count; while (my $cgi = new CGI::Fast) { ... }
1 2 3 4 5 6 7 8 9 10 11 12
use FCGI; my $socket = FCGI::OpenSocket( ":8888", 5 ); my $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket ); my $count; while( $request->Accept() >= 0 ) { CGI::initialize_globals(); my $cgi = CGI->new; ... } FCGI::CloseSocket( $socket );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
BEGIN { $ENV{FCGI_SOCKET_PATH} = "localhost:8888"; $ENV{FCGI_LISTEN_QUEUE} = 100; } use FCGI::ProcManager; use CGI::Fast; my $proc_manager = FCGI::ProcManager->new({ n_processes => 10, }); $proc_manager->pm_manage(); ... my $count; while (my $cgi = new CGI::Fast) { $proc_manager->pm_pre_dispatch(); ... $proc_manager->pm_post_dispatch(); }