Timeouts have a significant impact on server performance. Setting the optimal timeout for the Proxy Server helps to conserve network resources.
Two instance-specific SAFs (server application functions) and one global parameter can be used to configure timeout values within the Proxy Server:
The init-proxy() function initializes the Proxy Server’s internal settings. This function is called during the initialization of the Proxy Server, but should also be specified in the obj.conf file to ensure that the values are initialized properly.
The syntax of this function is as follows:
Init fn=init-proxy timeout=seconds timeout-2=seconds
In the previous example, the following parameters have direct applicability to Proxy Server timeout settings for the init-proxy SAF:
timeout (proxy timeout)– The proxy timeout parameter tells the server how long to wait before quitting an idle connection. A high proxy timeout value commits a valuable proxy thread to a potentially down client for a long time. A low timeout value quits CGI scripts that take a long time to produce results, such as a database query gateway.
To determine the best proxy timeout for the server, consider these issues:
Will the Proxy Server be handling many database queries or CGI scripts?
Will the Proxy Server be handling a small enough number of requests that a process can be spared at any given time?
If you answered yes to either of these questions, you might decide to set a high proxy timeout value. The highest proxy timeout value recommended is 1 hour. The default value is 300 seconds (5 minutes).
You can view or modify the proxy timeout value by accessing the Configure System Preferences page under the Preferences tab in the Server Manager. This parameter is referenced as Proxy Timeout.
timeout-2 (timeout after interrupt)– The timeout after interrupt value tells the Proxy Server how much time to continue writing a cache file after a client has quit the transaction. In other words, if the Proxy Server has almost finished caching a document and the client quits the connection, the server can continue caching the document until it reaches the timeout after interrupt value.
The highest recommended timeout after interrupt value is 5 minutes. The default value is 15 seconds.
The http-client-config function configures the Proxy Server’s HTTP client.
The syntax of this function is as follows:
Init fn=http-client-config keep-alive=(true|false) keep-alive-timeout=seconds always-use-keep-alive=(true|false) protocol=HTTP Protocol proxy-agent="Proxy-agent HTTP request header"
The settings are:
keep-alive– (Optional) Boolean that indicates whether the HTTP client should attempt to use persistent connections. The default is true.
keep-alive-timeout– (Optional) The maximum number of seconds to keep a persistent connection open. The default is 29.
always-use-keep-alive– (Optional) Boolean that indicates whether the HTTP client can reuse existing persistent connections for all types of requests. The default is false, meaning persistent connections will not be reused for non-GET requests or for requests with a body.
protocol– (Optional) HTTP protocol version string. By default, the HTTP client uses either HTTP/1.0 or HTTP/1.1, based on the contents of the HTTP request. Do not use the protocol parameter unless you encounter specific protocol interoperability problems.
proxy-agent– (Optional) Value of the Proxy-agent HTTP request header. The default is a string that contains the Proxy Server product name and version.
KeepAliveTimeout() parameter determines the maximum time (in seconds) that the server holds open HTTP keep-alive connections or persistent connections between the client and the Proxy Server. The default is 30 seconds. The connection times out if idle for more than 30 seconds. The maximum is 300 seconds (5 minutes).
Timeout settings in the magnus.conf file apply to connections between the client and the Proxy Server. Timeout settings in the http-client-config SAF in the obj.conf file apply to connections between the Proxy Server and an origin server.