You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebRTC is now quite mature, with stable playback and the protocol already being an RFC. There are also quite a few corresponding open-source projects. However, I believe that WebRTC still lacks a high-performance, simple and easy-to-use server. I have analyzed the existing servers before and found various issues. SRS has a great opportunity to solve these problems.
Note: SRS is bound to CPU0, Benchmark is bound to CPU2-3.
Note: The test video is still ./doc/source.200kbps.768x320.flv.
Note: The following tests are all Streams=1, meaning pushing one stream for multiple playback scenarios.
Baseline
Baseline without any optimization, the data is as follows:
Stage
SRS
Players
CPU
us
sys
si
Docker
Baseline
4.0.20
200
51%
35%
19%
15%
233%
SRTP-NASM
SRTP enabled openssl, and openssl enabled assembly, which means that SRTP encryption and decryption are optimized with assembly. Refer to 5e06a256. The data is as follows:
Stage
SRS
Players
CPU
us
sys
si
Docker
SRTP-NASM
4.0.20
200
38%
28%
22%
14%
198%
Baseline
4.0.20
200
51%
35%
19%
15%
233%
UDP sendmmsg + mw_latency
After enabling sendmmsg, multiple UDP packets can be sent at once. The data is as follows:
Remark: By default, RTC is configured for low latency, which means min_latency on; and play.mw_latency 0;, so the number of messages that can be written with each sendmmsg is not much. We will increase the latency to observe changes in performance.
Note: The queue (ms) below refers to mw_sleep, which is also known as mw_latency, which represents how many milliseconds the server actively queues (delays) before writing multiple packets at once.
Stage
SRS
Players
Queue
CPU
us
sys
si
Docker
---
---
---
---
---
---
---
---
---
UDP sendmmsg
4.0.20
200
350ms
20%
22%
12%
4%
130%
UDP sendmmsg
4.0.20
200
200ms
18%
11%
7%
3%
132%
UDP sendmmsg
4.0.20
200
100ms
21%
18%
12%
5%
134%
UDP sendmmsg
4.0.20
200
0ms
38%
29%
20%
12%
200%
SRTP-NASM
4.0.20
200
0ms
38%
28%
22%
14%
198%
Baseline
4.0.20
200
0ms
51%
35%
19%
15%
233%
Although the optimization of queues over 100ms may not be significant, I think there may be other bottlenecks. From the data above, it can be seen that sendmmsg is very useful for optimizing system performance.
Currently, the server queue is set by increasing the delay, also known as mw_latency. This allows the server to send more data at once, which is useful for TCP optimization. However, for UDP, especially in low-latency RTC scenarios, it is not advisable to increase the delay to improve performance. In fact, sendmmsg allows for sending data to multiple clients at once, and future optimization will be aimed in this direction.
changed the title [-]Support WebRTC,一对一通话,多人通话,SFU,直播连麦,会议录制等[/-][+]WebRTC: Support WebRTC, for video meeting, SFU server, video converence. 一对一通话,多人通话,SFU,直播连麦,会议录制等[/+]on Nov 25, 2022
changed the title [-]WebRTC: Support WebRTC, for video meeting, SFU server, video converence. 一对一通话,多人通话,SFU,直播连麦,会议录制等[/-][+]WebRTC: Support WebRTC, for video meeting, SFU server, video converence.[/+]on Jul 25, 2023
Activity
Jianru-Lin commentedon May 29, 2015
PengZheng commentedon Sep 11, 2016
823639792 commentedon Sep 22, 2017
[-]支持WebRTC[/-][+]Support WebRTC[/+]winlinvip commentedon Jan 19, 2020
For #307, #1070, define FLV CodecID for AV1 and Opus. 3.0.101
winlinvip commentedon Mar 14, 2020
winlinvip commentedon Mar 14, 2020
candidate is the address that RTC provides services to the outside. In certain deployment scenarios, we need to configure it in multiple ways.
This is also the only item that RTC must confirm the configuration for, while others can be left at their default settings.
For detailed configuration instructions, please refer to: https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
TRANS_BY_GPT3
For #1638, #307, rtc conf support ENV.
54 remaining items
For #307, use files of openssl 1.0.*
For #307, refine RTC latency from 600ms to 200ms. 4.0.20
winlinvip commentedon Apr 4, 2020
MacPro information:
Docker information:
Baseline
Baseline without any optimization, the data is as follows:
SRTP-NASM
SRTP enabled openssl, and openssl enabled assembly, which means that SRTP encryption and decryption are optimized with assembly. Refer to 5e06a256. The data is as follows:
UDP sendmmsg + mw_latency
After enabling sendmmsg, multiple UDP packets can be sent at once. The data is as follows:
Although the optimization of queues over 100ms may not be significant, I think there may be other bottlenecks. From the data above, it can be seen that sendmmsg is very useful for optimizing system performance.
Currently, the server queue is set by increasing the delay, also known as mw_latency. This allows the server to send more data at once, which is useful for TCP optimization. However, for UDP, especially in low-latency RTC scenarios, it is not advisable to increase the delay to improve performance. In fact, sendmmsg allows for sending data to multiple clients at once, and future optimization will be aimed in this direction.
TRANS_BY_GPT3
For #307, SRTP ASM only works with openssl-1.0, auto detect it. 4.0.22
For #307, support sendmmsg to improve RTC performance
For #307, use sendmmsg in rtc server
92 remaining items
mud0107 commentedon Jan 27, 2021
matishsiao commentedon Mar 31, 2021
[-]Support WebRTC[/-][+]Support WebRTC,一对一通话,多人通话,SFU,直播连麦,会议录制等[/+][-]Support WebRTC,一对一通话,多人通话,SFU,直播连麦,会议录制等[/-][+]WebRTC: Support WebRTC, for video meeting, SFU server, video converence. 一对一通话,多人通话,SFU,直播连麦,会议录制等[/+][-]WebRTC: Support WebRTC, for video meeting, SFU server, video converence. 一对一通话,多人通话,SFU,直播连麦,会议录制等[/-][+]WebRTC: Support WebRTC, for video meeting, SFU server, video converence.[/+]