Skip to content

Commit

Permalink
now that we have to process one more request before we can close the …
Browse files Browse the repository at this point in the history
…connection, it makes sense to increase the timeout a little as well
  • Loading branch information
kraih committed Aug 3, 2017
1 parent f9ff45e commit 5c0dcf1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,7 +1,9 @@

7.39 2017-08-02
7.39 2017-08-03
- Removed experimental close_idle_connections method from
Mojo::Server::Daemon.
- Increased default graceful_timeout from 60 to 120 seconds in
Mojo::Server::Prefork.
- Improve Mojo::Server::Daemon to log request errors.
- Fixed a bug where Mojo::Server::Daemon would close connections too quickly
and interrupt requests.
Expand Down
7 changes: 4 additions & 3 deletions lib/Mojo/Server/Prefork.pm
Expand Up @@ -10,7 +10,7 @@ use Scalar::Util 'weaken';

has accepts => 10000;
has cleanup => 1;
has graceful_timeout => 60;
has graceful_timeout => 120;
has heartbeat_timeout => 30;
has heartbeat_interval => 5;
has pid_file => sub { path(tmpdir, 'prefork.pid')->to_string };
Expand Down Expand Up @@ -382,8 +382,9 @@ a true value.
$prefork = $prefork->graceful_timeout(15);
Maximum amount of time in seconds stopping a worker gracefully may take before
being forced, defaults to C<60>. Note that this value should usually be a little
larger than the maximum amount of time you expect any one request to take.
being forced, defaults to C<120>. 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
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/prefork.pm
Expand Up @@ -56,7 +56,7 @@ Mojolicious::Command::prefork - Pre-fork command
SOMAXCONN
-c, --clients <number> Maximum number of concurrent
connections, defaults to 1000
-G, --graceful-timeout <seconds> Graceful timeout, defaults to 60.
-G, --graceful-timeout <seconds> Graceful timeout, defaults to 120.
-I, --heartbeat-interval <seconds> Heartbeat interval, defaults to 5
-H, --heartbeat-timeout <seconds> Heartbeat timeout, defaults to 30
-h, --help Show this summary of available options
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/prefork.t
Expand Up @@ -82,7 +82,7 @@ is $tx->res->body, 'just works!', 'right content';
like $log, qr/Listening at/, 'right message';
like $log, qr/Manager $$ started/, 'right message';
like $log, qr/Creating process id file/, 'right message';
like $log, qr/Stopping worker $spawn[0] gracefully \(60 seconds\)/,
like $log, qr/Stopping worker $spawn[0] gracefully \(120 seconds\)/,
'right message';
like $log, qr/Worker $spawn[0] stopped/, 'right message';
like $log, qr/Manager $$ stopped/, 'right message';
Expand Down

0 comments on commit 5c0dcf1

Please sign in to comment.