rename pollers to tasks
This commit is contained in:
@@ -51,11 +51,11 @@ setting('workers')->{queue} ||= 'PostgreSQL';
|
||||
if (exists setting('workers')->{interactives}
|
||||
or exists setting('workers')->{pollers}) {
|
||||
|
||||
setting('workers')->{pollers} = (
|
||||
setting('workers')->{tasks} =
|
||||
(setting('workers')->{pollers} || 0)
|
||||
.' + '. (setting('workers')->{interactives} || 0)
|
||||
) if setting('workers')->{interactives};
|
||||
+ (setting('workers')->{interactives} || 0);
|
||||
|
||||
delete setting('workers')->{pollers};
|
||||
delete setting('workers')->{interactives};
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ sub worker_body {
|
||||
if setting('workers')->{'no_manager'};
|
||||
|
||||
my $num_slots =
|
||||
MCE::Util::_parse_max_workers( setting('workers')->{pollers} )
|
||||
MCE::Util::_parse_max_workers( setting('workers')->{tasks} )
|
||||
- $self->{queue}->pending();
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -15,7 +15,7 @@ sub worker_begin {
|
||||
my $wid = $self->wid;
|
||||
|
||||
return debug "mgr ($wid): no need for scheduler... skip begin"
|
||||
unless setting('scheduler');
|
||||
unless setting('schedule');
|
||||
|
||||
debug "entering Scheduler ($wid) worker_begin()";
|
||||
|
||||
@@ -39,7 +39,7 @@ sub worker_body {
|
||||
my $wid = $self->wid;
|
||||
|
||||
return debug "mgr ($wid): no need for scheduler... quitting"
|
||||
unless setting('scheduler');
|
||||
unless setting('schedule');
|
||||
|
||||
while (1) {
|
||||
# sleep until some point in the next minute
|
||||
|
||||
@@ -879,14 +879,17 @@ or remove any entries.
|
||||
Value: Settings Tree. Default:
|
||||
|
||||
workers:
|
||||
pollers: 'AUTO * 2'
|
||||
tasks: 'AUTO * 2'
|
||||
sleep_time: 1
|
||||
|
||||
Control the activity of the backend daemon with this configuration setting.
|
||||
|
||||
C<pollers> sets how many workers are started for interactive jobs (port
|
||||
C<tasks> sets how many worker processes are started for interactive jobs (port
|
||||
control) and polling jobs (discover, macsuck, arpnip) on this node. Other
|
||||
nodes can have different settings. "C<AUTO>" is the number of CPU cores.
|
||||
nodes can have different settings.
|
||||
|
||||
"C<AUTO>" is the number of CPU cores. Set C<tasks> to "C<0>" to disable all
|
||||
workers (which allows you to have a scheduler-only node).
|
||||
|
||||
C<sleep_time> is the number of seconds between polling the database to find
|
||||
new jobs. This is a balance between responsiveness and database load.
|
||||
@@ -918,9 +921,9 @@ If set, then this node's backend daemon will schedule polling jobs (discover,
|
||||
macsuck, arpnip, etc) in the central database. It's fine to have multiple
|
||||
nodes scheduling work for redundancy (but make sure they all have good NTP).
|
||||
|
||||
Note that this is independent of the Pollers configured in C<workers>. It's
|
||||
Note that this is independent of the Tasks configured in C<workers>. It's
|
||||
okay to have this node schedule schedule but not do any of the polling
|
||||
itself (C<pollers: 0>).
|
||||
itself (C<tasks: 0>).
|
||||
|
||||
Work can be scheduled using C<cron> style notation, or a simple weekday and
|
||||
hour fields (which accept same types as C<cron> notation). For example:
|
||||
|
||||
@@ -48,6 +48,15 @@ web interface. We advise that you back up the database prior to upgrade:
|
||||
|
||||
=head2 General Notices
|
||||
|
||||
The backend polling daemon has been rewritten and as a result your
|
||||
configuration can be simplified. Some keys have also been renamed. Our advice
|
||||
is to remove (or comment out) the complete C<workers> configuration which
|
||||
enables auto-tuning. If you do wish to control the number of worker
|
||||
processes, follow this pattern:
|
||||
|
||||
workers:
|
||||
tasks: 'AUTO * 2' # this is the default, twice the number of CPUs
|
||||
|
||||
The configuration item C<reports> is now a list (used to be a dictionary).
|
||||
Each item in the list must have a C<tag> entry which was previously the
|
||||
dictionary key. For example, now use:
|
||||
|
||||
Reference in New Issue
Block a user