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
Reproduction
The steps to reproduce the bug are as follows:
Start SRS and run ...
Push 500 streams and use http-flv to play each stream on the frontend player, with a bitrate of 1Mb/s for each stream.
Keep playing the 500 streams on the frontend for 1 hour, then close the push and play ends. Wait for 1 minute and repeat step 2.
After the stress test is finished, close all push and play connections. The memory usage of SRS is 3.4G and CPU usage is 60.3%. The memory and CPU usage remain high and do not decrease.
...
Expected Behavior
After the stress test is finished, the CPU and memory usage should decrease.
Preliminary determination is that the issue is caused by the failure to clean up the srsSource objects. Each time a stream is pushed, there is a unique sourceID, so a large number of source objects are stored in the static global pool of srs, leading to increased memory usage. Moreover, in the coroutine, it is necessary to continuously loop through this pool and process each source object. Having too many source objects may result in high CPU usage for this coroutine.
I hope the experts can provide a solution.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered:
In each source member variable, multiple coroutines are started, which ultimately leads to the generation of a large number of coroutines in SRS. The switching of coroutines consumes a significant amount of CPU time, which may be the reason why the CPU remains high even after stopping the stress test.
The coroutine issue has been resolved, and the coroutine will stop after stopping the stream.
We are still considering the best solution for the memory problem.
Description
Describe the problem you encountered.
Environment
...
...
Reproduction
The steps to reproduce the bug are as follows:
...
Expected Behavior
After the stress test is finished, the CPU and memory usage should decrease.
Preliminary determination is that the issue is caused by the failure to clean up the srsSource objects. Each time a stream is pushed, there is a unique sourceID, so a large number of source objects are stored in the static global pool of srs, leading to increased memory usage. Moreover, in the coroutine, it is necessary to continuously loop through this pool and process each source object. Having too many source objects may result in high CPU usage for this coroutine.
I hope the experts can provide a solution.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: