The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

FCGI::ProcManager::Dynamic - extension for FCGI::ProcManager, it can dynamically control number of work processes depending on the load.

SYNOPSIS

 # 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();
 }

DESCRIPTION

FCGI::ProcManager::Dynamic the same as FCGI::ProcManager, but it has additional settings and functions for dynamic control of work processes's number.

Addition options

min_nproc

The minimum amount of worker processes.

max_nproc

The maximum amount of worker processes.

delta_nproc

amount of worker processes which will be changed for once in case of their increase or decrease.

delta_time

Delta of time from last change of processes's amount, when they will be reduced while lowering of loading.

max_requests

Amount of requests for one worker process. If it will be exceeded worker process will be recreated.

Addition functions

pm_loop

Function is needed for correct completion of worker process's cycle if max_requests will be exceeded.

BUGS

No known bugs, but this does not mean no bugs exist.

SEE ALSO

FCGI::ProcManager FCGI

MAINTAINER

Andrey Velikoredchanin <andy@andyhost.ru>

AUTHOR

Andrey Velikoredchanin

COPYRIGHT

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