·您当前的位置:首页 > 技术教程 > FMS教程 >

[FMS]FMS5.0流媒体服务器配置文件Application.xml介绍

时间:2014-03-01 15:20adobe.com
通过这里的设定可以指定一个应用程序运行时和它的全部实例是否都在一个单独的进程里还这个应用程序的每一个实例使用一个单独的进 程(注意不是线程)

这个配置文件是针对于一个主机的各种数据的组织形式的配置,安装完成后直接有默认的配置,也可以用。但在实际的开发过程中为了适用于不同的形式和配合一个系统中的其它的部分就要改变一下配置,当然,就从这个文件里改。。。 关于这一块,我只能在有空时每天译一小部分,慢是补全。。。。高手不用看了,和我一样不太熟悉的朋友喜欢的前提下可以看一下,我也是做一个备忘才打算译一下。。。。。

<Application>

<Process>
   <!-- Determines the process scope in which to run this application. -->
   <!-- This can be set to "app" which will run an app and all its     -->
   <!-- instances in single process; or "inst" which will run each   -->
   <!-- instance in single process. By default, if nothing is        -->
   <!-- specified, each vhost (and all its apps and app instances) are -->
   <!-- run in single process.   
指定应用程序的处理方式。通过这里的设定可以指定一个应用程序运行时和它的全部实例是否都在一个单独的进程里还这个应用程序的每一个实例使用一个单独的进 程(注意不是线程)。默认情况下没有任何的设定,那么应用程序将按照每个主机一个单独的进程(这个进程里包括当前正在运行的所有应用程序及应用程序实 例)。-->
   <Scope></Scope>

   <!-- Determines the lifetime of stateless core processes. To enable -->
   <!-- the rollover of such processes, set any non-zero value for the -->
   <!-- tag. Process rollover comes into effect only for inst scopes. -->
   <!-- non-zero rollover value determines how long core process   -->
   <!-- is in use, after which new core is instantiated and all the -->
   <!-- subsequent connections are directed to the new one. 
指定一个没有宿主的核心进程的存活周期。它将仅影响到实例的范围。它的值决定一个核心进程在工作中会存活多长时间,之后将会有一个新的核心进程被实例化并且把把有的连接并发的形式定位到这个新的核心进程身上。      -->
   <!-- The MaxCores value determines how many core processes can be   -->
   <!-- in existence for given app. value of zero disables it.     -->
   <!-- The defaults for both these values is zero and hence both are -->
   <!-- disabled by default.  
                    MaxCores的值决定了一个给定的应用程序可以同时被多少个核心进程同时处理。如果指定一个0的值,那么这个功能将被关闭,就是默认的一个进程服务于一个给定的应用程序 。默认情况下这两个配置都是指定了0的值,因此默认它们就对应用的功能就都不可用。                     -->
   <LifeTime>
    <RollOver></RollOver>
    <MaxCores></MaxCores>
   </LifeTime>

   <!-- Determines the maximum number of process failures that will be -->
   <!-- tolerated before core process is disabled. Once disabled the -->
   <!-- the master will not launch core process till some minimum    -->
   <!-- recovery time elapses. This may be used to guard against DOS -->
   <!-- behaviour where faulty core consumes all cpu time by being   -->
   <!-- repeatedly launched very quickly. The recovery time is         -->
   <!-- specified in seconds, and setting it to disables checking    -->
   <!-- for process failures. Note loading an application via admin    -->
   <!-- tools or APIs bypasses this check.                             -->
   <MaxFailures>2</MaxFailures>
   <RecoveryTime>300</RecoveryTime>
</Process>

<!-- Specifies whether or not to load this app when the server starts. 
   是否在服务器服务的时候就加载本程序,默认不加载(是否等于开机自动运行FMS,待验证)。。。
-->
<LoadOnStartup>false</LoadOnStartup>

<!-- Max time an app instance can be idle (no clients connected) -->
<!-- before being unloaded. Note: an app instance only goes idle -->
<!-- after the last client disconnects. If the instance is loaded -->
<!-- with no clients connected, it is not considered to be idle. -->
<!-- The max idle time is specified in seconds. (20 minutes)    
        应用程序实例被释放之前的最大空闲时间长度(指没有 任何终端连接)。提示:一个应用程序实例仅在最后一个连接断开时进入空闲状态。如果这个实例被加载并且没有任何终端连接,这种情况不会被视为处于空闲状态 (总结,判断是否是空闲状态就满足两点1、是否是有终端连接过,2、是看是否还有终端正的处于连接之中。当然这两者的前提都是必须加载了这个应用程序实 例。)。最大的空闲时间最大只能指定到20分钟。
-->
<MaxAppIdleTime>1200</MaxAppIdleTime>


<!-- This section contains information about configuring the script engine.
这部分包括的是关于脚本引擎的配置 -->
<JSEngine>
   <!-- This specifies the max size (Kb.) the runtime can grow to before -->
   <!-- garbage collection is performed.     指定运行时并且在执行垃圾回收之前这个状态的最大内存使用增长尺寸                             -->
   <RuntimeSize>1024</RuntimeSize>

   <!-- This specifies the max amount of time (in seconds) that script -->
   <!-- function can take to execute. If it takes longer than this max   -->
   <!-- timeout period, then the script is considered "runaway", and     -->
   <!-- script execution will be terminated. By default, this value is -->
   <!-- which means there is no timeout and we do not check for runaway -->
   <!-- scripts. Normally you would only want to check for this in     -->
   <!-- development environment while debugging and testing apps. In   -->
   <!-- production environment, presumably, your apps have been tested   -->
   <!-- and should not go into any infinite loops (or become "runaway"). 
这里指定一个脚本过程的执行时间长度范围,以秒为基本单位。如果某个过程执行时间长度超出了这个给定的时间长度,那么这个脚本被视为“无效”,并且中止执 行。默认它的值是0,意思就是没有执行时间长度的检查。一般你应该仅在开发和调试你的应用程序时开启这个功能,就是不设为0;而在一个产品的运行环境里你 的程序是被测试过的并且不应该进入无限循环的状态(即将被视为“无效”)-->
   <MaxTimeOut>0</MaxTimeOut>

   <!-- FMS provides the load API which allows loading other script        -->
   <!-- files within main.asc. File specified is first resolved using the -->
   <!-- main.asc, if the load file is not found in that location, path     -->
   <!-- specified in this tag is used to resolve the file. This tag can    -->
   <!-- contain multiple and they must be separated by ';' Resolution is -->                  
   <!-- is done left to right   FMS提供了加载API的功能,允许加载其它的脚本文件到MAIN.ASC文件中。如果在MAIN.ASC文件中给定的脚本文件无法找到时,系统就到本标签中找。本标答可包括一个或多个脚本文件并且是用“;”来分隔的。当前的读取识别顺序是按从左到或的方式。 -->
   <ScriptLibPath>${APP.JS_SCRIPTLIBPATH}</ScriptLibPath>

   <!-- This section specifies virtual directory mappings for file      -->
   <!-- objects in the script. By using virtual directories, you can    -->
   <!-- specify file directories for different applications. If the     -->
   <!-- beginning portion of file path matches the virtual directory -->
   <!-- that is specified, then the storage location of the file maps   -->
   <!-- to the location specified by the virtual directory mapping. To -->
   <!-- specify virtual directory mapping, you first specify the      -->
   <!-- virtual directory, followed by semi-colon, followed by the    -->
   <!-- actual file location. <virtual dir>;<actual dir>                -->
   <FileObject>
    <!--
    <VirtualDirectory>/flashapps;C:devCodeFlashtincanflashapps</VirtualDirectory>
    -->
   </FileObject>
</JSEngine>

<StreamManager>
   <!-- Specifies the physical location where recorded streams are stored. -->
   <!-- For example, <StorageDir>c:myappstreams</StorageDir>  
          指定以流的形式被记录成的文件的物理存储位置(如果在线录像录音文件)          -->
   <StorageDir></StorageDir>

   <!-- Specifies the physical location where streams are duplicated      -->
   <!-- This location serves as backup for Stream files              -->
   <!-- This location must already exist, and when stream    -->
   <!-- is copied here, it will be categorized by instance name by default   -->
   <!-- To include application name in the file path created the tag   -->
   <!-- change the appName attribute to "true", if not "false"    -->
   <!-- Example<DuplicateDir appName="true">c:backupStreams</DuplicateDir>
         指定当以流的形式记录的音视频文件存储在服务器上同时备份一份到一个指定的物理存储位置。
         备份的物理位置必须事先建立好,指一个文件夹先建立好也就是先存在。这些被备份的文件将以实例名作为默认的分类准则。配置方式 <DuplicateDir appName="要被备份的应用程序名">物理备份路径</DuplicateDir> -->
   <DuplicateDir appName="true"></DuplicateDir>

   <!-- Specifies the cache prefix that is passed from the origin server to the -->
   <!-- proxy server. This is used by the proxy server as relative path to       -->
   <!-- locate the cache file in the CacheDir                                       -->
   <!-- The type can be set to "path" or "sname". If type="path", the physical     -->
   <!-- path of the recorded stream will be appended to the prefix.                 -->
   <!-- If type "sname", the stream name will be appended to the prefix           -->
   <!-- The prefix can be any text with/without preset paramaters, all parameters   -->
   <!-- are sourrounded by ?. Everything within the will be substituted by the   -->
   <!-- server.                                                                     -->
   <!--                                                                             -->
   <!-- ?IP?      represents the IP address of the server.                           -->
   <!-- ?APP?     represents the application name.                                   -->
   <!-- ?APPINST? represents the application instance.                               -->
   <!-- ?VHOST?   represents the vhost name.                                         -->
   <!--                                                                             -->
   <!-- Since the prefix is used as relative path in the proxy CacheDir, all      -->
   <!-- parameters should be separate by '/'. For example, if type "path" and    -->
   <!-- the recorded stream is located in c:/fms/flvs/foo.flv.                      -->
   <!-- data/?IP? will be resolved into data/xxx.xxx.xxx.xxx/c/fms/flvs/foo.flv     --> 
   <!-- ?APPINST?/data will be resolved into app1/inst1/data/c/fms/flvs/foo.flv     --> 
   <!-- origin1/data/ will be resolved into origin1/data/c/fms/flvs/foo.flv         --> 
   <!--                                                                             -->
   <!-- By default, type is set to "path" and the prefix is set to ?IP?. The IP in -->
   <!-- the prefix can be used to avoid file collision. For example, the proxy     -->
   <!-- server might be connecting to two different origin servers with the same    -->
   <!-- file in c:datafoo.flv. And you want to keep the cache files separate in -->
   <!-- the proxy server. Similarly, if you want to share the cache file among     -->
   <!-- origin servers, you should not include the IP as parameter.                 -->
   <!-- Remember this prefix is relative path used by proxy server to lookup the -->
   <!-- cache stream file. The prefix can be any name except some special          -->
   <!-- characters such as :, *, ?, ", <, >, |.                                  -->
   <CachePrefix type="path">?IP?</CachePrefix>

   <!-- Specifies the interval for updating the cache streaming in the proxy        -->
   <!-- server. Value is in millisecond. Minimum 10 sec, maximum 24 hours,    -->
   <!-- default 10 min.          
指定代理服务器更新缓存里的流的周期,最大24小时,最小10秒,用豪秒计算。默认10分钟。                                                 -->
   <CacheUpdateInterval></CacheUpdateInterval>
  
   <!-- If there is no key frame at the point of seek server will create one -->
   <!-- based on the nearest key and intermediate frames. Default false.    -->
   <EnhancedSeek>true</EnhancedSeek>

   <!-- Specifies the interval for saving generated keyframes in an .flv file -->
   <!-- Value is in milliseconds.    Default 1000.                           -->
   <KeyFrameInterval>60000</KeyFrameInterval>
   <!-- Force GC if stream list grows over the specified value -->
   <!-- Default -1, which is unlimited. Will be GC'd during application GC interval   -->
   <MaxStreamsBeforeGC>100</MaxStreamsBeforeGC>

   <Audio>
    <CombineSamples>
     <!-- Combine samples if there are more than subscribers. -->
     <Subscribers>8</Subscribers>

     <!-- Stop combining samples if cpu is lower than this.      -->
     <LoCPU>60</LoCPU>

     <!-- Start combining samples if cpu is more than this.      -->
     <HiCPU>80</HiCPU>

     <!-- Combine audio samples into one message.              -->
     <MaxSamples>4</MaxSamples>
    </CombineSamples>
    <SendSilence>
     <!-- Specifies the interval (in milliseconds) for sending silence message -->
     <!-- when no audio is publishing to live stream. Default is second    -->
     <!-- Set to to disable the silence message                              -->
     <!-- Silence message is used to support older version of Flash players.   -->
     <!-- The server will only send the silence message to clients which are   -->
     <!-- specified in <UserAgent> inside the <Client> section. And bit 0x01 -->
     <!-- is used to control the silence message.                              -->
     <Interval></Interval>
    </SendSilence>
    <NotifyAudioStop enabled="false">
     <!-- Specifies how long to wait before the server notifies the client     -->
     <!-- when audio stops in the middle of live/recorded stream.            -->
     <!-- Default is second and minimum is second. 指定当直播或记录的流中的声音停止时服务器通知客户端的延时,取值区间是>=1 秒,默认3秒。                       -->
     <Duration></Duration>
    </NotifyAudioStop>
   </Audio>
</StreamManager>

<SharedObjManager>
   <!-- Specifies the physical location where shared objects are stored -->
   <!-- on the server.      SO文件 的物理存储位置                                             -->
   <!-- For example, <StorageDir>c:myappsharedobjects</StorageDir>   -->
   <StorageDir></StorageDir>
  
   <!-- Specifies the physical location where shared objects are duplicated   -->
   <!-- This location serves as backup for SharedObject files              -->
   <!-- This location must already exist, and when shared object    -->
   <!-- is copied here, it will be categorized by instance name by default   -->
   <!-- To include application name in the file path created the tag   -->
   <!-- change the appName attribute to "true", if not "false"    -->
   <!-- Example<DuplicateDir appName="true">c:backupSharedObjects</DuplicateDir>
SO文件被存储的同时被备份到哪里,如果流文件的记录同时被备份到另一个地方。 -->
   <DuplicateDir appName="true"></DuplicateDir>

   <!-- Deleted slots will be purged if the current version deleted version is greater -->
   <!-- than the value specified. -->
   <ResyncDepth>-1</ResyncDepth>

   <!-- Specifies the timeout value in seconds to automatically unlock -->
   <!-- sharedobject if there is client waiting for update. -1 to wait for ever.
指定如果是客户要更新SO的时候它的意义是以秒计算的自动SO对象的解锁超时。因为多个用户同时更新一个SO也有可能,自动锁并解锁可改变这种冲突。像ASP服务器的APPLICATION对像的LOCK UNLOCK方法的思-->
</LockTimeOut>-1</LockTimeOut>
  
   <!-- SharedObjects are automatically commited if they are dirty, this can be disabled -->
   <!-- for all shared objects within this instance by specifying false. SASS will have to call-->
   <!-- "save" or SharedObject.commit to persist the shared object else all data will be lost when the app shuts down

SO如果被指定了就会自动提交,这一个功能可以关掉,指定FLASE就行了。服务器代码会调用SAVE或者SharedObject.commit来保持SO对像的存在,否则应用程序关闭后所有的数据都会丢失。

-->
   <AutoCommit>true</AutoCommit>

   <!-- Maximum properties that can be set per shared object 
SO对像最多可被指定多少个属性,如果配置为-1就是不限制。
!-- -1 is unlimited. -->
   <MaxProperties>-1</MaxProperties>
   <!-- Each property within each shared object cannot exceed value specified in bytes. 
每一个属性的值在每一个SO里不能超过的字节数。-1同样也是不限制。
<!-- -1 is unlimited. -->
   <MaxPropertySize>-1</MaxPropertySize>

</SharedObjManager>

热门文章推荐

请稍候...

保利威视云平台-轻松实现点播直播视频应用

酷播云数据统计分析跨平台播放器