The Application.xml file contains the settings for applications that will run on the server. These settings include, for example, the size of the Server-Side Communication ActionScript runtime engine, the location at which streams and shared objects are stored, and bandwidth limitations.
Each virtual host can contain multiple Application.xml files. The Application.xml file in the virtual host directory configures the default settings for applications within the virtual host. If you want to have different settings for a particular application, create a specific Application.xml file in the application's registered application directory (for example, ../applications/app_name) with the settings you want.
The Application.xml file contains the following tag structure, with brief comments for each tag:
 |
<Application> is the root tag for the XML document. It is a container for all the other tags.
|
 |
<LoadOnStartup> indicates whether an application instance is loaded by default when the server starts up. Having an application instance loaded at server startup saves time when the first client connects to that application. The default value is false . If you set this tag to true in the virtual host's Application.xml file, an instance of each application on the server will be loaded at startup. If you set this tag to true in an application's optional Application.xml file, only that application will have an instance loaded at startup.
|
 |
<MaxAppIdleTime> indicates the number of seconds between the last client disconnection and the unloading of the application instance from the server's memory. The default is 1200 seconds (20 minutes). If this value is set to 0 or less, the default is used.
|
 |
<RecordAppLog> indicates whether to write the application log to a file. The default value is false . If you set this tag to true , a log stream file named applicationName.flv is created for each application in the virtual host's /admin/Streams/Logs directory. Each log file records connections to the application and any error messages that are generated by the server for the application.
|
|
To view the contents of the log stream, you must build a communication application that retrieves the stream file from the server. Because the log files contain no audio or video, they are sent all at once by the server. For more information about creating communication applications, see Developing Communication Applications Help. |
 |
<JSEngine> is a container for the next three tags, which control the resource usage of the Server-Side Communication ActionScript engine.
|
 |
<RunTimeSize> indicates the maximum number of bytes that a particular application instance can use to run server-side ActionScript on the server before garbage collection is performedthat is, before any unreferenced or unused ActionScript objects are purged from memory. The default is 1024K or 1 MB. If you create a client application that requires more than 1 MB of ActionScript memory, this value must be increased. If a new script object is created after garbage collection that will cause the runtime size of the application instance to exceed the value of the <RunTimeSize> tag, an out-of-memory error occurs and the application instance is shut down.
|
 |
<MaxTimeOut> indicates the maximum time in seconds that a server-side script function may take to execute. If a script function takes longer than the specified amount of time, it will be stopped by the server. Using this feature increases the processor workload. Setting this tag to a value greater than 0 is useful for debugging scripts during development of your applications. During deployment, it is recommended that you set this tag to the default value of 0, which imposes no limit on the time scripts take to execute.
|
 |
<ScriptLibPath> specifies a location for additional server-side scripts, such as components.asc or NetServices.asc. The server first looks for additional server-side scripts in the directory where your main.asc or application_name.asc file is located, which should be in/applications/application_name or /applications/application_name/scripts. Then, the server looks for additional scripts in the path specified in this tag. You can specify multiple directories by delimiting them with semicolons. Do not use quotation marks when specifying the path.
|
 |
<StreamManager> is a container for the next three tags, which control media streams.
|
 |
<StorageDir> indicates the directory where streams should be recorded for each application. The default is a directory named Streams in your application directory. The default is used if no directory is specified. When specifying a directory, use an absolute path.
|
 |
<EnhancedSeek> enables or disables finer seeking performance within streams. When this tag is set to true , the server inserts keyframes at the point in the stream where the seek begins if there is no preexisting keyframe there. This results in better visual display while seeking. When this tag is set to false (the default), no keyframes are inserted by the server and seeks begin at the nearest existing keyframe.
|
 |
<KeyFrameInterval> specifies, in milliseconds, how often to generate and save keyframes in an FLV file. These server-generated keyframes allow clients to perform seek and playback of the video stream. The default value is 1000.
|
|
Setting this tag to a higher value than the default reduces the number of keyframes added to the FLV file and thus reduces the file size (but also reduces the seeking accuracy). For example, a 15-second video with a file size of 76 KB is increased only to 89 KB with <KeyFrameInterval> set to 5000, which is an increase of 13 KB, or 17%. The same video has a size of 109 KB with <KeyFrameInterval> set to 1000, which is an increase of 33 KB, or 43%. You should be aware of the correlation between file size and accuracy of seeking when you set this value. |
 |
