Devanchya has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to dynamically change how many workers are allowed to work?our $workers = 16; POE::Component::JobQueue->spawn ( Alias => 'passive', # defaults to 'queuer' WorkerLimit => $workers, # defaults to 8 Worker => \&spawn_a_worker, # code which will start a se +ssion Passive => { Prioritizer => sub { 1}, # defaults to sub { 1 } # FIFO }, );
If you set the variable workers to 16 at the start of the program, can you lower it halfway through?
I am looking at being able to dynamically increase how much work can actually happen given server load. If the server load is below a threshold, allow more work. Likewise, if the server load is to high, cut down how much work can be done.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: POE::COMPONENT::JobQueue, dynamic number of workers
by rhesa (Vicar) on Sep 12, 2008 at 20:07 UTC | |
|
Re: POE::COMPONENT::JobQueue, dynamic number of workers
by rcaputo (Chaplain) on Sep 12, 2008 at 21:25 UTC |