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
Note: Before asking a question, please read the FAQ (Please read FAQ before filing an issue) #2716
Description
After stopping the HLS streaming, the number of online clients decreases slowly and takes a long time to reach 0.
Please description your issue here
I am using srs-bench for load testing. When pulling streams using http-flv with sb_http_load for 1000 streams, after stopping the streams, the number of clients instantly decreases to 0 when using the /api/v1/clients?start=0&count=10000 API to get the client count. However, when pulling streams using hls with sb_hls_load for 1000 streams, after stopping the streams, it takes a long time for the client count to decrease to 0 when using the /api/v1/clients?start=0&count=10000 API.
#2578 Enhance HLS: support http callback on_play/stop, support statistic #2578
I have reviewed the existing code and incorporated the modifications mentioned above for HLS. I have also verified it with the latest code, but the aforementioned issues still persist.
This is not a problem, but a characteristic of HLS, which can only be counted when relying on timeouts.
For example, if HLS has a segment every 10 seconds, the client may only request the server every 10 seconds. If there is no request within 10 seconds, it cannot be assumed that the client is no longer active. Instead, it is still alive until a certain timeout period.
So, when you see the number of connections slowly decreasing, it is because the server still considers these clients to be active. This is a characteristic of the segment protocol. Unlike RTMP or FLV streaming protocols, where the server immediately knows when a client disconnects.
winlinvip
changed the title
hls拉流停止拉流后,在线客户端数缓慢减少,很久才减到0
After the HLS streaming stops, the number of online clients slowly decreases and takes a long time to reach 0.
Jul 29, 2023
Description
After stopping the HLS streaming, the number of online clients decreases slowly and takes a long time to reach 0.
Please description your issue here
I am using srs-bench for load testing. When pulling streams using http-flv with sb_http_load for 1000 streams, after stopping the streams, the number of clients instantly decreases to 0 when using the /api/v1/clients?start=0&count=10000 API to get the client count. However, when pulling streams using hls with sb_hls_load for 1000 streams, after stopping the streams, it takes a long time for the client count to decrease to 0 when using the /api/v1/clients?start=0&count=10000 API.
SRS Version:
xxxxxx
4.0.199
SRS Configuration:
vhost defaultVhost {
tcp_nodelay on;
min_latency on;
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
hls {
enabled on;
hls_path ./objs/nginx/html/raw;
hls_fragment 10;
hls_window 60;
hls_dispose 30;
hls_wait_keyframe on;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
hls_cleanup on;
}
publish {
mr off;
firstpkt_timeout 20000;
normal_timeout 7000;
}
play {
mw_latency 100;
gop_cache on;
queue_length 10;
}
http_hooks {
enabled off;
}
Steps to Reproduce the Bug:
Step 1: Start OBS streaming. rtmp://172.24.0.75:1935/live/livestream
Step 2: Start HTTP-FLV playback: ./objs/sb_http_load -c 1000 -r http://172.24.0.75:9080/live/livestream.flv. Retrieve client information through /api/v1/clients?start=0&count=10000.
Step 3: Start HLS playback: ./objs/sb_hls_load -c 1000 -r http://172.24.0.75:9080/raw/live/livestream.m3u8. Retrieve client information through /api/v1/clients?start=0&count=10000.
Comparison of the time it takes for the client information to decrease to 0 between Step 2 and Step 3.
Expected Behavior (Expect)
After stopping the streaming, HLS streaming should be able to reflect the client information in real-time.
Description of your expectation
Please describe what you expect to happen.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: