Open NodeBoy2 opened 4 years ago
Using gdb to debug a long-running program (while streaming), in the _st_thread_create() function of the st library, the _st_active_count variable has reached 1695. At the same time, in the fetch_or_create() function of srs_app_source.cpp, the value of the pool is outputted, and it is found that the previous streaming records still exist.
(gdb) p _st_active_count $1 = 1695
(gdb) p pool $1 = std::map with 845 elements = { ["/mttest/fengyifan_test"] = 0x1a1e1c0, ["/test/test_200"] = 0x29d5b20, ["origin.test.com/test/003d94d6.10c9a7116ac01061"] = 0x3621f80, ... }
TRANS_BY_GPT3
Refer to https://github.com/ossrs/srs/issues/713. In SrsSource::fetch(), add source->die_at = -1; At the same time, add the active_at variable to SrsSource to record the last active time (update it in on_metadata, on_video, on_audio). When cleaning up SrsSource objects, first check if die_at has timed out, then check if the last active time has timed out. Can this solve the problem?
TRANS_BY_GPT3
The waiting performance of ST needs to be optimized.
TRANS_BY_GPT3
me too, CPU 20%'.
TRANS_BY_GPT3
There is a PR https://github.com/ossrs/state-threads/pull/5 related to this issue, improving the performance for iterating all coroutines.
Description'
Please ensure that the markdown structure is maintained.
2.0.258
Replay
How to replay bug?
1. Long-time operation/live streaming (using random values for streaming URLs, all different)
Expected behavior (Expect)
TRANS_BY_GPT3