Media port recycle

hyuk

Member
Hi,

Is there a way to reduce the time occupying the media port when streaming?
For security reasons, only about 200 media_ports were being used.
I tested iteratively with 3 devices by myself.
At some point, an error stating that there are no remaining ports occurred, and further testing was not possible.
After that, I restarted the flashphoner service because there was no free port for a long time.
Please let me know if there is a workaround without adding media port.

Have a nice day.
 

Max

Administrator
Staff member
Good day.
You can decrease media port checking interval:
Code:
media_ports_auditor_interval=2000
In this case, a media port should be freed after 6 seconds (3 times 2 seconds each to check).
 

hyuk

Member
Hi,
I did not use this option.
What happens to the default if no options are entered?
I checked and the documentation says the default value is 1000ms.
If so, 200 ports would have been enough when I tested it by myself, but I wonder why such an error occurred..
Have a nice day.
 

Max

Administrator
Staff member
What happens to the default if no options are entered?
By default, media port auditor interval is 5000 ms. So a port will be released in 15 seconds (3 tries, 5 seconds each).
Please also clarify the following:
1. How do you test in details?
2. How much connections you use simultaneously (check statistics page)?
3. Please make sure you use the latest WCS build 5.2.1032.
Please also read this article about varios load testing methods this article Comparing load testing methods.
 

hyuk

Member
Previously, I tested with 3 devices.
Finally, we plan to test with 4 devices.
A, B, C, and D all exchange video and audio in the same room.
Only A transmits video and B, C, D transmits audio.
So I think that A uses two ports for transmission because it has to transmit video and audio, and uses three ports because it needs to receive voices from other devices (B, C, D).
So, since 5 ports are used for each device, it is thought that 20 ports are used at a time for the test.
In this test, the devices reconnected to the room once again by refreshing the screen.
It seems to have been reconnected about once every 3 to 5 minutes to check the UI and stability.
WCS build version is 5.2.966.
Thank you for quick response.
 

Max

Administrator
Staff member
So I think that A uses two ports for transmission because it has to transmit video and audio, and uses three ports because it needs to receive voices from other devices (B, C, D).
By default, RTP bundle support is enabled on WCS, so 1 port is used to transfer video and audio packets. So every participant uses 1 port to publish its stream, and 3 ports to play other participants streams. Therefore, every participant uses 4 ports, 16 ports should be busy while all the participans are in room.
So if you make a fast join-leave-join test for one of participants, and check http://wcs:8081/?action=stat&groups=port_stats page, ports_media_quarantine value should grow. By default, a port is freed from quarantine after 15 seconds.
 

hyuk

Member
Thanks for the quick response.
Is there a convenient way to see currently occupied and free media ports on a server?
 
Top