Masahiro Nagano > Monoceros-0.23 > Monoceros



Annotate this POD


View/Report Bugs
Module Version: 0.23   Source   Latest Release: Monoceros-0.27


Monoceros - PSGI/Plack server with event driven connection manager, preforking workers


    % plackup -s Monoceros --max-keepalive-reqs=10000 --max-workers=2 -a app.psgi


Monoceros is PSGI/Plack server supports HTTP/1.1. Monoceros has a event-driven connection manager and preforking workers. Monoceros can keep large amount of connection at minimal processes.

                                                      +---+ worker |
          TCP       +---------+   UNIX DOMAIN SOCKET  |   +--------+
    --------------- | manager | ----------------------+ 
                    +---------+                       |   +--------+
    <- keepalive ->              <-- passing fds -->  `---+ worker |

Features of Monoceros

- a manager process based on AnyEvent keeps over C10K connections

- uses IO::FDPass for passing a file descriptor to workers

- supports HTTP/1.1 and also supports HTTP/1.0 keepalive

And this server inherit Starlet. Monoceros supports following features too.

- prefork and graceful shutdown using Parallel::Prefork

- hot deploy using Server::Starter

- fast HTTP processing using HTTP::Parser::XS (optional)

Currently, Monoceros does not support spawn-interval and max-keepalive-reqs.


In addition to the options supported by plackup, Monoceros accepts following options(s). Note, the default value of several options is different from Starlet.


number of worker processes (default: 5)


seconds until timeout (default: 300)


timeout for persistent connections (default: 10)


max. number of requests to be handled before a worker process exits (default: 100)


if set, randomizes the number of requests handled by a single worker process between the value and that supplied by --max-reqs-per-chlid (default: none)


max, number of connections to keep in the manager process. If you want to increase this value, You should check your system limitations. (default: half number of POSIX::_SC_OPEN_MAX)


max. number of requests to continue to read a request in a worker process. Monoceros can read a next request after the response for maximum throughput. (default: 100)


if set, randomizes the number of requests to continue to read a request between the value and that supplied by --max-readahead-reqs (default: none)


For more performance. I recommends you to install these module.

- EV

- HTTP::Parser::XS


Starlet, Server::Starter, AnyEvent, IO::FDPass


Copyright (C) Masahiro Nagano

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


Masahiro Nagano <>

syntax highlighting: