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
The new Origin Cluster, SRS origin server with proxy, can extend the number of streams it supports. The Edge Cluster is used to expand the number of viewers supported, but the Edge Cluster only supports the RTMP protocol. You cannot use Edge Cluster for WebRTC or SRT protocol.
Currently, the Edge Cluster is built within the SRS media server, like this:
Client ---RTMP--> SRS(Edge) ---> SRS(Origin)
This architecture has some problems:
Complexity: Makes SRS complex and hard to maintain
Protocol Limitations: Needs to support at least RTMP and WebRTC protocols within the same C++ codebase
Scalability Issues: Adding new protocols (like SRT) requires significant C++ development
Maintenance Overhead: All protocol handling is embedded in the main SRS server
I think a better approach would be a Relay Cluster, like this:
Note: A simple relay can be based on Go+FFmpeg, which can support RTMP, SRT, WebRTC, and other protocols. Accordingly, the relay server can be implemented in pure Go or Rust. Like the proxy server, a relay can be implemented in Go or Rust, eliminating the need for a C++ server.
Note: As all relays are stateless client applications, a relay is very simple and stateless, and can be deployed easily and effectively. With this approach, all SRS clusters can be made stateless.
With the relay approach, SRS only needs to be an Origin server, or an Origin Cluster with a proxy server:
A relay is not a proxy server; it relies on events to relay streams. For example, when a viewer starts to request a stream from an Origin server, it will trigger the relay to deliver the stream from another origin server.
For a very small relay cluster, it acts as a forwarder, always forwarding all streams to another origin server.
For a small or medium relay cluster, it uses play event hooks and starts the relay only when requests are received. It also disconnects the stream by hooking the stop event of the last viewer.
This requires more events from SRS, especially the first viewer connect event and the last viewer disconnect event. These new events can be used to reduce the load for processing all events from SRS.
Latency Analysis
The Relay Cluster architecture will NOT increase latency because:
No Caching Layer: Relays operate without stream caching when no cache is configured
Pipeline Processing: Data flows through relays in a pipeline without buffering
Direct Forwarding: Packets are forwarded immediately without processing delays
EnglishNativeThis issue is conveyed exclusively in English.
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The new Origin Cluster, SRS origin server with proxy, can extend the number of streams it supports. The Edge Cluster is used to expand the number of viewers supported, but the Edge Cluster only supports the RTMP protocol. You cannot use Edge Cluster for WebRTC or SRT protocol.
Currently, the Edge Cluster is built within the SRS media server, like this:
This architecture has some problems:
I think a better approach would be a
Relay Cluster
, like this:With the relay approach, SRS only needs to be an Origin server, or an Origin Cluster with a proxy server:
A relay is not a proxy server; it relies on events to relay streams. For example, when a viewer starts to request a stream from an Origin server, it will trigger the relay to deliver the stream from another origin server.
This requires more events from SRS, especially the first viewer connect event and the last viewer disconnect event. These new events can be used to reduce the load for processing all events from SRS.
Latency Analysis
The Relay Cluster architecture will NOT increase latency because:
Beta Was this translation helpful? Give feedback.
All reactions