<SharedObjManager> is a container tag for the <StorageDir> tag.
|
 |
The <StorageDir> tag inside the <SharedObjManager> tag indicates the directory where shared objects should be stored. The default is a directory named Sharedobjects in the application's directory. The default is used if no directory is specified. When specifying a directory, use an absolute path. (For more information about shared objects, see Developing Communication Applications.) |
 |
<Client> is a container for the <Bandwidth> , <BandwidthCap> , and <HTTPTunnel> tags.
|
 |
<Bandwidth> is a container for two tags that control the amount of bandwidth to use for upstream (client-to-server) and downstream (server-to-client) data traffic. By default, this tag includes an override parameter set to "yes" , which allows both of its subtags to be overridden.
|
 |
<ServerToClient> specifies the maximum speed at which the server sends data to the client. The default is 250K (250,000 bytes per second) per client.
|
 |
<ClientToServer> specifies the maximum speed at which the client sends data to the server. The default is 250K (250,000 bytes per second) per client.
|
 |
<BandwidthCap> is a container for two tags that specify the maximum values that can be used when remotely editing the preceding <ServerToClient> and <ClientToServer> tags inside the <Bandwidth> tag. By default, this tag includes an override parameter set to "no" . For more information about editing server configuration remotely, see the Macromedia Flash Support Center.
|
 |
<ServerToClient> specifies the maximum speed that can be configured remotely for sending data to the client. The default is 10 MB (10,000,000 bytes per second).
|
 |
<ClientToServer> specifies the maximum speed that can be configured remotely for sending data to the server. The default is 10 MB (10,000,000 bytes per second).
|
 |
<HTTPTunnel> contains two tags that affect the latency observed by a client tunneling into the server (tunneling means to send RTMP packets through HTTP). Low values will reduce the latency but increase the network bandwidth overhead. The values of the two tags, <IdlePostInterval> and <IdleAckInterval> , should be considered together: for applications that need low latency, use a value of 128 for <IdlePostInterval> and 256 for <IdleAckInterval> ; when latency is not an issue, use values of 1024 and 2048, respectively. The default setting of 512 for both values provides medium latency.
|
 |
<IdlePostInterval> specifies the interval, in milliseconds, at which the client should send idle posts to the server to indicate that the player has no data to send. This interval must be specified to enable the server to send data to the player. Valid values are between 0 and 4064 milliseconds.
|
 |
<IdleAckInterval> specifies the maximum number of millseconds the server waits before sending an acknowledgement (ack) of a client-idle post. Valid values are between 0 and 4064 milliseconds.
|
|
|
<Application>
<LoadOnStartup>false</LoadOnStartup>
<MaxAppIdleTime>1200</MaxAppIdleTime>
<RecordAppLog>true</RecordAppLog>
<JSEngine>
<RuntimeSize>2048</RuntimeSize>
<MaxTimeOut>0</MaxTimeOut>
<ScriptLibPath>C:\Program Files\Macromedia Flash Communication Server MX\scriptlib</ScriptLibPath>
</JSEngine>
<StreamManager>
<StorageDir>C:\FlashStreams\</StorageDir>
<EnhancedSeek>false</EnhancedSeek>
<KeyFrameInterval>5000</KeyFrameInterval>
</StreamManager>
<SharedObjManager>
<StorageDir>C:\FlashObjs\</StorageDir>
</SharedObjManager>
<Client>
<Bandwidth override= "yes">
<ServerToClient>250000</ServerToClient>
<ClientToServer>250000</ClientToServer>
</Bandwidth>
<BandwidthCap override= "no">
<ServerToClient>10000000</ServerToClient>
<ClientToServer>10000000</ClientToServer>
</BandwidthCap>
<HTTPTunnel>
<IdlePostInterval>512</IdlePostInterval>
<IdleAckInterval>512</IdleAckInterval>
</HTTPTunnel>
</Client>
</Application>
The following set of Application.xml tags has been customized for real-world
use. The <RecordAppLog>
tag is set to TRUE
.
The runtime size of the JavaScript (JS) engine is increased from the default
to 2 MB. The storage directory for streams is set to C:\FlashStreams\. The storage
directory for shared objects is set to C:\FlashObjs\. The bandwidth limits are
set to the defaults.