number of user connections

Summary information

Default value

25

Range of values

5–2147483647

Status

Dynamic

Display level

Basic

Required role

System Administrator

number of user connections sets the maximum number of user connections that can be connected to Adaptive Server at the same time. It does not refer to the maximum number of processes; that number depends not only on the value of this parameter but also on other system activity.

Upper limit to the maximum number of user connections

The maximum allowable number of file descriptors per process is operating-system-dependent; see the configuration documentation for your platform.

The number of file descriptors available for Adaptive Server connections is stored in the global variable @@max_connections. You can report the maximum number of file descriptors your system can use with:

select @@max_connections 

The return value represents the maximum number of file descriptors allowed by the system for your processes, minus overhead. Overhead increases with the number of engines. For more information on how multiprocessing affects the number file descriptors available for Adaptive Server connections, see “Managing user connections”.

In addition, you must reserve a number of connections for the following items, which you also set with configuration parameters:

The following formula determines how high you can set number of user connections, number of devices, max online engines, number of remote sites, and max number network listeners:

number of user connections + (number of devices * max online engines * 2) + number of remote sites + max number network listeners cannot be greater than the value of @@max_connections.

Reserved connections

One connection from of the configured number of connections is reserved for temporary administrative tasks to make sure that database administrators can connect to Adaptive Server if they need to increase the number of user connections and there are no free connections. A reserved connection is allocated only to a user who has the sa_role and has a total login time of 15 minutes. After this, Adaptive Server terminates the connection to ensure the availability of the reserved connection at an installation wth multiple database administrators.

Adaptive Server uses this reserved connection automatically when a client uses the last resource for connecting to Adaptive Server.

If Adaptive Server is using a reserved connection, the following informational message is displayed when the user logs onto Adaptive Server:

There are not enough user connections available; you are being connected using a temporary administrative connection which will time out after '15' minutes. Increase the value of th 'number of user connections' parameter

Adaptive Server also prints a message similar to the following to the errorlog when the final connnection to Adaptive Server terminates due to a timeout:

00:00000:00008:2003/03/14 11:25:31.36 server  Process '16' has been terminated as it exceeded the maximum login time allowed for such processes. This process used a connection reserved for system administrators and has a maximum login period of '15' minutes

Optimizing the value of the max number of user connections parameter

There is no formula for determining how many connections to allow for each user. You must estimate this number, based on the system and user requirements described here. You must also take into account that on a system with many users, there is more likelihood that connections needed only occasionally or transiently can be shared among users. The following processes require user connections:

Certain other configuration parameters, including stack size and default network packet size, affect the amount of memory for each user connection.

User connections for shared memory

Adaptive Server uses the value of the number of user connections parameter to establish the number of shared-memory connections for EJB Server. Thus, if number of user connections is 30, Adaptive Server establishes 10 shared-memory connections for EJB Server. Shared-memory connections are not a subset of user connections, and are not subtracted from the number of user connections.

To increase the number of user connections for shared memory, you must:

  1. Increase number of user connections to a number one-third of which is the number of desired shared-memory connections.

  2. Restart Adaptive Server.

Although number of user connections is a dynamic configuration parameter, you must restart the server to change the number of user connections for shared memory. See the EJB Server User’s Guide for more information.