[OpenSIPS-Devel] Autoscaling syntax error

Dan Pascu dan at ag-projects.com
Tue Apr 30 06:00:41 EDT 2019


On 26 Apr 2019, at 12:00, Bogdan-Andrei Iancu wrote:

> Well, at the time I developed the feature, that was the feeling in do it - probably the idea of the difference between UDP and TCP is too deep in my brain.
> 
> On the other hand, it make sense what you also say. If you open a bug report for this, we might be able to pack it as fix for 3.0.

I pushed a small fix that allows one to specify an auto scaling profile with udp_workers. Someone more knowledgeable with the code should double check it, just in case I missed something.

It works by defining a global udp scaling profile and uses that if the listener interface didn't define any (i.e. it acts as a fallback:

if listener_scaling_defined:
  use_listener_scaler
elif global_scaling_defined:
  use_global_scaler
else:
  use_none

This means that if both listen and udp_workers define a scaling profile, the one defined in listen will take precedence.

Someone should update the documentation with this detail (btw, where is the documentation for the global script parameters? I checked the source tree and could not find it)

As a note, there is some inconsistency in the behavior compared to tcp. With tcp, since it can only define the scaling profile with tcp_workers, that profile is global and is applied to all listening interfaces. So if one has multiple listeners for tcp, all will share the same single pool of workers. With udp though, because it checks it per listener and it falls back to the global one if undefined, there will be a worker pool per listener interface, even if the listener doesn't define it's own scaling profile. So because of the implementation details, udp will have as many worker pools as udp listening interfaces are defined.

In an ideal scenario, the scaling defined globally with udp_workers and tcp_workers should only create one worker pool shared by all interfaces that don't define their own, and only interfaces that explicitly define a scaling profile should have their own separate worker pool. However the changes required to do this are not trivial and seem to require a major refactoring of the code so I left them out for now. Maybe in a future update someone more knowledgeable could reorganize the code to achieve this and also allow defining a scaling profile with tcp listeners.

> 
> On 04/25/2019 08:31 PM, Dan Pascu wrote:
>> On 25 Apr 2019, at 19:32, Bogdan-Andrei Iancu wrote:
>> 
>>> Dan,
>>> 
>>> It seems to be a documentation error. The udp_workers param do not support the "use_auto_scaling" option, as for UDP you can define the profile per listener. I will fix the doc.
>> It would make sense to be able to specify them in a similar manner. Either through xxx_worker or listen or both.
>> I'd like to keep my configuration organized. Right now I can only specify it through tcp_workers for tcp and listen for udp. Why is there this limitation that udp_workers doesn't accept the syntax and listen only accepts it for udp?
>> 

--
Dan







More information about the Devel mailing list