Skip to content

Commit

Permalink
reduced idle CPU usage of Mojo::Reactor::Poll
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 23, 2012
1 parent 6269c82 commit 70463d7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

3.70 2012-12-23
- Added accept_interval setting to Hypnotoad.
- Reduced idle CPU usage of Mojo::Reactor::Poll.
- Improved Mojo::Server to die more gracefully if an application class could
not be found.
- Improved documentation.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -358,7 +358,7 @@ L<Mojo::IOLoop> implements the following attributes.
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.
performance and idle CPU usage.
=head2 C<lock>
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Reactor/Poll.pm
Expand Up @@ -31,7 +31,7 @@ sub one_tick {

# Calculate ideal timeout based on timers
my $min = min map { $_->{time} } values %{$self->{timers}};
my $timeout = defined $min ? ($min - time) : 0.025;
my $timeout = defined $min ? ($min - time) : 0.5;
$timeout = 0 if $timeout < 0;

# I/O
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -447,7 +447,7 @@ L<Mojolicious::Guides::Cookbook/"Hypnotoad"> for examples.
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.
performance and idle CPU usage.
=head2 C<accepts>
Expand Down Expand Up @@ -575,7 +575,7 @@ Username for worker processes.
workers => 10
Number of worker processes, defaults to C<4>. A good rule of thumb is two
worker processes per cpu core.
worker processes per CPU core.
=head1 METHODS
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -57,7 +57,7 @@ used during development.

For bigger applications L<Mojolicious> contains the UNIX optimized preforking
web server L<Mojo::Server::Hypnotoad> that will allow you to take advantage of
multiple cpu cores and copy-on-write.
multiple CPU cores and copy-on-write.

Mojo::Server::Hypnotoad
|- Mojo::Server::Daemon [1]
Expand Down

0 comments on commit 70463d7

Please sign in to comment.