Skip to content

Commit

Permalink
added accept_interval setting to Hypnotoad
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 23, 2012
1 parent a3e9deb commit 6269c82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

3.70 2012-12-23
- Added accept_interval setting to Hypnotoad.
- Improved Mojo::Server to die more gracefully if an application class could
not be found.
- Improved documentation.
Expand Down
11 changes: 10 additions & 1 deletion lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -127,7 +127,8 @@ sub _config {
# Event loop settings
my $loop = $daemon->ioloop;
$loop->max_accepts($c->{accepts} // 1000);
$loop->multi_accept($c->{multi_accept}) if defined $c->{multi_accept};
defined $c->{$_} and $loop->$_($c->{$_})
for qw(accept_interval multi_accept);
}

sub _exit { say shift and exit 0 }
Expand Down Expand Up @@ -440,6 +441,14 @@ Stop worker gracefully.
L<Mojo::Server::Hypnotoad> can be configured with the following settings, see
L<Mojolicious::Guides::Cookbook/"Hypnotoad"> for examples.
=head2 C<accept_interval>
accept_interval => 0.5
Interval in seconds for trying to reacquire the accept mutex and connection
management, defaults to C<0.025>. Note that changing this value can affect
performance and idle cpu usage.
=head2 C<accepts>
accepts => 100
Expand Down

0 comments on commit 6269c82

Please sign in to comment.