Mojolicious
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojo/Server/Hypnotoad.pm view on Meta::CPAN
new incoming connections, defaults to the value of L<Mojo::IOLoop/"max_connections">. 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 L</"workers"> instead for better performance.
=head2 graceful_timeout
graceful_timeout => 15
Maximum amount of time in seconds stopping a worker gracefully may take before being forced, defaults to the value of
L<Mojo::Server::Prefork/"graceful_timeout">. Note that this value should usually be a little larger than the maximum
amount of time you expect any one request to take.
=head2 heartbeat_interval
heartbeat_interval => 3
Heartbeat interval in seconds, defaults to the value of L<Mojo::Server::Prefork/"heartbeat_interval">.
=head2 heartbeat_timeout
heartbeat_timeout => 2
Maximum amount of time in seconds before a worker without a heartbeat will be stopped gracefully, defaults to the value
of L<Mojo::Server::Prefork/"heartbeat_timeout">. Note that this value should usually be a little larger than the
maximum amount of time you expect any one operation to block the event loop.
=head2 inactivity_timeout
inactivity_timeout => 10
Maximum amount of time in seconds a connection with an active request can be inactive before getting closed, defaults
to the value of L<Mojo::Server::Daemon/"inactivity_timeout">. Setting the value to C<0> will allow connections to be
inactive indefinitely.
=head2 keep_alive_timeout
keep_alive_timeout => 10
Maximum amount of time in seconds a connection without an active request can be inactive before getting closed,
defaults to the value of L<Mojo::Server::Daemon/"keep_alive_timeout">. Setting the value to C<0> will allow connections
to be inactive indefinitely.
=head2 listen
listen => ['http://*:80']
Array reference with one or more locations to listen on, defaults to C<http://*:8080>. See also
L<Mojo::Server::Daemon/"listen"> for more examples.
=head2 pid_file
pid_file => '/var/run/hypnotoad.pid'
Full path to process id file, defaults to C<hypnotoad.pid> in the same directory as the application. Note that this
value can only be changed after the server has been stopped.
=head2 proxy
proxy => 1
Activate reverse proxy support, which allows for the C<X-Forwarded-For> and C<X-Forwarded-Proto> headers to be picked
up automatically, defaults to the value of L<Mojo::Server/"reverse_proxy">.
=head2 requests
requests => 50
Number of keep-alive requests per connection, defaults to the value of L<Mojo::Server::Daemon/"max_requests">.
=head2 spare
spare => 4
Temporarily spawn up to this number of additional workers if there is a need, defaults to the value of
L<Mojo::Server::Prefork/"spare">. This allows for new workers to be started while old ones are still shutting down
gracefully, drastically reducing the performance cost of worker restarts.
=head2 trusted_proxies
trusted_proxies => ['10.0.0.0/8', '127.0.0.1', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']
Trusted reverse proxies, addresses or networks in CIDR form.
=head2 upgrade_timeout
upgrade_timeout => 45
Maximum amount of time in seconds a zero downtime software upgrade may take before getting canceled, defaults to
C<180>.
=head2 workers
workers => 10
Number of worker processes, defaults to the value of L<Mojo::Server::Prefork/"workers">. 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 concurrency with L</"clients"> (often as low as C<1>). Note that during zero
downtime software upgrades there will be twice as many workers active for a short amount of time.
=head1 ATTRIBUTES
L<Mojo::Server::Hypnotoad> implements the following attributes.
=head2 prefork
my $prefork = $hypnotoad->prefork;
$hypnotoad = $hypnotoad->prefork(Mojo::Server::Prefork->new);
L<Mojo::Server::Prefork> object this server manages.
=head2 upgrade_timeout
my $timeout = $hypnotoad->upgrade_timeout;
$hypnotoad = $hypnotoad->upgrade_timeout(15);
Maximum amount of time in seconds a zero downtime software upgrade may take before getting canceled, defaults to
C<180>.
=head1 METHODS
L<Mojo::Server::Hypnotoad> inherits all methods from L<Mojo::Base> and implements the following new ones.
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.636 second using v1.00-cache-2.02-grep-82fe00e-cpan-c30982ac1bc3 )