-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy: Support proxy server for SRS. v7.0.16 #4158
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suzp1984
reviewed
Aug 31, 2024
suzp1984
reviewed
Aug 31, 2024
winlinvip
force-pushed
the
feature/srs-proxy
branch
from
September 1, 2024 05:07
15f132a
to
54d01ba
Compare
winlinvip
force-pushed
the
feature/srs-proxy
branch
from
September 1, 2024 09:22
54d01ba
to
1217a4d
Compare
suzp1984
reviewed
Sep 5, 2024
winlinvip
added a commit
that referenced
this pull request
Sep 9, 2024
…4171) The heartbeat of SRS is a timer that requests an HTTP URL. We can use this heartbeat to report the necessary information for registering the backend server with the proxy server. ```text SRS(backend) --heartbeat---> Proxy server ``` A proxy server is a specialized load balancer for media servers. It operates at the application level rather than the TCP level. For more information about the proxy server, see issue #4158. Note that we will merge this PR into SRS 5.0+, allowing the use of SRS 5.0+ as the backend server, not limited to SRS 7.0. However, the proxy server is introduced in SRS 7.0. It's also possible to implement a registration service, allowing you to use other media servers as backend servers. For example, if you gather information about an nginx-rtmp server and register it with the proxy server, the proxy will forward RTMP streams to nginx-rtmp. The backend server is not limited to SRS. --------- Co-authored-by: Jacob Su <suzp1984@gmail.com>
winlinvip
added a commit
that referenced
this pull request
Sep 9, 2024
The heartbeat of SRS is a timer that requests an HTTP URL. We can use this heartbeat to report the necessary information for registering the backend server with the proxy server. ```text SRS(backend) --heartbeat---> Proxy server ``` A proxy server is a specialized load balancer for media servers. It operates at the application level rather than the TCP level. For more information about the proxy server, see issue #4158. Note that we will merge this PR into SRS 5.0+, allowing the use of SRS 5.0+ as the backend server, not limited to SRS 7.0. However, the proxy server is introduced in SRS 7.0. It's also possible to implement a registration service, allowing you to use other media servers as backend servers. For example, if you gather information about an nginx-rtmp server and register it with the proxy server, the proxy will forward RTMP streams to nginx-rtmp. The backend server is not limited to SRS. --------- Co-authored-by: Jacob Su <suzp1984@gmail.com>
winlinvip
added a commit
that referenced
this pull request
Sep 9, 2024
The heartbeat of SRS is a timer that requests an HTTP URL. We can use this heartbeat to report the necessary information for registering the backend server with the proxy server. ```text SRS(backend) --heartbeat---> Proxy server ``` A proxy server is a specialized load balancer for media servers. It operates at the application level rather than the TCP level. For more information about the proxy server, see issue #4158. Note that we will merge this PR into SRS 5.0+, allowing the use of SRS 5.0+ as the backend server, not limited to SRS 7.0. However, the proxy server is introduced in SRS 7.0. It's also possible to implement a registration service, allowing you to use other media servers as backend servers. For example, if you gather information about an nginx-rtmp server and register it with the proxy server, the proxy will forward RTMP streams to nginx-rtmp. The backend server is not limited to SRS. --------- Co-authored-by: Jacob Su <suzp1984@gmail.com>
winlinvip
force-pushed
the
feature/srs-proxy
branch
from
September 9, 2024 03:12
2120738
to
79161b9
Compare
winlinvip
changed the title
Proxy: Support proxy server for SRS.
Proxy: Support proxy server for SRS. v7.0.16
Sep 9, 2024
winlinvip
added a commit
that referenced
this pull request
Sep 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please note that the proxy server is a new architecture or the next version of the Origin Cluster, which allows the publication of multiple streams. The SRS origin cluster consists of a group of origin servers designed to handle a large number of streams.
The new origin cluster is designed as a collection of proxy servers. For more information, see Discussion #3634. If you prefer to use the old origin cluster, please switch to a version before SRS 6.0.
A proxy server can be used for a set of origin servers, which are isolated and dedicated origin servers. The main improvement in the new architecture is to store the state for origin servers in the proxy server, rather than using MESH to communicate between origin servers. With a proxy server, you can deploy origin servers as stateless servers, such as in a Kubernetes (K8s) deployment.
Now that the proxy server is a stateful server, it uses Redis to store the states. For faster development, we use Go to develop the proxy server, instead of C/C++. Therefore, the proxy server itself is also stateless, with all states stored in the Redis server or cluster. This makes the new origin cluster architecture very powerful and robust.
The proxy server is also an architecture designed to solve multiple process bottlenecks. You can run hundreds of SRS origin servers with one proxy server on the same machine. This solution can utilize multi-core machines, such as servers with 128 CPUs. Thus, we can keep SRS single-threaded and very simple. See #3665 (comment) for details.
Keep in mind that the proxy server for the Origin Cluster is designed to handle many streams. To address the issue of many viewers, we will enhance the Edge Cluster to support more protocols.
With the new Origin Cluster and Edge Cluster, you have a media system capable of supporting a large number of streams and viewers. For example, you can publish 10,000 streams, each with 100,000 viewers.
Co-authored-by: Jacob Su suzp1984@gmail.com