• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bin/H07-Dec-2012-384194

lib/FCGI/H07-Dec-2012-959442

t/H07-Dec-2012-22585

xt/release/H07-Dec-2012-337

COPYINGH A D16-Nov-201225.4 KiB498423

ChangesH A D07-Dec-20122.3 KiB8347

MANIFESTH A D07-Dec-2012294 1514

META.ymlH A D07-Dec-2012725 2827

Makefile.PLH A D07-Dec-20121.1 KiB3627

READMEH A D16-Nov-20123.9 KiB9674

fcgi_spawn.conf.sampleH A D16-Nov-2012310 97

README

1General Information
2-------------------
3
4FCGI-Spawn is the module and daemon both built on top of FCGI-ProcManager
5specially for those who need not ( almost ) to write any of his/her own Perl
6code. This is the quote of FCGI-ProcManager's explanation:
7
8"FCGI-ProcManager is a process manager for FCGI.  By implementing the
9process manager in perl, we can more finely tune FastCGI performance, and
10we can take CPU and memory advantages of fast forks and copy-on-write UNIX
11process management characteristics."
12
13But unlike this, the FCGI-Spawn is intended for those who need to have the
14FCGI daemon with those specifications:
15- communicate via given UNIX local socket or TCP port
16With UNIX virtualization environments like FreeBSD's jail(8) the socket name and its
17desired file mode is the stuff you posess for communication betweeen Web
18server ( FastCGI requester ) and FastCGI daemon.
19- execute any given file in FastCGI environment;
20File name to execute is given with FastCGI protocol, this is what the PHP
21does in FastCGI mode;
22- fork with the given number of processes and share the compiled modules code
23  in common memory areas with copy-on-write facilities;
24- limit the number of requests served by the same process;
25Same as MaxRequests feature of Apache, especially wanted for Perl in sight of it never
26returns allocated memory to OS. On a complex Perl applications, the memory allocation
27volume for particular porocess under load can grow up almost unpredictably. ;-)
28- reload the Perl module on every request if it has been changed from
29the moment it was loaded previously;
30- Cache the oobjects liek the compiled templates, automatically recompiling
31  them on change.
32Useful for debugging and fixing code when put on production hosting, another
33obiouse feature of PHP, including FastCGI mode. Absence of such a feature in
34other Perl runtime environments can get any Perl newcomer stuck.
35
36There were no quick recipe yet, so i gave myself a try to implement one. :-)
37
38Installation
39------------
40
41FCGI-Spawn is expected to compile and run on the same systems range as
42FCGI-ProcManager is.
43
44To build,
45
46  perl Makefile.PL
47  make all
48  make install
49
50Usage
51-----
52
53To use CGI.pm in your applications unchanged, you chould apply the supplied
54CGI.pm.patch. ON some cases, the application is needed to be patched anyway.
55Obviously, it is enough to find CGI->new or 'new CGI' in your code and replace
56it with $FCGI::Spawn::fcgi. That's all, folks.
57
58Next, you should decide the what system user you should execute the daemon.
59Typically, fcgi_spawn daemon is suitable for most cases, it takes this and some
60more parameters on a command line.
61
62Alternately, you may create an executable Perl file expected to being launched
63as a daemon by yourself.
64
65Also, you should configure the UNIX system user and/or group to launch the
66daemon with. `To configure' I mean both the environment and ulimit(3). And, the
67target daemon user should be able to create, and communicate via the socket set
68as an argument for FCGI-Spawn instance creation ( the new() method ). And, bear
69in mind that the FactCGI requester ( the Web server ) should be able to operate
70via this socket, so after creation it should be writable by Web server user. To
71satisfy this, I recommend the FCGI-Spawn daemon user be included into the same
72group as Web server and socket's permissions should be 0660.
73
74I tried to organize the request loop operations with using the pm_pre_dispatch() / pm_post_dispatch()
75but could not keep in frames of its assumptions.
76Refer for more usage details to:
77
78  perldoc fcgi_spawn
79  perldoc FCGI::Spawn
80  perldoc FCGI::ProcManager
81
82
83Copyright
84---------
85Copyright (c) 2006-2010, Peter Vereshagin <peter@vereshagin.org>
86
87
88Disclaimer
89----------
90
91This library is free software released "AS IS WITH ALL FAULTS"
92and WITHOUT ANY WARRANTIES under the terms of the GNU Lesser
93General Public License, Version 2.1, a copy of which can be
94found in the "COPYING" file of this distribution.
95
96