AOLserver Tuning Configuration Parameters

The following table is a definitive reference of key AOLserver tuning configuration parameter changes from version 4.0 to 4.5.x.  Items highlighted in red are possible bugs, known issues or items incorrectly documented elsewhere.  Items highlighted in blue refer to configuration settings made possible by our modified pools.tcl file.

Setting Description AOLserver 4.0 AOLserver 4.5.x
Section Parameter Default Section Parameter Default
Thread Stack Size (bytes) ns/threads OR ns/parameters stacksize 128k ns/threads OR ns/parameters stacksize 128k
stacksize can also be set in ns/parameters but ns/threads setting will override. Ancient versions of AOLserver only needed this to be explicitly set on certain platforms and otherwise used the OS default, which under Windows, for example, is 1MB, so the default AOLserver setting in current versions is quite low for deeply-nested Tcl code.  Note that stacksize must be a multiple of 8k for AOLserver to run under MacOS X.  With RFE 975809 patch, stacksize can be set to 0 to make the OS manage the stack size.  NaviServer's default is let the OS manage it.
Maximum Number of Keepalive Connections ns/parameters maxkeepalive 100 ns/parameters maxkeepalive 100
In prior versions of AOLserver this may have been under ns/servers/$server.  In AOLserver 4.0 and newer, this setting exists but appears to be non-operational
Keepalive Enable/Disable ns/parameters keepalivetimeout 30 ns/parameters keepalivetimeout 30
In prior versions of AOLserver this may have been under ns/servers/$server.  Set to 0 to disable Keep-alive support, any other value will enable Keep-alive but won't actually configure the timeout, which is now configured under the driver (see below).
Minimum Number of Connection Servicing Threads ns/servers/$server AND
ns/servers/$server/pool/$pool
minthreads 0 ns/servers/$server via ns_pools and pools.tcl but really process-wide minthreads 0
In prior versions of AOLserver, this was strictly per virtual server.  In AOLserver 4.0 and later, there is the concept of separate connection thread pools for certain mapped URLs, so this can be configured either at the server level for the default pool or for a specific pool.  Once AOLserver reaches this number of connection threads, threads will be destroyed after an idle timeout (see below).  But once reached, the number of threads will never drop below this limit even after the idle timeout.
Maximum Number of Connection Servicing Threads ns/servers/$server AND
ns/servers/$server/pool/$pool
maxthreads 10 ns/servers/$server via ns_pools and pools.tcl but really process-wide maxthreads 10
In prior versions of AOLserver, this was strictly per virtual server.  In AOLserver 4.0 and later, there is the concept of separate connection thread pools for certain mapped URLs, so this can be configured either at the server level for the default pool or for a specific pool.  In AOLserver 4.0 if you set this above 100, you have to set MaxConnections to the same number (see below). In AOLserver 4.5, if the sum of maxthreads for all the pools used in a particular virtual server exceeds 100, and you actually want this virtual server to have more than 100 connections, you have to set the MaxSock setting to this sum plus MaxWait plus MaxBusyThreads under the driver (see below; our default nsd.tcl sets maxsock to 250 or twice the server-level maxthreads value if it's over 125).  Note that the default pool in AOLserver 4.5 is now process-wide (shared by all virtual servers) and the maxthreads setting in the last virtual server processed at startup by pools.tcl will override any other setting.  In addition, in AOLserver 4.5 there is a default ns_limits -maxrun option defaulting to 100, which you will have to increase as well to support more concurrent threads than 100 (AM-modified pools.tcl will set the default -maxrun limit to maxthreads).  Finally, you need to have enough concurrent connections in your database pools configuration.
Maximum Number of Connections Waiting to be Serviced ns/servers/$server via ns_pools and AM-modified pools.tcl but really process-wide MaxWait 100
This setting existed in AOLserver 2.x and was removed in 3.x - 4.0 as those versions did not support waiting connections.  The functionality is back in AOLserver 4.5 via limits.  This setting is implemented by AM-modified pools.tcl by calling ns_limits set default -maxwait.  Any additional connections as well as any connections that have been waiting for more than MaxWaitTime are served with a 503 Error from the Busy Error thread pool.
Maximum Time for Connection to Wait to be Serviced ns/servers/$server via ns_pools and AM-modified pools.tcl but really process-wide MaxWaitTime 60
This setting is new to AOLserver 4.5 via limits and is implemented by AM-modified pools.tcl by calling ns_limits set default -timeout. Connections that have been waiting for more than MaxWaitTime seconds are served with a 503 Error from the Busy Error thread pool.  The default of 60 seconds is a bit high - most clients will not wait this long.  Note that the documentation for ns_limits -timeout option was incorrect - it's not the maximum time to 'run' (i.e. service) the connection, it's the maximum time to wait to be run before being overflown to the error pool.
Min/Max Number of Threads for returning Busy Errors ns/servers/$server via ns_pools and AM-modified pools.tcl but really process-wide MinBusyThreads
MaxBusyThreads
0
10
These settings existed in AOLserver 2.x and were removed in 3.x - 4.0 as those versions did not support returning busy errors (they just let the OS backlog and then refuse connnections).  The functionality is back in AOLserver 4.5 via the error pool and limits.  These settings are implemented by AM-modified pools.tcl by calling ns_pools set error -minthreads and -maxthreads.  Note that in 2.x, you could set MaxBusyThreads to 0 and the waiting queue (as well as the entire busy error response mechanism) would be disabled.  This does not appear to be possible in 4.5.  To emulate the functionality, set MaxSock (see below) to the same value as MaxThreads and then the driver will simply never accept enough connections to let them queue up and wait.
Idle Thread Timeout ns/servers/$server AND
ns/servers/$server/pool/$pool
threadtimeout 120 ns/servers/$server via ns_pools and pools.tcl but really process-wide threadtimeout 0
In prior versions of AOLserver, this was strictly per virtual server.  In AOLserver 4.0 and later, there is the concept of separate connection thread pools for certain mapped URLs, so this can be configured either at the server level for the default pool or for a specific pool.  Idle connection threads will be destroyed after this timeout (in seconds).  In the past a setting of 0 was unsupported and under Windows having threads with tcl interpreters destroyed causes instability in AOLserver 3.2 - 4.0 and substantial leaking of memory in AOLserver 4.5, so we typically have this set to 1000000.  Note that C-level default in AOLserver 4.5 is still 120 seconds but pools.tcl from 4.5.1 overrides this and sets the default to 0 for the default thread pool but not for the error thread pool.  AM-modified pools.tcl applies this setting to both the default and error thread pools for consistency.
Maximum Number of Serviced Connections per Thread ns/servers/$server AND
ns/servers/$server/pool/$pool
connsperthread 0 ns/servers/$server via ns_pools and pools.tcl but really process-wide maxconnections but
should be maxconns
0
In prior versions of AOLserver, this was strictly per virtual server.  In AOLserver 4.0 and later, there is the concept of separate connection thread pools for certain mapped URLs, so this can be configured either at the server level for the default pool or for a specific pool.  This is one of two most mis-documented and mis-treated configuration parameters in AOLserver (the other is MaxConnections)!  It does NOT mean how many conns a single thread can have at the same time.  Instead, it specifies that after the specified number of serviced connections, a connection thread will be destroyed. This parameter is useful for working around memory leaks in Tcl code in theory but on Windows, thread destruction causes instability in AOLserver 3.2 - 4.0 and substantial leaking of memory in AOLserver 4.5, so we never use this setting.  In AOLserver 4.5, the creation of the default pool with various thread configuration parameters was moved from server.c to pools.tcl.  Initial revision of pools.tcl used a maxconns parameter which wasn't backward compatible but at least made sense because it matched the ns_pools -maxconns option.  Since revision 1.2 pools.tcl incorrectly uses maxconnections for supposed backward compability, only maxconnections means something totally else (see below).  AM-modified pool.tcl uses maxconns but falls back to ConnsPerThread for backward compatibility.
Maximum Number of Driver Sockets/Connections ns/servers/$server AND
ns/servers/$server/pool/$pool
maxconnections 100 ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
maxsock 100
In prior versions of AOLserver, this was strictly per virtual server.  In AOLserver 4.0, this can be configured either at the server level for the default connection thread pool or for a specific pool.  This is one of two most mis-documented and mis-treated configuration parameters in AOLserver (the other is ConnsPerThread)!  It does NOT mean how many connections a thread can service before exiting.  Instead, it serves to pre-allocate the specified quantity of Conn structures in AOLserver 4.0 and earlier and Sock structures in AOLserver 4.5 and thus specifies the upper bound of concurrent threads in the entire virtual server (pre-4.0), pool (4.0), or for the particular driver (4.5).  In general, this should be equal to at least the sum of all the maxthread settings of all your pools.  To make it clear, MaxConnections parameter no longer exists in 4.5 and the ns_pools -maxconns option is equivalent to ConnsPerThread, not MaxConnections.
Listen BackLog ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
backlog 5 ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
backlog 5
The maximum number of connections waiting to be serviced. The operating system will refuse any additional connections.  This waiting number is over and above the maximum number of concurrent connections being serviced or waiting to be serviced by AOLserver (see above).  Set this and MaxBusyThreads to zero if you want immediate refusal of excessive connections, which may result in a faster failover to an alternate server.  Note that there is also a listenbacklog parameter in ns/parameters with a default of 32 but it's overriden by the driver-level backlog or its default.
Keepalive Timeout ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
keepwait 30 ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
keepwait 30
Number of seconds after which to hang up on clients while waiting for an HTTP request in a connection: keep-alive situation.
Socket Timeout ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
socktimeout 30 ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
socktimeout 30
Number of seconds to wait for an HTTP request before closing the connection.  Increase this to 5 minutes to allow large files to be successfully uploaded.
Maximum Size of data sent from the Browser ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
maxinput 1 MB ns_limits
(or nssock maxinput via AM-modified pool.tcl)
maxupload 10 MB
This setting is new to AOLserver 4.0 - any data in excess of this size (in bytes) is refused (reportedly browser keeps spinning and the connection never completes - see SF Bug # 1008853).  In AOLserver 4.5, the driver maxinput setting only specifies the maximum size before AOLserver starts spooling additional content to a temporary file (NaviServer has equivalent functionality with parameter named maxupload, except it's ignored on Windows) and the overall maximum size of uploaded data is controlled with ns_limits maxupload option.  For backward compatibility, AM-modified pools.tcl sets the default -maxupload to the nssock maxinput parameter.  Currently, in AOLserver 4.5.1 the temp file spooling does not work on Windows.
Maximum Amount of Data in a non multi-part form post ns/servers/$server maxpost 256k
The maximum size in bytes of an HTTP POST accessed through the Ns_ConnGetQuery function (in C) or the ns_conn form function (in Tcl).  This setting no longer exists in AOLserver 4.5 or NaviServer.  It may have also been non-functional in AOLserver 4.0 due to a bug in driver.c.
Maximum Amount of Data in request line & all headers ns/servers/$server maxheaders 64k ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
maxheader 32k
The maximum number of bytes for all HTTP header lines in a request. Note that in AOLserver 4.5, maxheader is now singular, not plural but actually isn't used in connio.c Ns_ConnReadHeaders, which uses maxline instead - this may be a bug.
Maximum Length of request or header line ns/servers/$server maxline 16k ns/server/$server/module/nssock AND
ns/server/$server/module/nsopenssl
/ssldriver/nsopenssl
maxline 4k
The maximum number of bytes for the HTTP request or header line.

Tuning Config Params | ODBC/SQL Server Setup | ns_column | ns_table | ns_radius
 

© Copyright 1996-2014 by am.net and Solitex Networks. Legal Notices.
Creative Commons License Articles on this site are licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.