mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	for #319, refine config, collect the mr and publish timeout
This commit is contained in:
		
							parent
							
								
									bc100c2867
								
							
						
					
					
						commit
						738642073e
					
				
					 11 changed files with 197 additions and 144 deletions
				
			
		| 
						 | 
				
			
			@ -21,15 +21,25 @@ http_stream {
 | 
			
		|||
    dir ./objs/nginx/html;
 | 
			
		||||
}
 | 
			
		||||
vhost __defaultVhost__ {
 | 
			
		||||
    # for SRS2.
 | 
			
		||||
    refer github.com github.io;
 | 
			
		||||
    refer_publish github.com github.io;
 | 
			
		||||
    refer_play github.com github.io;
 | 
			
		||||
    
 | 
			
		||||
    # for SRS1.
 | 
			
		||||
    http {
 | 
			
		||||
        enabled on;
 | 
			
		||||
        mount [vhost]/hls;
 | 
			
		||||
        dir ./objs/nginx/html/hls;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    # for SRS2.
 | 
			
		||||
    refer github.com github.io;
 | 
			
		||||
    refer_publish github.com github.io;
 | 
			
		||||
    refer_play github.com github.io;
 | 
			
		||||
    
 | 
			
		||||
    # for SRS2
 | 
			
		||||
    publish_1stpkt_timeout  20000;
 | 
			
		||||
    publish_normal_timeout  7000;
 | 
			
		||||
    
 | 
			
		||||
    # for SRS2
 | 
			
		||||
    mr {
 | 
			
		||||
        enabled off;
 | 
			
		||||
        latency 350;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -334,40 +334,6 @@ vhost security.srs.com {
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# the MR(merged-read) setting for publisher.
 | 
			
		||||
# the MW(merged-write) settings for player.
 | 
			
		||||
vhost mrw.srs.com {
 | 
			
		||||
    # whether enable min delay mode for vhost.
 | 
			
		||||
    # for min latence mode:
 | 
			
		||||
    # 1. disable the mr for vhost.
 | 
			
		||||
    # 2. use timeout for cond wait for consumer queue.
 | 
			
		||||
    # @see https://github.com/simple-rtmp-server/srs/issues/257
 | 
			
		||||
    # default: off
 | 
			
		||||
    min_latency     off;
 | 
			
		||||
    # about MR, read https://github.com/simple-rtmp-server/srs/issues/241
 | 
			
		||||
    mr {
 | 
			
		||||
        # whether enable the MR(merged-read)
 | 
			
		||||
        # default: off
 | 
			
		||||
        enabled     on;
 | 
			
		||||
        # the latency in ms for MR(merged-read),
 | 
			
		||||
        # the performance+ when latency+, and memory+,
 | 
			
		||||
        #       memory(buffer) = latency * kbps / 8
 | 
			
		||||
        # for example, latency=500ms, kbps=3000kbps, each publish connection will consume
 | 
			
		||||
        #       memory = 500 * 3000 / 8 = 187500B = 183KB
 | 
			
		||||
        # when there are 2500 publisher, the total memory of SRS atleast:
 | 
			
		||||
        #       183KB * 2500 = 446MB
 | 
			
		||||
        # the value recomment is [300, 2000]
 | 
			
		||||
        # default: 350
 | 
			
		||||
        latency     350;
 | 
			
		||||
    }
 | 
			
		||||
    # set the MW(merged-write) latency in ms. 
 | 
			
		||||
    # SRS always set mw on, so we just set the latency value.
 | 
			
		||||
    # the latency of stream >= mw_latency + mr_latency
 | 
			
		||||
    # the value recomment is [300, 1800]
 | 
			
		||||
    # default: 350
 | 
			
		||||
    mw_latency      350;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# vhost for edge, edge and origin is the same vhost
 | 
			
		||||
vhost same.edge.srs.com {
 | 
			
		||||
    # the mode of vhost, local or remote.
 | 
			
		||||
| 
						 | 
				
			
			@ -966,6 +932,58 @@ vhost debug.srs.com {
 | 
			
		|||
    debug_srs_upnode    on;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# the publish specified configs
 | 
			
		||||
vhost publish.srs.com {
 | 
			
		||||
    # the config for FMLE/Flash publisher, which push RTMP to SRS.
 | 
			
		||||
    publish {
 | 
			
		||||
        # about MR, read https://github.com/simple-rtmp-server/srs/issues/241
 | 
			
		||||
        # when enabled the mr, SRS will read as large as possible.
 | 
			
		||||
        # default: off
 | 
			
		||||
        mr          off;
 | 
			
		||||
        # the latency in ms for MR(merged-read),
 | 
			
		||||
        # the performance+ when latency+, and memory+,
 | 
			
		||||
        #       memory(buffer) = latency * kbps / 8
 | 
			
		||||
        # for example, latency=500ms, kbps=3000kbps, each publish connection will consume
 | 
			
		||||
        #       memory = 500 * 3000 / 8 = 187500B = 183KB
 | 
			
		||||
        # when there are 2500 publisher, the total memory of SRS atleast:
 | 
			
		||||
        #       183KB * 2500 = 446MB
 | 
			
		||||
        # the value recomment is [300, 2000]
 | 
			
		||||
        # default: 350
 | 
			
		||||
        mr_latency  350;
 | 
			
		||||
        
 | 
			
		||||
        # the 1st packet timeout in ms for encoder.
 | 
			
		||||
        # default: 20000
 | 
			
		||||
        firstpkt_timeout    20000;
 | 
			
		||||
        # the normal packet timeout in ms for encoder.
 | 
			
		||||
        # default: 5000
 | 
			
		||||
        normal_timeout      7000;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# the MR(merged-read) setting for publisher.
 | 
			
		||||
# the MW(merged-write) settings for player.
 | 
			
		||||
vhost mrw.srs.com {
 | 
			
		||||
    # whether enable min delay mode for vhost.
 | 
			
		||||
    # for min latence mode:
 | 
			
		||||
    # 1. disable the publish.mr for vhost.
 | 
			
		||||
    # 2. use timeout for cond wait for consumer queue.
 | 
			
		||||
    # @see https://github.com/simple-rtmp-server/srs/issues/257
 | 
			
		||||
    # default: off
 | 
			
		||||
    min_latency     off;
 | 
			
		||||
    # set the MW(merged-write) latency in ms. 
 | 
			
		||||
    # SRS always set mw on, so we just set the latency value.
 | 
			
		||||
    # the latency of stream >= mw_latency + mr_latency
 | 
			
		||||
    # the value recomment is [300, 1800]
 | 
			
		||||
    # default: 350
 | 
			
		||||
    mw_latency      350;
 | 
			
		||||
    
 | 
			
		||||
    # @see publish.srs.com
 | 
			
		||||
    publish {
 | 
			
		||||
        mr          off;
 | 
			
		||||
        mr_latenct  350;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# the vhost for min delay, donot cache any stream.
 | 
			
		||||
vhost min.delay.com {
 | 
			
		||||
    # @see vhost mrw.srs.com for detail.
 | 
			
		||||
| 
						 | 
				
			
			@ -1019,12 +1037,12 @@ vhost stream.control.com {
 | 
			
		|||
    # while the sequence header is not changed yet.
 | 
			
		||||
    # default: off
 | 
			
		||||
    reduce_sequence_header  on;
 | 
			
		||||
    # the 1st packet timeout in ms for encoder.
 | 
			
		||||
    # default: 20000
 | 
			
		||||
    publish_1stpkt_timeout  20000;
 | 
			
		||||
    # the normal packet timeout in ms for encoder.
 | 
			
		||||
    # default: 5000
 | 
			
		||||
    publish_normal_timeout  7000;
 | 
			
		||||
    
 | 
			
		||||
    # @see publish.srs.com
 | 
			
		||||
    publish {
 | 
			
		||||
        firstpkt_timeout    20000;
 | 
			
		||||
        normal_timeout      7000;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# the vhost which forward publish streams.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,17 +66,20 @@ vhost vhost.srs.com {
 | 
			
		|||
    atc_auto on;
 | 
			
		||||
    
 | 
			
		||||
    min_latency on;
 | 
			
		||||
    mr {
 | 
			
		||||
        enabled off;
 | 
			
		||||
    }
 | 
			
		||||
    mw_latency 100;
 | 
			
		||||
    gop_cache off;
 | 
			
		||||
    queue_length 10;
 | 
			
		||||
    tcp_nodelay on;
 | 
			
		||||
    send_min_interval 10.0;
 | 
			
		||||
    reduce_sequence_header on;
 | 
			
		||||
    publish_1stpkt_timeout 20000;
 | 
			
		||||
    publish_normal_timeout 7000;
 | 
			
		||||
    
 | 
			
		||||
    publish {
 | 
			
		||||
        mr off;
 | 
			
		||||
        mr_latency 350;
 | 
			
		||||
        
 | 
			
		||||
        firstpkt_timeout 20000;
 | 
			
		||||
        normal_timeout 7000;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    refer {
 | 
			
		||||
        enabled off;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,9 +8,9 @@ vhost __defaultVhost__ {
 | 
			
		|||
    gop_cache       off;
 | 
			
		||||
    queue_length    10;
 | 
			
		||||
    min_latency     on;
 | 
			
		||||
    mr {
 | 
			
		||||
        enabled     off;
 | 
			
		||||
    }
 | 
			
		||||
    mw_latency      100;
 | 
			
		||||
    tcp_nodelay     on;
 | 
			
		||||
    publish {
 | 
			
		||||
        mr off;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue