| title | CREATE EXTERNAL RESOURCE POOL (Transact-SQL) | Microsoft Docs | ||||||
|---|---|---|---|---|---|---|---|
| ms.custom | |||||||
| ms.date | 11/13/2017 | ||||||
| ms.prod | sql | ||||||
| ms.prod_service | sql-database | ||||||
| ms.component | t-sql|statements | ||||||
| ms.reviewer | |||||||
| ms.suite | sql | ||||||
| ms.technology | t-sql | ||||||
| ms.tgt_pltfrm | |||||||
| ms.topic | language-reference | ||||||
| f1_keywords |
|
||||||
| dev_langs |
|
||||||
| helpviewer_keywords |
|
||||||
| ms.assetid | 8cc798ad-c395-461c-b7ff-8c561c098808 | ||||||
| caps.latest.revision | 12 | ||||||
| author | jeannt | ||||||
| ms.author | edmaca | ||||||
| manager | craigg |
[!INCLUDEtsql-appliesto-ss2016-xxxx-xxxx-xxx-md] Applies to: [!INCLUDEsssql15-md] [!INCLUDErsql-productname-md] and [!INCLUDEsssql17-md] [!INCLUDErsql-productnamenew-md]
Creates an external pool used to define resources for external processes. A resource pool represents a subset of the physical resources (memory and CPUs) of an instance of the Database Engine. Resource Governor enables a database administrator to distribute server resources among resource pools, up to a maximum of 64 pools.
-
For [!INCLUDErsql-productname-md] in [!INCLUDEsssql15-md], the external pool governs
rterm.exe,BxlServer.exe, and other processes spawned by them. -
For [!INCLUDErsql-productnamenew-md] in [!INCLUDEsssql17-md], the external pool governs the R processes listed for SQL Server 2016, as well as
python.exe,BxlServer.exe, and other processes spawned by them.
Transact-SQL Syntax Conventions.
CREATE EXTERNAL RESOURCE POOL pool_name
[ WITH (
[ MAX_CPU_PERCENT = value ]
[ [ , ] AFFINITY CPU =
{
AUTO
| ( <cpu_range_spec> )
| NUMANODE = ( <NUMA_node_id> )
} ]
[ [ , ] MAX_MEMORY_PERCENT = value ]
[ [ , ] MAX_PROCESSES = value ]
)
]
[ ; ]
<CPU_range_spec> ::=
{ CPU_ID | CPU_ID TO CPU_ID } [ ,...n ]
pool_name
Is the user-defined name for the external resource pool. pool_name is alphanumeric, can be up to 128 characters, must be unique within an instance of [!INCLUDEssNoVersion], and must comply with the rules for identifiers.
MAX_CPU_PERCENT =value
Specifies the maximum average CPU bandwidth that all requests in the external resource pool can receive when there is CPU contention. value is an integer with a default setting of 100. The allowed range for value is from 1 through 100.
AFFINITY {CPU = AUTO | ( <CPU_range_spec> ) | NUMANODE = (<NUMA_node_range_spec>)} Attach the external resource pool to specific CPUs. The default value is AUTO.
AFFINITY CPU = ( <CPU_range_spec> ) maps the external resource pool to the [!INCLUDEssNoVersion] CPUs identified by the given CPU_IDs.
When you use AFFINITY NUMANODE = ( <NUMA_node_range_spec> ), the external resource pool is affinitized to the [!INCLUDEssNoVersion] physical CPUs that correspond to the given NUMA node or range of nodes.
MAX_MEMORY_PERCENT =value
Specifies the total server memory that can be used by requests in this external resource pool. value is an integer with a default setting of 100. The allowed range for value is from 1 through 100.
MAX_PROCESSES =value
Specifies the maximum number of processes allowed for the external resource pool. Specify 0 to set an unlimited threshold for the pool, which is thereafter bound only by computer resources. The default is 0.
The [!INCLUDEssDE] implements the resource pool when you execute the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
For general information about resource pools, see Resource Governor Resource Pool, sys.resource_governor_external_resource_pools (Transact-SQL), and sys.dm_resource_governor_external_resource_pool_affinity (Transact-SQL).
For information specific to managing external resource pools used for machine learning, see Resource governance for machine learning in SQL Server.
Requires CONTROL SERVER permission.
The following statement defines an external pool that restricts CPU usage to 75 percent and the maximum memory to 30 percent of the available memory on the computer.
CREATE EXTERNAL RESOURCE POOL ep_1
WITH (
MAX_CPU_PERCENT = 75
, AFFINITY CPU = AUTO
, MAX_MEMORY_PERCENT = 30
);
GO
ALTER RESOURCE GOVERNOR RECONFIGURE;
GOexternal scripts enabled Server Configuration Option
sp_execute_external_script (Transact-SQL)
ALTER EXTERNAL RESOURCE POOL (Transact-SQL)
DROP EXTERNAL RESOURCE POOL (Transact-SQL)
CREATE RESOURCE POOL (Transact-SQL)
CREATE WORKLOAD GROUP (Transact-SQL)
Resource Governor Resource Pool
sys.resource_governor_external_resource_pools (Transact-SQL)
sys.dm_resource_governor_external_resource_pool_affinity (Transact-SQL)
ALTER RESOURCE GOVERNOR (Transact-SQL)