...
Code Block |
---|
|
dropwatch -l kas
>start |
UDP socket buffers tuning on system level
If UDP is used to publish or play high bitrate streams (for instance, as CDN internal transport), UDP socket buffers tuning may be required
Code Block |
---|
|
sudo sysctl -w net.core.rmem_max=26214400
sudo sysctl -w net.core.rmem_default=26214400 |
In this case the server performance should be enough to handle all the traffic packets. Otherwise, a translation quality will drop (a freezes will appear), and CPU will become a bottleneck.
Channel load optimization
...
Code Block |
---|
|
[Service]
User=flashphoner
Group=flashphoner
LimitNOFILE=100000
... |
Internal command to change file descriptors limit
Since build 5.2.1255 the following command can be used to set file descriptors limit:
Code Block |
---|
|
sudo ./webcallserver set-fd-limit 100000 |
WCS will be stopped before settings changing and will be automatically started after settings changing to apply them.
If a new value is less than the default one (20000), erroe message will be displayed, and changes will not be applied.
Traffic encryption in a separate thread for each client session
By default, one CPU thread encrypts medai traffic for all the client sessions. This leads to one CPU core overload by such thread, espacyally on low-power servers, for big subscribers amount. Then, server can not send mediapackets to all subscribers, and streams viewed are degrading, FPS lowering and freezing.
To distribute the load evenly across the CPU cores, it is necessary to enable traffic encryption in a separate thread for each client session with the following parameters
Code Block |
---|
|
rtp_paced_sender=true
rtp_paced_sender_initial_rate=200000
rtp_paced_sender_increase_interval=50
rtp_paced_sender_k_up=0.9 |
and restart WCS.
Stream distribution optimization
A stream playback quality may drop when a number of subscribers are viewing it simutlaneouly (from 100 and more): low FPS, freezes. However, server capacity and channel bandwidth may be enough. In this case it is recommended to enable multithreaded stream distribution to subscribers using the following parameter
Code Block |
---|
|
streaming_distributor_subgroup_enabled=true |
In this case, audio and video client sessions are distributed by groups.
Maximum number of video sessions per group can be set with the following parameter
Code Block |
---|
|
streaming_distributor_subgroup_size=50 |
Maximum number of audio sessions per group can be set with the following parameter
Code Block |
---|
|
streaming_distributor_audio_subgroup_size=500 |
Frame queue size per group and maximum frame waiting time (in milliseconds) are set by the following parameters
Code Block |
---|
|
streaming_distributor_subgroup_queue_size=300
streaming_distributor_subgroup_queue_max_waiting_time=5000 |
for video and
Code Block |
---|
|
streaming_distributor_audio_subgroup_queue_size=300
streaming_distributor_audio_subgroup_queue_max_waiting_time=5000 |
for audio sessions respectively.