NAME

SYNOPSIS

DESCRIPTION

Mojo::Server::Hypnotoad is a full featured, UNIX optimized, preforking non-blocking I/O HTTP and WebSocket server, built around the very well tested and reliable Mojo::Server::Prefork, with IPv6, TLS, Comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, multiple event loop and hot deployment support that just works. Note that the server uses signals for process management, so you should avoid modifying signal handlers in your applications.

This second invocation will load the application again, detect the process id file with it, and send a "USR2" signal to the already running server.

For better scalability (epoll, kqueue) and to provide IPv6 as well as TLS support, the optional modules EV (4.0+), IO::Socket::IP (0.20+) and IO::Socket::SSL (1.75+) will be used automatically by Mojo::IOLoop if they are installed. Individual features can also be disabled with the MOJO_NO_IPV6 and MOJO_NO_TLS environment variables.

INT, TERM

QUIT

SETTINGS

accept_interval

accept_interval => 0.5

Interval in seconds for trying to reacquire the accept mutex, defaults to 0.025. Note that changing this value can affect performance and idle CPU usage.

accepts

accepts => 100

Maximum number of connections a worker is allowed to accept before stopping gracefully, defaults to 1000. Setting the value to 0 will allow workers to accept new connections indefinitely. Note that up to half of this value can be subtracted randomly to improve load balancing, and that worker processes will stop sending heartbeat messages once the limit has been reached.

backlog

backlog => 128

Listen backlog size, defaults to SOMAXCONN.

clients

clients => 100

Maximum number of concurrent client connections per worker process, defaults to 1000. Note that high concurrency works best with applications that perform mostly non-blocking operations, to optimize for blocking operations you can decrease this value and increase "workers" instead for better performance.

graceful_timeout

graceful_timeout => 15

Maximum amount of time in seconds stopping a worker gracefully may take before being forced, defaults to 20.

group

group => 'staff'

Group name for worker processes.

heartbeat_interval

heartbeat_interval => 3

Heartbeat interval in seconds, defaults to 5.

heartbeat_timeout

heartbeat_timeout => 2

Maximum amount of time in seconds before a worker without a heartbeat will be stopped gracefully, defaults to 20.

inactivity_timeout

inactivity_timeout => 10

Maximum amount of time in seconds a connection can be inactive before getting closed, defaults to 15. Setting the value to 0 will allow connections to be inactive indefinitely.

listen

lock_file

Full path of accept mutex lock file prefix, to which the process id will be appended, defaults to a random temporary path.

lock_timeout

lock_timeout => 0.5

Maximum amount of time in seconds a worker may block when waiting for the accept mutex, defaults to 1. Note that changing this value can affect performance and idle CPU usage.

multi_accept

multi_accept => 100

Number of connections to accept at once, defaults to 50.

pid_file

pid_file => '/var/run/hypnotoad.pid'

Full path to process id file, defaults to hypnotoad.pid in the same directory as the application. Note that this value can only be changed after the server has been stopped.

proxy

proxy => 1

Activate reverse proxy support, which allows for the X-Forwarded-For and X-Forwarded-HTTPS headers to be picked up automatically, defaults to the value of the MOJO_REVERSE_PROXY environment variable.

upgrade_timeout

upgrade_timeout => 45

Maximum amount of time in seconds a zero downtime software upgrade may take before getting canceled, defaults to 60.

user

user => 'sri'

Username for worker processes.

workers

workers => 10

Number of worker processes, defaults to 4. A good rule of thumb is two worker processes per CPU core for applications that perform mostly non-blocking operations, blocking operations often require more and benefit from decreasing the number of concurrent "clients" (often as low as 1).