FCGI::ProcManager::Dynamic - extension for FCGI::ProcManager, it can dynamically control number of work processes depending on the load.
# In Object-oriented style. use CGI::Fast; use FCGI::ProcManager::Dynamic; my $proc_manager = FCGI::ProcManager::Dynamic->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 the same as FCGI::ProcManager, but it has additional settings and functions for dynamic control of work processes's number.
The minimum amount of worker processes.
The maximum amount of worker processes.
amount of worker processes which will be changed for once in case of their increase or decrease.
Delta of time from last change of processes's amount, when they will be reduced while lowering of loading.
Amount of requests for one worker process. If it will be exceeded worker process will be recreated.
Function is needed for correct completion of worker process's cycle if max_requests will be exceeded.
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.