본문 바로가기

카테고리 없음

Close idle connections

Close idle connections

Sometimes users abandon their connections to an application. To reclaim these resources for new and active clients, the server can close the idle clients.

A client is active when it is sending (e.g., publishing) or receiving (e.g., subscribing to) data. Elements in the Server.xml, Vhost.xml, and Application.xml configuration files specify how often the server should check for idle clients. When a client has been idle longer than the maximum idle time (10 minutes, by default), the server sends a status message to the NetConnection object (the client) with the code property set to NetConnection.Connect.Idle followed byNetConnection.Connect.Closed. The server closes the client connection to the server and writes an x-status code of 432 in the access log. The server also writes a message such as "Client x has been idle for y seconds" in the core and event logs.

To close idle connections, you must enable the feature in the Server.xml file. Once you enable the feature in the Server.xml file, you can disable the feature for individual virtual hosts or individual applications in the Vhost.xml files and Application.xml files. The values defined in the Server.xml configuration file apply to all clients connected to the server, unless the values are defined in the Vhost.xml file (the Vhost.xml values override the Server.xml values). The values defined in the Application.xml file override the values defined in the Vhost.xml file.

Enable closing idle connections

  1. Locate the following code in the Server.xml file:

    <AutoCloseIdleClients enable="false"> <CheckInterval>60</CheckInterval> <MaxIdleTime>600</MaxIdleTime> </AutoCloseIdleClients>

  2. Edit the following elements.

    Element

    Description

    Impact

    AutoCloseIdleClients

    Set the enable attribute to true to close idle clients. If the enable attribute is omitted or not set to true, the feature is disabled. The default value is false.

     

    CheckInterval

    Specifies the interval, in seconds, at which the server checks for active client connections. The default interval is 60 seconds.

    A client is disconnected the first time the server checks for idle connections if the client has exceeded the MaxIdleTime value. A shorter interval results in more reliable disconnection times, but can also result in decreased server performance.

    MaxIdleTime

    Specifies the maximum idle time allowed, in seconds, before a client is disconnected. If this element is 0 or less, the default idle time is used. The default idle time is 600 seconds (10 minutes).

    A low value may cause unneeded disconnections. When you configure this element, consider the type of applications running on the server. For example, if you have an application allowing users to watch short video clips, a user might leave the window to idle out.

Configure settings for virtual hosts

You can disable this feature for a virtual host or specify a different maximum idle time for a virtual host in the Vhost.xml file.

  1. Locate the following code in the Vhost.xml file and remove the comments:

    <VirtualHost> <AutoCloseIdleClients enable="false"> <MaxIdleTime>600</MaxIdleTime> </AutoCloseIdleClients> </VirtualHost>

  2. Edit the following elements.

    Element

    Description

    AutoCloseIdleClients

    Disable this feature for an individual virtual host by setting the enable attribute to false. If this element is disabled in Server.xml, the feature is disabled for all virtual hosts, even if you specify true in the Vhost.xml file.

    MaxIdleTime

    Specifies the maximum idle time allowed, in seconds, before a client is disconnected. The default idle time is 600 seconds (10 minutes). You can set a different value for each virtual host.

    If no value is set for this element, the server uses the value set in the Server.xml. file.

    The value of the MaxIdleTime element in the Vhost.xml file overrides the value of the MaxIdleTime element in the Server.xml file.

  3. Restart the server.

Configure settings for applications

You can disable this feature for an application or specify a different maximum idle time for an application in the Application.xml file.

  1. Locate the following code in the Application.xml file and remove the comments:

    <VirtualHost> <AutoCloseIdleClients enable="false"> <MaxIdleTime>600</MaxIdleTime> </AutoCloseIdleClients> </VirtualHost>

  2. Edit the following elements.

    Element

    Description

    AutoCloseIdleClients

    Disable this feature for an individual application by setting the enable attribute to false. If this element is disabled in Server.xml, the feature is disabled for all applications, even if you specify true in the Application.xml file.

    MaxIdleTime

    Specifies the maximum idle time allowed, in seconds, before a client is disconnected. The default idle time is 600 seconds (10 minutes). You can set a different value for each application.

    If no value is set for this element, the server uses the value set in the Vhost.xml. file. If no value is set for this element in the Vhost.xml file, the server uses the value in the Server.xml file.

    The value of the MaxIdleTime element in the Vhost.xml file overrides the value of the MaxIdleTime element in the Server.xml file.

  3. Restart the server.

copy from http://livedocs.adobe.com/flashmediaserver/3.0/docs/help.html?content=03_configtasks_18.html