[Bro-Dev] Broker::publish API

Azoff, Justin S jazoff at illinois.edu
Fri Jul 27 17:30:13 PDT 2018


> On Jul 27, 2018, at 6:10 PM, Jon Siwek <jsiwek at corelight.com> wrote:
> 
> On Fri, Jul 27, 2018 at 3:55 PM Azoff, Justin S <jazoff at illinois.edu> wrote:
> 
>> I do agree that there's room for a lot of simplification, for example a worker broadcasting a message efficiently to all
>> other workers needs to do something like this from the docs:
>> 
>>        Cluster::relay_rr(Cluster::proxy_pool, "example_key",
>>                          Cluster::worker_topic, worker_to_workers,
>>                          Cluster::node + " (via a proxy)");
>> 
>> But a lot of that could have defaults:
>> 
>> Most use cases would want to relay through the default proxy pool
>> Since round robin is in use, they key shouldn't matter.
> 
> At the moment, one could write their own wrapper function around that
> if they find it too verbose and always want to use certain defaults?

Yeah.. The wrapper would be trivial.. Should bro include it so that the API scripts use is simpler?


>> The round robin part itself is really an implementation detail for proxy load balancing and maybe not something that
>> should be exposed in the API.  Now that I think of it I'm not sure why one would ever use relay_hrw over relay_rr.
> 
> Theoretically, a more favorable load distribution that's consistent
> over time?  e.g. if you do RR of the same messaging pattern from
> multiple nodes, you could have waves of "randomly" overlapping loads
> on the relayer-node since everyone is cycling through all the proxies
> at their own rate when choosing the relayer.  With HRW, you'd stick
> with the same relayer over time and only change on outages, but
> everyone should have chosen their relayer in a uniformly distributed
> fashion.
> 
> - Jon

I'd expect that round robin would give the most uniform load distribution, for N proxies each proxy
would see 1/N relay messages, but I guess in general round robin isn't the best load balance mechanism
since it doesn't take into account the responsiveness of each proxy.  With some of the information CAF provides it
may be possible to also support weighted round robin.  That way if a proxy node doesn't die outright but starts
having issues for one reason or another, relay_rr could avoid sending it messages.

— 
Justin Azoff




More information about the bro-dev mailing list