diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index 7f02b7e2b4..56afd5c27c 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -1,28 +1,19 @@ -# all config for srs +# All configurations for SRS, you can find whatever you want about configuration of SRS. +# Note that please never use this file as configuration of SRS, because it's just a full set of configurations. +############################################################################################# +# Global sections +############################################################################################# # The id of server, for stat and api identification. # Note that SRS will generate a random id if not configured. # Overwrite by env SRS_SERVER_ID server_id srs-ie193id; -############################################################################################# -# RTMP sections -############################################################################################# -# the rtmp listen ports, split by space, each listen entry is <[ip:]port> -# for example, 192.168.1.100:1935 10.10.10.100:1935 -# where the ip is optional, default to 0.0.0.0, that is 1935 equals to 0.0.0.0:1935 -listen 1935; # The pid file to write the pid, for managing the SRS process and avoiding duplicated processes. # If need to run multiple processes, please change this pid file to another one. # Note: Do not support reloading, for SRS5+ # Default: ./objs/srs.pid pid ./objs/srs.pid; -# the default chunk size is 128, max is 65536, -# some client does not support chunk size change, -# however, most clients support it and it can improve -# performance about 10%. -# default: 60000 -chunk_size 60000; # the log dir for FFMPEG. # if enabled ffmpeg, each transcoding stream will create a log file. # /dev/null to disable the log. @@ -76,7 +67,7 @@ pithy_print_ms 10000; # default: ./ work_dir ./; # whether quit when parent process changed, -# used for supervisor mode(not daemon), srs should always quit when +# used for supervisor mode(not daemon), srs should always quit when # supervisor process exited. # @remark conflict with daemon, error when both daemon and asprocess are on. # @reamrk do not support reload. @@ -119,164 +110,19 @@ inotify_auto_reload off; # default: on auto_reload_for_docker on; -# For tcmalloc, the release rate. -# @see https://gperftools.github.io/gperftools/tcmalloc.html -# @remark Should run configure --with-gperf -# default: 0.8 -tcmalloc_release_rate 0.8; - -# Query the latest available version of SRS, write a log to notice user to upgrade. -# @see https://github.com/ossrs/srs/issues/2424 -# @see https://github.com/ossrs/srs/issues/2508 -# Default: on -query_latest_version on; - -# First wait when qlv(query latest version), in seconds. -# Only available when qlv is enabled. -# Overwrite by env SRS_FIRST_WAIT_FOR_QLV -# Default: 300 -first_wait_for_qlv 300; - -# For thread pool. -threads { - # The thread pool manager cycle interval, in seconds. - # Default: 5 - interval 5; -} - -# For system circuit breaker. -circuit_breaker { - # Whether enable the circuit breaker. - # Default: on - enabled on; - # The CPU percent(0, 100) ever 1s, as system high water-level, which enable the circuit-break - # mechanism, for example, NACK will be disabled if high water-level. - # Default: 90 - high_threshold 90; - # Reset the high water-level, if number of pulse under high_threshold. - # @remark 0 to disable the high water-level. - # Default: 2 - high_pulse 2; - # The CPU percent(0, 100) ever 1s, as system critical water-level, which enable the circuit-break - # mechanism, for example, TWCC will be disabled if high water-level. - # @note All circuit-break mechanism of high-water-level scope are enabled in critical. - # Default: 95 - critical_threshold 95; - # Reset the critical water-level, if number of pulse under critical_threshold. - # @remark 0 to disable the critical water-level. - # Default: 1 - critical_pulse 1; - # If dying, also drop packets for players. - # Default: 99 - dying_threshold 99; - # If CPU exceed the dying_pulse times, enter dying. - # @remark 0 to disable the dying water-level. - # Default: 5 - dying_pulse 5; -} - -# TencentCloud CLS config, logging to cloud. -# See https://cloud.tencent.com/document/product/614/11254 -tencentcloud_cls { - # Whether heartbeat is enabled. - # Overwrite by env SRS_TENCENTCLOUD_CLS_ENABLED - # default: off - enabled off; - # The logging label to category the cluster servers. - # Overwrite by env SRS_TENCENTCLOUD_CLS_LABEL - label cn-beijing; - # The logging tag to category the cluster servers. - # Overwrite by env SRS_TENCENTCLOUD_CLS_TAG - tag cn-edge; - # The SecretId to access CLS service, see https://console.cloud.tencent.com/cam/capi - # Overwrite by env SRS_TENCENTCLOUD_CLS_SECRET_ID - secret_id AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; - # The SecretKey to access CLS service, see https://console.cloud.tencent.com/cam/capi - # Overwrite by env SRS_TENCENTCLOUD_CLS_SECRET_KEY - secret_key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; - # The endpoint of CLS, format as .cls.tencentcs.com. For example: - # ap-guangzhou.cls.tencentcs.com - # Note that tencentyun.com is for internal network, while tencentcs.com is for public internet. - # See https://cloud.tencent.com/document/product/614/18940 - # Overwrite by env SRS_TENCENTCLOUD_CLS_ENDPOINT - endpoint ap-guangzhou.cls.tencentcs.com; - # The topic ID of CLS, see https://cloud.tencent.com/document/product/614/41035 - # Overwrite by env SRS_TENCENTCLOUD_CLS_TOPIC_ID - topic_id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx; - # Whether enable logging for each log sending. - # Overwrite by env SRS_TENCENTCLOUD_CLS_DEBUG_LOGGING - # Default: off - debug_logging off; - # Whether enable the heartbeat stat every (5 * heartbeat_ratio)s. - # Overwrite by env SRS_TENCENTCLOUD_CLS_STAT_HEARTBEAT - # Default: on - stat_heartbeat on; - # Setup the heartbeat interval ratio, 1 means 5s, 2 means 10s, etc. - # Overwrite by env SRS_TENCENTCLOUD_CLS_HEARTBEAT_RATIO - # Default: 1 - heartbeat_ratio 1; - # Whether enable the streams stat every (5 * streams_ratio)s. - # Overwrite by env SRS_TENCENTCLOUD_CLS_STAT_STREAMS - # Default: on - stat_streams on; - # Setup the streams interval ratio, 1 means 5s, 2 means 10s, etc. - # Overwrite by env SRS_TENCENTCLOUD_CLS_STREAMS_RATIO - # Default: 1 - streams_ratio 1; -} - ############################################################################################# -# heartbeat/stats sections +# RTMP sections ############################################################################################# -# heartbeat to api server -# @remark, the ip report to server, is retrieve from system stat, -# which need the config item stats.network. -heartbeat { - # whether heartbeat is enabled. - # default: off - enabled off; - # the interval seconds for heartbeat, - # recommend 0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3,...,6,9,12,.... - # default: 9.9 - interval 9.3; - # when startup, srs will heartbeat to this api. - # @remark: must be a restful http api url, where SRS will POST with following data: - # { - # "device_id": "my-srs-device", - # "ip": "192.168.1.100" - # } - # default: http://127.0.0.1:8085/api/v1/servers - url http://127.0.0.1:8085/api/v1/servers; - # the id of device. - device_id "my-srs-device"; - # whether report with summaries - # if on, put /api/v1/summaries to the request data: - # { - # "summaries": summaries object. - # } - # @remark: optional config. - # default: off - summaries off; -} - -# system statistics section. -# the main cycle will retrieve the system stat, -# for example, the cpu/mem/network/disk-io data, -# the http api, for instance, /api/v1/summaries will show these data. -# @remark the heartbeat depends on the network, -# for example, the eth0 maybe the device which index is 0. -stats { - # Whether enable the stat of system resources. - # Default: on - enabled on; - # the index of device ip. - # we may retrieve more than one network device. - # default: 0 - network 0; - # the device name to stat the disk iops. - # ignore the device of /proc/diskstats if not configured. - disk sda sdb xvda xvdb; -} +# the rtmp listen ports, split by space, each listen entry is <[ip:]port> +# for example, 192.168.1.100:1935 10.10.10.100:1935 +# where the ip is optional, default to 0.0.0.0, that is 1935 equals to 0.0.0.0:1935 +listen 1935; +# the default chunk size is 128, max is 65536, +# some client does not support chunk size change, +# however, most clients support it and it can improve +# performance about 10%. +# default: 60000 +chunk_size 60000; ############################################################################################# # HTTP sections @@ -381,50 +227,6 @@ http_server { } } -############################################################################################# -# Streamer sections -############################################################################################# -# the streamer cast stream from other protocol to SRS over RTMP. -# @see https://github.com/ossrs/srs/tree/develop#stream-architecture - -# MPEGTS over UDP -stream_caster { - # whether stream caster is enabled. - # default: off - enabled on; - # the caster type of stream, the casters: - # mpegts_over_udp, MPEG-TS over UDP caster. - caster mpegts_over_udp; - # the output rtmp url. - # for mpegts_over_udp caster, the typically output url: - # rtmp://127.0.0.1/live/livestream - output rtmp://127.0.0.1/live/livestream; - # the listen port for stream caster. - # for mpegts_over_udp caster, listen at udp port. for example, 8935. - listen 8935; -} - -# FLV -stream_caster { - # whether stream caster is enabled. - # default: off - enabled on; - # the caster type of stream, the casters: - # flv, FLV over HTTP by POST. - caster flv; - # the output rtmp url. - # for flv caster, the typically output url: - # rtmp://127.0.0.1/[app]/[stream] - # for example, POST to url: - # http://127.0.0.1:8936/live/livestream.flv - # where the [app] is "live" and [stream] is "livestream", output is: - # rtmp://127.0.0.1/live/livestream - output rtmp://127.0.0.1/[app]/[stream]; - # the listen port for stream caster. - # for flv caster, listen at tcp port. for example, 8936. - listen 8936; -} - ############################################################################################# # SRT server section ############################################################################################# @@ -508,6 +310,18 @@ rtc_server { # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate # default: * candidate *; + # If candidate is * or 0.0.0.0, means SRS could detect IP automatically, filtered by ip_family. + # You can config this to off to disable the detecting, then SRS will try to parse the API hostname. + # Note that browser might fail if no CANDIDATE specified. + # Default: on + use_auto_detect_network_ip on; + # The IP family filter for auto discover candidate, it can be: + # ipv4 Filter IP v4 candidates. + # ipv6 Filter IP v6 candidates. + # all Filter all IP v4 or v6 candidates. + # For example, if set to ipv4, we only use the IPv4 address as candidate. + # default: ipv4 + ip_family ipv4; # If api_as_candidates is on, SRS would try to use the IP of api server, specified by srs.sdk.js request: # api:string "http://r.ossrs.net:1985/rtc/v1/play/" # in this case, the r.ossrs.net and 39.107.238.185 will be added as candidates. @@ -522,17 +336,6 @@ rtc_server { # Note that use original domain name as CANDIDATE, which might make Firefox failed, see https://bugzilla.mozilla.org/show_bug.cgi?id=1239006 # Default: off keep_api_domain off; - # Whether use network interface IP which is detected automatically, filtered by ip_family. - # Note that browser might fail if no CANDIDATE specified. - # Default: on - use_auto_detect_network_ip on; - # The IP family filter for auto discover candidate, it can be: - # ipv4 Filter IP v4 candidates. - # ipv6 Filter IP v6 candidates. - # all Filter all IP v4 or v6 candidates. - # For example, if set to ipv4, we only use the IPv4 address as candidate. - # default: ipv4 - ip_family ipv4; # Whether use ECDSA certificate. # If not, use RSA certificate. # default: on @@ -628,6 +431,212 @@ vhost rtc.vhost.srs.com { } } +############################################################################################# +# Streamer sections +############################################################################################# +# the streamer cast stream from other protocol to SRS over RTMP. +# @see https://github.com/ossrs/srs/tree/develop#stream-architecture + +# MPEGTS over UDP +stream_caster { + # whether stream caster is enabled. + # default: off + enabled on; + # the caster type of stream, the casters: + # mpegts_over_udp, MPEG-TS over UDP caster. + caster mpegts_over_udp; + # the output rtmp url. + # for mpegts_over_udp caster, the typically output url: + # rtmp://127.0.0.1/live/livestream + output rtmp://127.0.0.1/live/livestream; + # the listen port for stream caster. + # for mpegts_over_udp caster, listen at udp port. for example, 8935. + listen 8935; +} + +# FLV +stream_caster { + # whether stream caster is enabled. + # default: off + enabled on; + # the caster type of stream, the casters: + # flv, FLV over HTTP by POST. + caster flv; + # the output rtmp url. + # for flv caster, the typically output url: + # rtmp://127.0.0.1/[app]/[stream] + # for example, POST to url: + # http://127.0.0.1:8936/live/livestream.flv + # where the [app] is "live" and [stream] is "livestream", output is: + # rtmp://127.0.0.1/live/livestream + output rtmp://127.0.0.1/[app]/[stream]; + # the listen port for stream caster. + # for flv caster, listen at tcp port. for example, 8936. + listen 8936; +} + +############################################################################################# +# other global sections +############################################################################################# +# For tcmalloc, the release rate. +# @see https://gperftools.github.io/gperftools/tcmalloc.html +# @remark Should run configure --with-gperf +# default: 0.8 +tcmalloc_release_rate 0.8; + +# Query the latest available version of SRS, write a log to notice user to upgrade. +# @see https://github.com/ossrs/srs/issues/2424 +# @see https://github.com/ossrs/srs/issues/2508 +# Default: on +query_latest_version on; + +# First wait when qlv(query latest version), in seconds. +# Only available when qlv is enabled. +# Overwrite by env SRS_FIRST_WAIT_FOR_QLV +# Default: 300 +first_wait_for_qlv 300; + +# For thread pool. +threads { + # The thread pool manager cycle interval, in seconds. + # Default: 5 + interval 5; +} + +# For system circuit breaker. +circuit_breaker { + # Whether enable the circuit breaker. + # Default: on + enabled on; + # The CPU percent(0, 100) ever 1s, as system high water-level, which enable the circuit-break + # mechanism, for example, NACK will be disabled if high water-level. + # Default: 90 + high_threshold 90; + # Reset the high water-level, if number of pulse under high_threshold. + # @remark 0 to disable the high water-level. + # Default: 2 + high_pulse 2; + # The CPU percent(0, 100) ever 1s, as system critical water-level, which enable the circuit-break + # mechanism, for example, TWCC will be disabled if high water-level. + # @note All circuit-break mechanism of high-water-level scope are enabled in critical. + # Default: 95 + critical_threshold 95; + # Reset the critical water-level, if number of pulse under critical_threshold. + # @remark 0 to disable the critical water-level. + # Default: 1 + critical_pulse 1; + # If dying, also drop packets for players. + # Default: 99 + dying_threshold 99; + # If CPU exceed the dying_pulse times, enter dying. + # @remark 0 to disable the dying water-level. + # Default: 5 + dying_pulse 5; +} + +# TencentCloud CLS config, logging to cloud. +# See https://cloud.tencent.com/document/product/614/11254 +tencentcloud_cls { + # Whether heartbeat is enabled. + # Overwrite by env SRS_TENCENTCLOUD_CLS_ENABLED + # default: off + enabled off; + # The logging label to category the cluster servers. + # Overwrite by env SRS_TENCENTCLOUD_CLS_LABEL + label cn-beijing; + # The logging tag to category the cluster servers. + # Overwrite by env SRS_TENCENTCLOUD_CLS_TAG + tag cn-edge; + # The SecretId to access CLS service, see https://console.cloud.tencent.com/cam/capi + # Overwrite by env SRS_TENCENTCLOUD_CLS_SECRET_ID + secret_id AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; + # The SecretKey to access CLS service, see https://console.cloud.tencent.com/cam/capi + # Overwrite by env SRS_TENCENTCLOUD_CLS_SECRET_KEY + secret_key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; + # The endpoint of CLS, format as .cls.tencentcs.com. For example: + # ap-guangzhou.cls.tencentcs.com + # Note that tencentyun.com is for internal network, while tencentcs.com is for public internet. + # See https://cloud.tencent.com/document/product/614/18940 + # Overwrite by env SRS_TENCENTCLOUD_CLS_ENDPOINT + endpoint ap-guangzhou.cls.tencentcs.com; + # The topic ID of CLS, see https://cloud.tencent.com/document/product/614/41035 + # Overwrite by env SRS_TENCENTCLOUD_CLS_TOPIC_ID + topic_id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx; + # Whether enable logging for each log sending. + # Overwrite by env SRS_TENCENTCLOUD_CLS_DEBUG_LOGGING + # Default: off + debug_logging off; + # Whether enable the heartbeat stat every (5 * heartbeat_ratio)s. + # Overwrite by env SRS_TENCENTCLOUD_CLS_STAT_HEARTBEAT + # Default: on + stat_heartbeat on; + # Setup the heartbeat interval ratio, 1 means 5s, 2 means 10s, etc. + # Overwrite by env SRS_TENCENTCLOUD_CLS_HEARTBEAT_RATIO + # Default: 1 + heartbeat_ratio 1; + # Whether enable the streams stat every (5 * streams_ratio)s. + # Overwrite by env SRS_TENCENTCLOUD_CLS_STAT_STREAMS + # Default: on + stat_streams on; + # Setup the streams interval ratio, 1 means 5s, 2 means 10s, etc. + # Overwrite by env SRS_TENCENTCLOUD_CLS_STREAMS_RATIO + # Default: 1 + streams_ratio 1; +} + +############################################################################################# +# heartbeat/stats sections +############################################################################################# +# heartbeat to api server +# @remark, the ip report to server, is retrieve from system stat, +# which need the config item stats.network. +heartbeat { + # whether heartbeat is enabled. + # default: off + enabled off; + # the interval seconds for heartbeat, + # recommend 0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3,...,6,9,12,.... + # default: 9.9 + interval 9.3; + # when startup, srs will heartbeat to this api. + # @remark: must be a restful http api url, where SRS will POST with following data: + # { + # "device_id": "my-srs-device", + # "ip": "192.168.1.100" + # } + # default: http://127.0.0.1:8085/api/v1/servers + url http://127.0.0.1:8085/api/v1/servers; + # the id of device. + device_id "my-srs-device"; + # whether report with summaries + # if on, put /api/v1/summaries to the request data: + # { + # "summaries": summaries object. + # } + # @remark: optional config. + # default: off + summaries off; +} + +# system statistics section. +# the main cycle will retrieve the system stat, +# for example, the cpu/mem/network/disk-io data, +# the http api, for instance, /api/v1/summaries will show these data. +# @remark the heartbeat depends on the network, +# for example, the eth0 maybe the device which index is 0. +stats { + # Whether enable the stat of system resources. + # Default: on + enabled on; + # the index of device ip. + # we may retrieve more than one network device. + # default: 0 + network 0; + # the device name to stat the disk iops. + # ignore the device of /proc/diskstats if not configured. + disk sda sdb xvda xvdb; +} + ############################################################################################# # RTMP/HTTP VHOST sections #############################################################################################