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.68k stars 5.38k forks source link

Low concurrent volume of HLS streaming #2563

Closed liyoung1992 closed 3 years ago

liyoung1992 commented 3 years ago

Description'

Please ensure that the markdown structure is maintained.

The concurrent number of HLS streaming is low, reaching around 1000, while FLV can reach around 5000.

  1. SRS version: SRS/3.0.169(OuXuli)'

Please ensure that the markdown structure is maintained.

  1. The configuration of SRS is as follows (Config):

Please ensure that the markdown structure is maintained.

master:

listen              1935;
max_connections     1000;
pid                 ./objs/master.pid
srs_log_tank        file;
srs_log_file        ./objs/master.log;
daemon              on;
http_api {
    enabled         on;
    listen          1985;
}
http_server {
    enabled         on;
    listen          8180;
    dir             ./objs/nginx/html;
}

vhost __defaultVhost__ {
> # Low latency configuration------------------

Please ensure that the markdown structure is maintained.
   # tcp_nodelay on;
   # min_latency on;
    #play {
    #    gop_cache       off;
    #    queue_length    10;
    #    mw_latency      100;
    #}
    #publish {
    #    mr off;
    #}
    #------------------------
    forward {
        enabled on;
        destination 10.206.0.*:1935  10.206.0.*:1936 10.206.0.*:1937;
    }
> # HTTP callback.

Please ensure that the markdown structure is maintained.
    http_hooks {
      enabled off;
     #on_publish  http://172.31.160.*:9999/v1/srs_callback;
    }
    hls {
        enabled         on;
>         hls_path        ./objs/nginx/html;# Slice address, can use srs or nginx as proxy
        hls_fragment    2;# Size of each fragment
        hls_window      20;# HLS window

Please ensure that the markdown structure is maintained.
        hls_wait_keyframe  on;
    }
}

slave:

listen              1935;
max_connections     3000;
pid                 ./objs/slave.pid;
#pid                 objs/edge.pid;
srs_log_file        ./objs/slave.log;
http_api {
    enabled         on;
    listen          1997;
}

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

stats {
    network         0;
    disk            sda sdb xvda xvdb;
}

vhost __defaultVhost__ {
    #tcp_nodelay on;
    #min_latency on;
   # play {
       # gop_cache       off;
      #  queue_length    10;
     #   mw_latency      100;
        #time_jitter     off;
    #} 
    #publish {
    #    mr off;
    #}
    http_remux{
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
        hstrs       on;
    }

    hls{
        enabled         on;
        hls_path        ./objs/nginx/html;
        hls_fragment    10;
        hls_window      60;
        hls_wait_keyframe  on;
        }
}

Expected behavior (Expect)

Please ensure that the markdown structure is maintained.

> HLS concurrency is greatly affected by IO. Are there any good methods to solve this problem?

Please ensure that the markdown structure is maintained.

TRANS_BY_GPT3

winlinvip commented 3 years ago

Currently, the performance of HTTP has not been optimized. It is mainly used for demos and can be hosted on Nginx or a web server.

In the future, the capabilities of the HTTP server will be enhanced, referring to #1657.

TRANS_BY_GPT3