Skip to content

Commit

Permalink
for #319, refine config, collect the mr and publish timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 29, 2015
1 parent bc100c2 commit 7386420
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 144 deletions.
20 changes: 15 additions & 5 deletions trunk/conf/compatible.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
98 changes: 58 additions & 40 deletions trunk/conf/full.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
13 changes: 8 additions & 5 deletions trunk/conf/full.one.vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions trunk/conf/realtime.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7386420

Please sign in to comment.