[nanomsg] Re: Where "Channel ID" are managed in the code ?

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Thu, 16 Jan 2014 13:44:38 +0100

On 2014-01-16 07:29, Paul Colomiets wrote:

Then, there are two more problems:

1. Memory consumption may be too high, as there at least are key per each client on each device. But in reality there is a key per "path" (i.e. many
paths may be used in case of many-to-many connections)

2. You need to expire keys, to free memory. Its not only a problem to
choose default timeout, but also a potentially huge timeout queue

Note: the point 1 also makes it easy to create DoS attack.

Ok, fair enough.

I think there are two general points to consider:

1. Other patterns (pub/sub specifically) already use this kind of approach. So, for example, if there's a lot of subscriptions from the subscribers, the publisher may fail because of OOM. So it's not like we are completely immune to OOM and DoS attacks even now.

2. What we are trying to achieve here is "perfectly fair load balancing" which is only an ideal to strive for and can never be achieved in real world. So, even with the current req/rep model, the requests may be load-balanced unfairly, for example, it there's a REQ socket connected to one actual worker and one device, the worker gets 50% of the load even though the device may be a proxy for 100 workers.

That being said, feel free to think of an different algorithm with a better memory usage vs. fairness tradeoff.

Martin

Other related posts: