FCGI::Spawn

Process manager/application server for FastCGI protocol
Download

FCGI::Spawn Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Peter Vereshagin
  • Publisher web site:
  • http://search.cpan.org/~veresc/

FCGI::Spawn Tags


FCGI::Spawn Description

Process manager/application server for FastCGI protocol FCGI::Spawn is a Perl module used to serve as a FastCGI process manager. Besides the features the FCGI::ProcManager posess itself, the FCGI::Spawn is targeted as web server admin understandable instance for building the own fastcgi server with copy-on-write memory sharing among forks and with single input parameters like processes number and maximum requests per fork.Another thing to mention is that it is able to execute any file pointed by Web server ( FastCGI requester ). So we have the daemon that is hot ready for hosting providing.The definitive care is taken in FCGI::Spawn on security. Besides the inode settings on local UNIX socket taken as input parameter, it is aware to avoid hosting users from changing the max_requests parameter meant correspondent to MaxRequests Apache's forked MPM parameter, and the respective current requests counter value as well.The aforementioned max_requests parameter takes also care about the performance to avoid forks' memory leaks to consume all the RAM accounted on your hardware.For shared hosting it is assumed that system administrator controls the process manager daemon script contents with those user hardware consumption limits and executes it with a user's credentials. E. g., the user should be able, to send signal to the daemon to initiate graceful restart on his/her demand ( this is yet to be done ) or change the settings those administrator can specifically allow in the daemon starter script without restart ( both of those features are about to be done in the future ). For example, user may want to recompile the own sources and quickly change the clean_inc_hash for this.The call stack lets you set up your own code reference for your scripts execution.Seeking for convention between high preformance needs that the perl compile cache possesses and the convinience of debugging with recompilation on every request that php provides, the clean_inc_subnamespace feature allows you not to recompile the tested source like those of DBI and frameworks but focus the development on your application development only, limiting the recompilation with your application(s) namespace(s) only. This may be useful in both development environment to make the recompilation yet faster and on a production host to make the details of code adaptaion to hosting clear in a much less time needed. This is new feature in v. 0.14Every other thing is explained in FCGI::ProcManager docs.Minimum unrecommended way to illustrate it working: use FCGI::Spawn; my $spawn = FCGI::Spawn->new(); $spawn -> spawn;Never put this in production use. This should be run as the web server's user id ( or another if umask isn't 022 ) and the web server should be configured to request its FastCGI on the default socket file name, the /tmp/spawner.sock. Consider to run as user other than web server's and setting up the proper sock_chmod/sock_chown parameters necessity.Tried to get know satisfaction with bugzilla... There's no place to dig out that Bugzilla doesn't work out with FastCGI other than Bugzilla's own Bugzilla though.Tried the same with WebGUI.org. The versions since 6.9 went to require the mod_perl2 strictly. OK, but version 6.8 does work well at least as does at http://alpha.vereshagin.org. This is my ./run for daemontools by http://cr.yp.to: #!/usr/bin/perl -w use strict; use warnings; use lib '/path/to/modules'; use WebGUI; use Image::Magick; use Carp; $SIG{__DIE__} = sub{ print @_; print Carp::longmess }; $ENV{FCGI_SOCKET_PATH} = "/path/to/spawner.sock"; eval( "use FCGI::Spawn;" ); my $fcgi = new CGI; eval ${ FCGI::Spawn::plsrc( '/the/path/to/some.pl.fpl' ) }; undef $fcgi; my $spawn = FCGI::Spawn->new({ n_processes => 7, sock_chown => , sock_chmod => 0660, max_requests => 200, }); $spawn -> spawn;And, the minimum suggested way to spawn your FastCGI Perl scripts is as follows: #!/usr/bin/perl -w $ENV{FCGI_SOCKET_PATH} = "/path/to/spawner.sock"; eval( "use FCGI::Spawn;" ); my $spawn = FCGI::Spawn->new({ n_processes => 7 }); $spawn -> spawn;Here is the one more easy way to posess the daemontools facilities: $ cat ./env/FCGI_SOCKET_PATH /tmp/spawner.sock $ cat ./run #!/bin/sh exec 2>&1 exec envdir ./env su fcgi -c ' ./fcgi-run ' $ cat ./fcgi-run #!/usr/bin/perl -w use FCGI::Spawn; my $spawn = FCGI::Spawn->new(); $spawn -> spawn; Requirements: · Perl


FCGI::Spawn Related Software