FCGI::ProcManager::Dynamic - extension of FCGI::ProcManager - functions for managing FastCGI applications. Here been add operations for dynamic managment of work processes.
# In Object-oriented style. use CGI::Fast; use FCGI::ProcManager::Dynamic; my $proc_manager = FCGI::ProcManager->new({ n_processes => 8, min_nproc => 8, max_nproc => 32, delta_nproc => 4, delta_time => 60, max_requests => 300 }); $proc_manager->pm_manage(); while ($proc_manager->pm_loop() && (my $cgi = CGI::Fast->new())) { $proc_manager->pm_pre_dispatch(); # ... handle the request here ... $proc_manager->pm_post_dispatch(); }
FCGI::ProcManager::Dynamic doin some for FCGI::ProcManager, but including extent parameters and functions for operation with count of work processes.
Minimal count of work processes.
Maximal count of work processes.
How match of work process need change for one time.
When after last nproc changes possible decrement for count work processes.
After work process processing this count of requests, work process finished and replacing for new work process.
This function need for correct finalize work process in after working loop code. For example, if you need disconnection from database or other actions before destroy working process. It recomend for using if you use parameter "max_requests".
No known bugs, but this does not mean no bugs exist.
FCGI::ProcManager FCGI
Andrey Velikoredchanin <andy@andyhost.ru>
Andrey Velikoredchanin
FCGI-ProcManager-Dynamic - A Perl FCGI Dynamic Process Manager Copyright (c) 2012, Andrey Velikoredchanin.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
BECAUSE THIS LIBRARY IS LICENSED FREE OF CHARGE, THIS LIBRARY IS BEING PROVIDED "AS IS WITH ALL FAULTS," WITHOUT ANY WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF TITLE, NONINFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH THE YOU. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
To install FCGI::ProcManager::Dynamic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FCGI::ProcManager::Dynamic
CPAN shell
perl -MCPAN -e shell install FCGI::ProcManager::Dynamic
For more information on module installation, please visit the detailed CPAN module installation guide.