[Bro-Dev] Bro 2.6-beta plans

Azoff, Justin S jazoff at illinois.edu
Sat Sep 8 09:10:35 PDT 2018

> On Sep 8, 2018, at 11:20 AM, Azoff, Justin S <jazoff at illinois.edu> wrote:
> Do many of those options do anything?  I tried looking in the CAF source to figure out how they are used, and it looks like they are all defined in 
> libcaf_core/caf/actor_system_config.hpp as

Scratch that.. the deprecation refers to something else, they are still used here:

work_stealing::worker_data::worker_data(scheduler::abstract_coordinator* p)
    : rengine(std::random_device{}()),
      // no need to worry about wrap-around; if `p->num_workers() < 2`,
      // `uniform` will not be used anyway
      uniform(0, p->num_workers() - 2),
        {CONFIG("aggressive-poll-attempts", aggressive_poll_attempts), 1,
         CONFIG("aggressive-steal-interval", aggressive_steal_interval),
        {CONFIG("moderate-poll-attempts", moderate_poll_attempts), 1,
         CONFIG("moderate-steal-interval", moderate_steal_interval),
         CONFIG("moderate-sleep-duration", moderate_sleep_duration)},
        {1, 0, CONFIG("relaxed-steal-interval", relaxed_steal_interval),
         CONFIG("relaxed-sleep-duration", relaxed_sleep_duration)}}} {
  // nop

So that strategies is an array of structs of [attempts, step size, steel interval, sleep interval]

so as I understand it, the current default is

5 polls, 1 step, interval 4, 0 sleep
5 polls, 1 step, interval 2, 16msec sleep
1 poll, 0 step, interval 1, 64msec sleep

Which means if a thread has no work to do it will loop for 5 times with no sleep, then 5 more times with 16msec sleep, then once with 64ms sleep.

This doesn't seem that bad.. worse case is 11 attempts every 149ms or ~70/second.

I went as far as trying 

redef Broker::aggressive_polls = 1;
redef Broker::moderate_polls = 1;
redef Broker::moderate_sleep = 100msec;
redef Broker::relaxed_sleep = 200msec;

but that didn't make a noticeable change, so the scheduler may not be the problem.  Will have to do some more testing.

Justin Azoff

More information about the bro-dev mailing list