Hi Guys,

For load balancing, and resilience, I have 2 servers, each with un- named, and named smsbox processes. Incoming messages destined for the un-named boxes get delivered across the un-named boxes on both servers quite happily.

However messages for a named box only ever get sent to the last box that connects with that name, (even though both are connected). If that box disconnects, messages get queued on bearerbox instead of being sent to the connected box with the same name.

I can see the problem, in bb_boxc the route_incomming_to_boxc function a named box is retrieved by a dict_get on smsbox_by_id. So this can only ever look at the most recently connected box of a given name.

Clearly a way I could implement a fix for this would be to loop over each box in the list and pull out the ones with the correct name. But I notice a warning about making sure code is efficient in this function. However I also notice that for an un-named box the entire list is looped over anyway.

What is the general consensus on the proper way to fix this?

I guess the most efficient method would be to have the dictionary hold a list of boxes that share the same name, and then only loop over them. Thus saving the string comparison on each box name.

Regards

Ben


Reply via email to