| title | Server configuration options (SQL Server) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Find out how to manage and optimize SQL Server resources. View available configuration options, possible settings, default values, and restart requirements. | ||||||||||||||||
| author | rwestMSFT | ||||||||||||||||
| ms.author | randolphwest | ||||||||||||||||
| ms.reviewer | mikeray | ||||||||||||||||
| ms.date | 03/04/2024 | ||||||||||||||||
| ms.service | sql | ||||||||||||||||
| ms.subservice | configuration | ||||||||||||||||
| ms.topic | conceptual | ||||||||||||||||
| helpviewer_keywords |
|
||||||||||||||||
| keywords | server configuration (SQL Server) |
[!INCLUDE sql-asdbmi]
You can manage and optimize [!INCLUDE ssnoversion-md] and [!INCLUDE ssazuremi-md] resources through configuration options by using [!INCLUDE ssManStudioFull] or the sp_configure system stored procedure. The most commonly used server configuration options are available through [!INCLUDE ssManStudioFull]; all configuration options are accessible through sp_configure. Consider the effects on your system carefully before setting these options. For more information, see View or change server properties (SQL Server).
Important
Advanced options should be changed only by an experienced database administrator or certified SQL Server technician.
If you don't see the effect of a configuration change, it might not be installed. Check to see that the run_value of the configuration option has changed.
Configuration options take effect immediately after setting the option and issuing the RECONFIGURE (or in some cases, RECONFIGURE WITH OVERRIDE) statement. Reconfiguring certain options invalidates plans in the plan cache, causing new plans to be compiled. For more information, see DBCC FREEPROCCACHE (Transact-SQL).
You can use the sys.configurations catalog view to determine the config_value (the value column) and the run_value (the value_in_use column), and whether the configuration option requires a [!INCLUDE ssde-md] restart (the is_dynamic column).
If SQL Server needs to restart, options show the changed value only in the value column. After restart, the new value will appear in both the value column and the value_in_use column.
Some options require a server restart before the new configuration value takes effect. If you set the new value and run sp_configure before restarting the server, the new value appears in the value column of the sys.configurations catalog view, but not in the value_in_use column. When you restart the server, the new value appears in the value_in_use column.
Note
The config_value in the result set of sp_configure is equivalent to the value column of the sys.configurations catalog view, and the run_value is equivalent to the value_in_use column.
Self-configuring options are options that SQL Server adjusts according to the needs of the system. In most cases, this eliminates the need for setting the values manually. Examples include the max worker threads option and the user connections option.
The following query can be used to determine if any configured values haven't been installed:
SELECT *
FROM sys.configurations
WHERE [value] <> [value_in_use];If the value is the change for the configuration option you made but the value_in_use isn't the same, either the RECONFIGURE command wasn't run or has failed, or the [!INCLUDE ssde-md] must be restarted.
There are two configuration options where the value and value_in_use might not be the same, which is the expected behavior:
-
max server memory (MB) - The default configured value of
0displays as2147483647in thevalue_in_usecolumn. -
min server memory (MB) - The default configured value of
0might display as8on 32-bit systems, or16on 64-bit systems, in thevalue_in_usecolumn. In some cases, if thevalue_in_useshows as0, the truevalue_in_useis8(32-bit) or16(64-bit).
The is_dynamic column can be used to determine if the configuration option requires a restart. A value of 1 in the is_dynamic column means that, when the RECONFIGURE command is run, the new value takes effect immediately. In some cases, the [!INCLUDE ssde-md] might not evaluate the new value immediately, but does so in the normal course of its execution. A value of 0 in the is_dynamic column means that the changed configuration value doesn't take effect until the [!INCLUDE ssde-md] is restarted, even though the RECONFIGURE command was run.
For a configuration option that isn't dynamic there's no way to tell if the RECONFIGURE command has been run to apply the configuration change. Before you restart SQL Server to apply the configuration change, run the RECONFIGURE command to ensure all configuration changes will take effect when SQL Server next restarts.
The following table lists all available configuration options, the range of possible settings, the default values, and the supported product ([!INCLUDE ssnoversion-md] or [!INCLUDE ssazuremi-md]). Configuration options are marked with letter codes as follows:
-
A = Advanced options, which should be changed only by an experienced database administrator or a certified SQL Server professional, and which require setting
show advanced optionsto1. -
RR = Options requiring a restart of the [!INCLUDE ssDE].
-
RP = Options that require a restart of the PolyBase Engine.
-
SC = Self-configuring options.
Note
[!INCLUDEssSQL14] was the last version available on a 32-bit operating system.
| Configuration option | Possible values | SQL Server | Azure SQL Managed Instance |
|---|---|---|---|
| access check cache bucket count (A) | Minimum: 0Maximum: 16384Default: 0 |
Yes | Yes |
| access check cache quota (A) | Minimum: 0Maximum: 2147483647Default: 0 |
Yes | Yes |
| Ad Hoc Distributed Queries (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| ADR cleaner retry timeout (min) (A) | Minimum: 0Maximum: 32767Default: 120 |
[!INCLUDE sssql19-md] and later versions | Yes |
| ADR Preallocation Factor (A) | Minimum: 0Maximum: 32767Default: 4 |
[!INCLUDE sssql19-md] and later versions | Yes |
| affinity I/O mask (A, RR) | Minimum: -2147483648Maximum: 2147483647Default: 0 |
Yes (64-bit only) | No |
| affinity mask (A) | Minimum: -2147483648Maximum: 2147483647Default: 0 |
Yes (64-bit only) | Yes |
| affinity64 I/O mask (A, RR) | Minimum: -2147483648Maximum: 2147483647Default: 0 |
Yes (64-bit only) | Yes |
| affinity64 mask (A) | Minimum: -2147483648Maximum: 2147483647Default: 0 |
Yes (64-bit only) | No |
| Agent XPs (A) 1 | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| allow polybase export | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql16-md] and later versions | No |
| allow updates Warning: Obsolete. Don't use. Causes an error during reconfigure. |
Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| automatic soft-NUMA disabled (A, RR) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| backup checksum default | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| backup compression algorithm | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql22-md] and later versions | Yes |
| backup compression default | Minimum: 0Maximum: 1 (prior to [!INCLUDE sssql22-md]), or 2 ([!INCLUDE sssql22-md] and later versions)Default: 0 |
Yes | Yes |
| blocked process threshold (s) (A) | Minimum: 5Maximum: 86400Default: 0 |
Yes | Yes |
| c2 audit mode (A, RR) | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| clr enabled | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| clr strict security (A) | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql17-md] and later versions | Yes |
| column encryption enclave type (RR) | Minimum: 0Maximum: 2Default: 0 |
Yes | No |
| common criteria compliance enabled (A, RR) | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| contained database authentication | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| cost threshold for parallelism (A) | Minimum: 0Maximum: 32767Default: 5 |
Yes | Yes |
| cross db ownership chaining | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| cursor threshold (A) | Minimum: -1Maximum: 2147483647Default: -1 |
Yes | Yes |
| Database Mail XPs (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| default full-text language (A) | Minimum: 0Maximum: 2147483647Default: 1033 |
Yes | Yes |
| default language | Minimum: 0Maximum: 9999Default: 0 |
Yes | Yes |
| default trace enabled (A) | Minimum: 0Maximum: 1Default: 1 |
Yes | Yes |
| disallow results from triggers (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| EKM provider enabled (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| external scripts enabled (SC) | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql16-md] and later versions | Yes |
| filestream access level | Minimum: 0Maximum: 2Default: 0 |
Yes | No |
| fill factor (%) (A, RR) | Minimum: 0Maximum: 100Default: 0 |
Yes | No |
| ft crawl bandwidth (max) (A) | Minimum: 0Maximum: 32767Default: 100 |
Yes | Yes |
| ft crawl bandwidth (min) (A) | Minimum: 0Maximum: 32767Default: 0 |
Yes | Yes |
| ft notify bandwidth (max) (A) | Minimum: 0Maximum: 32767Default: 100 |
Yes | Yes |
| ft notify bandwidth (min) (A) | Minimum: 0Maximum: 32767Default: 0 |
Yes | Yes |
| hadoop connectivity (RP) | Minimum: 0Maximum: 7Default: 0 |
[!INCLUDE sssql16-md] and later versions | Yes |
| hardware offload enabled (A, RR) | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql22-md] and later versions | Yes |
| in-doubt xact resolution (A) | Minimum: 0Maximum: 2Default: 0 |
Yes | Yes |
| index create memory (KB) (A, SC) | Minimum: 704Maximum: 2147483647Default: 0 |
Yes | Yes |
| lightweight pooling (A, RR) | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| locks (A, RR, SC) | Minimum: 5000Maximum: 2147483647Default: 0 |
Yes | No |
| max degree of parallelism (A) | Minimum: 0Maximum: 32767Default: 0 |
Yes | No |
| max full-text crawl range (A) | Minimum: 0Maximum: 256Default: 4 |
Yes | Yes |
| max server memory (MB) (A, SC) | Minimum: 16Maximum: 2147483647Default: 2147483647 |
Yes | Yes |
| max text repl size (B) | Minimum: 0Maximum: 2147483647Default: 65536 |
Yes | Yes |
| max worker threads (A) 2 | Minimum: 128Maximum: 32767Default: 02048 is the recommended maximum for 64-bit SQL Server (1024 for 32-bit) |
Yes | Yes |
| media retention (A) | Minimum: 0Maximum: 365Default: 0 |
Yes | No |
| min memory per query (KB) (A) | Minimum: 512Maximum: 2147483647Default: 1024 |
Yes | No |
| min server memory (MB) (A, SC) | Minimum: 0Maximum: 2147483647Default: 0 |
Yes | No |
| nested triggers | Minimum: 0Maximum: 1Default: 1 |
Yes | Yes |
| network packet size (B) (A) | Minimum: 512Maximum: 32767Default: 4096 |
Yes | Yes |
| Ole Automation Procedures (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| open objects (A, RR) Warning: Obsolete. Don't use. |
Minimum: 0Maximum: 2147483647Default: 0 |
Yes | No |
| optimize for ad hoc workloads (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| PH timeout (A) | Minimum: 1Maximum: 3600Default: 60 |
Yes | Yes |
| polybase enabled | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql19-md] and later versions | No |
| polybase network encryption | Minimum: 0Maximum: 1Default: 1 |
Yes | Yes |
| precompute rank (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| priority boost (A, RR) | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| query governor cost limit (A) | Minimum: 0Maximum: 2147483647Default: 0 |
Yes | Yes |
| query wait (s) (A) | Minimum: -1Maximum: 2147483647Default: -1 |
Yes | Yes |
| recovery interval (min) (A, SC) | Minimum: 0Maximum: 32767Default: 0 |
Yes | Yes |
| remote access (RR) | Minimum: 0Maximum: 1Default: 1 |
Yes | No |
| remote admin connections | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| remote data archive | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| remote login timeout (s) | Minimum: 0Maximum: 2147483647Default: 10 |
Yes | Yes |
| remote proc trans | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| remote query timeout (s) | Minimum: 0Maximum: 2147483647Default: 600 |
Yes | Yes |
| Replication XPs (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| scan for startup procs (A, RR) | Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| server trigger recursion | Minimum: 0Maximum: 1Default: 1 |
Yes | Yes |
| set working set size (A, RR) Warning: Obsolete. Don't use. |
Minimum: 0Maximum: 1Default: 0 |
Yes | No |
| show advanced options | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| SMO and DMO XPs (A) | Minimum: 0Maximum: 1Default: 1 |
Yes | Yes |
| suppress recovery model errors (A) | Minimum: 0Maximum: 1Default: 0 |
No | Yes |
| tempdb metadata memory-optimized (A, RR) | Minimum: 0Maximum: 1Default: 0 |
[!INCLUDE sssql19-md] and later versions | No |
| transform noise words (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
| two digit year cutoff (A) | Minimum: 1753Maximum: 9999Default: 2049 |
Yes | Yes |
| user connections (A, RR, SC) | Minimum: 0Maximum: 32767Default: 0 |
Yes | No |
| user options | Minimum: 0Maximum: 32767Default: 0 |
Yes | Yes |
| xp_cmdshell (A) | Minimum: 0Maximum: 1Default: 0 |
Yes | Yes |
1 Changes to 1 when SQL Server Agent is started. Default value is 0 if SQL Server Agent is set to automatic start during Setup.
2 Zero (0) autoconfigures the number of max worker threads depending on the number of logical processors. For more information, see the automatically configured number of max worker threads.