coturn / coturn

coturn TURN server project
Other
11.29k stars 2.01k forks source link

how to tune behavior when bps-capacity reached #1168

Open FJEagle opened 1 year ago

FJEagle commented 1 year ago

Problem: when tested with bps-capacity set and bps-capacity reached, we found that coturn stopped to allow further allocation and new ice connection failed.

Is this the expected behavior?

We hope coturn could reduce the traffic by dropping the packets similar to max-bps behavior and accept new ice connections, with a consequent result that each connection has an equivalent lower "max-bps".

Example:

config in file

max-bps=250000 #byte, =2Mbit bps-capacity=20000000 #byte, 160Mbit

expectations

1、when count of connections <= 80, each connection has a limit of 2Mbit; 2、when count of connections ==160, coturn would still accept new connection, and each connection has an equivalent limit of 1Mbit.

Is it possible now for us to tune coturn's behavior like above?

Thanks

eakraly commented 1 year ago

Hi @FJEagle

It could make sense to have a more than one degradation policy - something that you as a user of coturn could configure. For example: 1) rigid as today (if above bps-capacity drop new connections) 2) degrade (if above bps-capacity degrade all to accomodate new connection)

Is this something you could suggest a PR for?

FJEagle commented 1 year ago

YES, a soft degradation policy is preferred. Thanks for your redescription, @eakraly . So, rigid is the only available option for now, right?