The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


FCGI::Engine::Manager - Manage multiple FCGI::Engine instances



  my $m = FCGI::Engine::Manager->new(
      conf => 'conf/my_app_conf.yml'

  my ($command, $server_name) = @ARGV;

  $m->start($server_name)        if $command eq 'start';
  $m->stop($server_name)         if $command eq 'stop';
  $m->restart($server_name)      if $command eq 'restart';
  $m->graceful($server_name)     if $command eq 'graceful';
  print $m->status($server_name) if $command eq 'status';

  # on the command line

  perl start
  perl stop
  perl restart foo.server
  # etc ...


This module handles multiple FCGI::Engine instances for you, it can start, stop and provide basic status info. It is configurable using Config::Any, but only really the YAML format has been tested.

Use with Catalyst

Since FCGI::Engine is pretty much compatible with Catalyst::Engine::FastCGI, this module can also be used to manage your Catalyst::Engine::FastCGI based apps as well as your FCGI::Engine based apps.

Use with Plack

Plack support is provided via the FCGI::Engine::Manager::Server::Plackup module. All that is required is setting the server_class parameter in the configuarion and it will Just Work.


Here is an example configuration in YAML, it should be noted that the options for each server are basically the constructor params to FCGI::Engine::Manager::Server and are passed verbatim to it. This means that if you subclass FCGI::Engine::Manager::Server and set the server_class: option appropriately, it should pass any new options you added to your subclass automatically. The third server in the list shows exactly how this is used with a Plack application.

  - name:            "foo.server"
    server_class:    "FCGI::Engine::Manager::Server"
    scriptname:      "t/scripts/"
    nproc:            1
    pidfile:         "/tmp/"
    socket:          "/tmp/foo.socket"
    additional_args: [ "-I", "lib/" ]
  - name:       "bar.server"
    scriptname: "t/scripts/"
    nproc:       1
    pidfile:    "/tmp/"
    socket:     "/tmp/bar.socket"
  - name:            "baz.server"
    server_class:    "FCGI::Engine::Manager::Server::Plackup"
    scriptname:      "t/scripts/baz.psgi" # the .psgi file
    nproc:            1
    pidfile:         "/tmp/"
    socket:          "/tmp/baz.socket"
    additional_args: [ "-E", "production" ] # plackup specific option


All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.


Stevan Little <>


Copyright 2007-2010 by Infinity Interactive, Inc.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.