ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.32k stars 5.33k forks source link

Question: Increase the timeout to configure vhost SRS, Help me.. #3559

Closed thanhdat9526 closed 1 year ago

thanhdat9526 commented 1 year ago

Note: Please read FAQ before file an issue, see #2716

Description

Please description your issue here

  1. SRS Version: 4.0

  2. SRS Log:

[2023-05-29 15:11:06.773][Trace][36210][64git77y] complex handshake success.
[2023-05-29 15:11:06.773][Trace][36210][64git77y] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2023-05-29 15:11:06.779][Trace][36210][64git77y] connected, version=0.0.0.0, ip=, pid=0, id=0, dsu=1
[2023-05-29 15:11:06.819][Trace][36210][64git77y] edge-pull publish url rtmp://172.25.48.77:1935/livetranscode/stream_9_d4d97__level5?vhost=fastly.vegacdn.com, stream=stream_9_d4d97__level5 as stream_9_d4d97__level5?
[2023-05-29 15:11:06.968][Trace][36210][57547r0v] Hybrid cpu=0.00%,9MB, cid=4,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0, free=1, objs=(pkt:0,raw:0,fua:0,msg:1,oth:0,buf:0)
[2023-05-29 15:11:11.825][Warn][36210][64git77y][62] EdgeIngester: Ignore error, code=1011 : recv message : recv interlaced message : read basic header : basic header requires 1 bytes : read bytes : timeout 5000 ms
thread [36210][64git77y]: ingest() [src/app/srs_app_edge.cpp:325][errno=62]
thread [36210][64git77y]: recv_message() [src/protocol/srs_rtmp_stack.cpp:372][errno=62]
thread [36210][64git77y]: recv_interlaced_message() [src/protocol/srs_rtmp_stack.cpp:859][errno=62]
thread [36210][64git77y]: read_basic_header() [src/protocol/srs_rtmp_stack.cpp:954][errno=62]
thread [36210][64git77y]: grow() [src/protocol/srs_protocol_stream.cpp:162][errno=62]
thread [36210][64git77y]: read() [src/protocol/srs_service_st.cpp:507][errno=62]
  1. SRS Config:
    listen              1935;
    max_connections     1000;
    pid                 objs/srs.flv.1935.pid;
    daemon              on;
    srs_log_tank        console;
    http_server {
    enabled         on;
    listen          8090;
    dir             ./objs/nginx/html;
    }
    vhost __defaultVhost__ {
    cluster {
        mode remote;
        origin  my-ip:1935;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    }

Question: I urgently need an exact answer: How can I increase the timeout, I see default value of 5000 milliseconds and I don't know how to change it for my configuration

winlinvip commented 1 year ago

You can find all configurations for SRS in this file: conf/full.conf. To locate the default timeout of 5000, simply search for it within the file, and you will come across the relevant configuration.

vhost __defaultVhost__ {
    publish {
        # the normal packet timeout in ms for encoder.
        # Overwrite by env SRS_VHOST_PUBLISH_NORMAL_TIMEOUT for all vhosts.
        # default: 5000
        normal_timeout 7000;
    }
}

However, it is not recommended to modify this value, as it indicates that there have been no media packets from your client for 5 seconds. Instead, you should investigate your network or client for potential issues.