Skip to content

Latest commit

 

History

History
106 lines (71 loc) · 6.7 KB

File metadata and controls

106 lines (71 loc) · 6.7 KB
title Configure the user connections Server Configuration Option | Microsoft Docs
description Find out about the "user connections" option. See how it can help you avoid overloading an instance of SQL Server with too many concurrent connections.
ms.custom
ms.date 03/02/2017
ms.prod sql
ms.prod_service high-availability
ms.reviewer
ms.technology configuration
ms.topic conceptual
helpviewer_keywords
simultaneous connections [SQL Server]
user connections option [SQL Server]
users [SQL Server], simultaneous connections
maximum number of simultaneous user connections
connections [SQL Server], simultaneous
ms.assetid 53beee6e-59fe-4276-9abb-8f1cec2a3508
author markingmyname
ms.author maghan

Configure the user connections Server Configuration Option

[!INCLUDE SQL Server]

This topic describes how to set the user connections server configuration option in [!INCLUDEssCurrent] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql]. The user connections option specifies the maximum number of simultaneous user connections that are allowed on an instance of [!INCLUDEssNoVersion]. The actual number of user connections allowed also depends on the version of [!INCLUDEssNoVersion] that you are using, and also the limits of your application or applications and hardware. [!INCLUDEssNoVersion] allows a maximum of 32,767 user connections. Because user connections is a dynamic (self-configuring) option, [!INCLUDEssNoVersion] adjusts the maximum number of user connections automatically as needed, up to the maximum value allowable. For example, if only 10 users are logged in, 10 user connection objects are allocated. In most cases, you do not have to change the value for this option. The default is 0, which means that the maximum (32,767) user connections are allowed.

To determine the maximum number of user connections that your system allows, you can execute sp_configure or query the sys.configuration catalog view.

In This Topic

Before You Begin

Recommendations

  • This option is an advanced option and should be changed only by an experienced database administrator or certified [!INCLUDEssNoVersion] professional.

  • Using the user connections option helps avoid overloading the server with too many concurrent connections. You can estimate the number of connections based on system and user requirements. For example, on a system with many users, each user would not usually require a unique connection. Connections can be shared among users. Users running OLE DB applications need a connection for each open connection object, users running Open Database Connectivity (ODBC) applications need a connection for each active connection handle in the application, and users running DB-Library applications need one connection for each process started that calls the DB-Library dbopen function.

    [!IMPORTANT]
    If you must use this option, do not set the value too high, because each connection has overhead regardless of whether the connection is being used. If you exceed the maximum number of user connections, you receive an error message and are not able to connect until another connection becomes available.

Security

Permissions

Execute permissions on sp_configure with no parameters or with only the first parameter are granted to all users by default. To execute sp_configure with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. The ALTER SETTINGS permission is implicitly held by the sysadmin and serveradmin fixed server roles.

Using SQL Server Management Studio

To configure the user connections option

  1. In Object Explorer, right-click a server and click Properties.

  2. Click the Connections node.

  3. Under Connections, in the Max number of concurrent connections box, type or select a value from 0 through 32767 to set the maximum number of users that are allowed to connect simultaneously to the instance of [!INCLUDEssNoVersion].

  4. Restart [!INCLUDEssNoVersion].

Using Transact-SQL

To configure the user connections option

  1. Connect to the [!INCLUDEssDE].

  2. From the Standard bar, click New Query.

  3. Copy and paste the following example into the query window and click Execute. This example shows how to use sp_configure to configure the value of the user connections option to 325 users.

USE AdventureWorks2012 ;  
GO  
EXEC sp_configure 'show advanced options', 1;  
GO  
RECONFIGURE ;  
GO  
EXEC sp_configure 'user connections', 325 ;  
GO  
RECONFIGURE;  
GO  
  

For more information, see Server Configuration Options (SQL Server).

Follow Up: After you configure the user connections option

The SQL instance must be restarted before the setting can take effect.

See Also

RECONFIGURE (Transact-SQL)
Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)