
27
FLASH
MEDIA
SERVER
4.5
CONFIGURATION
AND
ADMINISTRATION
Configuring the server
Last updated 11/28/2012
2
Validate the XML and save the XML file.
3
Restart the server.
Close idle connections
Sometimes clients have left an application without the server-end of the socket knowing. This behavior can happen
when a router is unplugged or crashes without sending TCP close messages for the sockets it is managing, when a
laptop is undocked from a docking station, and so on. To reclaim these resources for new and active clients, the server
can close the idle clients.
Flash Media Server sends a small ping message over sockets that have been quiet for awhile. If the client at the far end
has gone away, the server's TCP eventually stops retransmitting that data. When that happens, the socket is shut down
and the server can clean up any associated client object, and so on.
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 by
NetConnection.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, 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
MaxConnectionRate
The maximum number of incoming connections
per second the server accepts, per listener.
Listeners are defined in the
HostPort
element in
the Adaptor.xml file. Each port the server is
configured to listen on represents a listener. You
can set a fractional maximum connection rate, such
as 12.5. A value of 0 or -1 disables this feature.
The value of this element is a global setting for all
listeners. If the element is set to 10 connections per
second, each listener has a limit of 10 connections
per second. If there are three listeners and the
MaxConnectionRate
is set to 10, the server
imposes a maximum total combined rate of 30
connections per second.
Connections requested at a rate above this
value remain in the TCP/IP socket queue and
are silently discarded by the operating system
whenever the queue becomes too long.