You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One pain point with R is that analyzing large amounts of data in production requires additional hardware, and data is often moved outside the database to computers not controlled by IT. To perform advanced analytics operations, customers want to leverage database server resources, and to protect their data, they require that such operations meet enterprise-level compliance requirements, such as security and performance.
21
-
22
-
This section provides information about how you can manage resources used by the R runtime and by R jobs running using the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance as the compute context.
23
-
24
-
## What is Resource Governance?
25
-
Resource governance is designed to identify and prevent problems that are common in a database server environment, where there are often multiple dependent applications and multiple services to support and balance. For [!INCLUDE[rsql_productname](../../includes/rsql-productname-md.md)], resource governance involves these tasks:
26
-
27
-
- Identifying scripts that use excessive server resources.
21
+
# Resource governance for machine learning in SQL Server
22
+
23
+
This article provides an overview of resource governance features in SQL Server that help allocate and balance resources used by R and Python scripts.
[!INCLUDE[rsql-productnamenew-md](../../includes/rsql-productnamenew-md.md)] and [!INCLUDE[sssql15-md](../../includes/sssql15-md.md)][!INCLUDE[rsql-productname-md](../../includes/rsql-productname-md.md)]
27
+
28
+
## Goals of resource governance for machine learning
29
+
30
+
One known pain point with machine learning languages such as R and Python is that data is often moved outside the database to computers not controlled by IT. Another is that R is single-threaded, meaning that you can only work with the data available in memory.
31
+
32
+
SQL Server Machine Learning Services alleviates both these problems, and helps meet enterprise-level compliance requirements. It keeps advanced analytics inside the database, and supports increased performance over large datasets through features such as streaming and chunking operations. However, moving R and Python computations inside the databases can affect the performance of other services that use the database, including regular user quesries, external applications, and scheduled database jobs.
33
+
34
+
This section provides information about how you can manage resources used by external runtimes, such as R and Python, to mitigate impact on other core database services. A database server environment typically is the hub for multiple dependent applications and services.
35
+
36
+
You can use [Resource Governor](../../relational-databases/resource-governor/resource-governor.md) to manage the resources used by the external runtimes for R and Python. For machine learning, resource governance involves these tasks:
37
+
38
+
+ Identifying scripts that use excessive server resources.
28
39
29
40
The administrator needs to be able to terminate or throttle jobs that are consuming too many resources.
30
41
31
-
- Mitigating unpredictable workloads.
42
+
+ Mitigating unpredictable workloads.
32
43
33
-
For example, if multiple R jobs are running concurrently on the server and the jobs are not isolated from each other by using resource pools, the resulting resource contention could lead to unpredictable performance or threaten completion of the workload.
44
+
For example, if multiple machine learning jobs are running concurrently on the server, the resulting resource contention could lead to unpredictable performance or threaten completion of the workload. However, if resource pools are used, the jobs can be isolated from each other.
34
45
35
46
- Prioritizing workloads.
36
47
37
-
The administrator or architect needs to be able to specify workloads that must take precedence, or guarantee certain workloads to complete if there is resource contention.
38
-
39
-
In [!INCLUDE[rsql_productname](../../includes/rsql-productname-md.md)], you can use [Resource Governor](../../relational-databases/resource-governor/resource-governor.md) to manage the resources used by the R runtime and by remote R jobs.
40
-
41
-
## How to Use Resource Governor to Manage R jobs
42
-
In general, you manage resources allocated to R jobs by creating *external resource pools* and assigning workloads to the pool or pools. An external resource pool is a new type of resource pool introduced in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)], to help manage the R runtime and other processes external to the database engine.
43
-
44
-
In [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)], there are now three types of default resource pools .
48
+
The administrator or architect needs to be able to specify workloads that must take precedence, or guarantee certain workloads to complete if there is resource contention.
49
+
50
+
## How to use Resource Governor to manage machine learning
51
+
52
+
You manage resources allocated to R or Python sessions by creating an *external resource pool*, and assigning workloads to the pool or pools. An external resource pool is a new type of resource pool introduced in [!INCLUDE[sssql15-md](../../includes/sssql15-md.md)] to help manage the R runtime and other processes external to the database engine.
53
+
54
+
SQL Server supports three types of default resource pools:
45
55
46
-
- The *internal pool* represents the resources used by the SQL Server itself and cannot be altered or restricted.
56
+
- The *internal pool* represents the resources used by the SQL Server itself and cannot be altered or restricted.
47
57
48
-
- The *default pool* is a predefined user pool that you can use to modify resource use for the server as a whole. You can also define user groups that belong to this pool, to manage access to resources.
58
+
- The *default pool* is a predefined user pool that you can use to modify resource use for the server as a whole. You can also define user groups that belong to this pool, to manage access to resources.
49
59
50
-
- The *default external pool* is a predefined user pool for external resources. Additionally, you can create new external resource pools and define user groups to belong to this pool.
60
+
- The *default external pool* is a predefined user pool for external resources. Additionally, you can create new external resource pools and define user groups to belong to this pool.
51
61
52
-
In addition, you can create *user-defined resource pools* to allocate resources to the database engine or other applications, and create *user-defined external resource pools* to manage R and other external processes.
62
+
In addition, you can create *user-defined resource pools* to allocate resources to the database engine or other applications, and create *user-defined external resource pools* to manage R and other external processes.
53
63
54
64
For a good introduction to terminology and general concepts, see [Resource Governor Resource Pool](../../relational-databases/resource-governor/resource-governor-resource-pool.md).
55
65
56
66
57
-
## Resource Management using Resource Governor
67
+
## Resource management using Resource Governor
58
68
59
-
If you are new to Resource Governor, see this topic for a quick walkthrough of how to modify the instance default resources and create a new external resource pool: [How To: Create a Resource Pool for R](../../advanced-analytics/r-services/how-to-create-a-resource-pool-for-r.md)
60
-
61
-
You can use the *external resource pool* mechanism to manage the resources used by the following R executables:
62
-
63
-
- Rterm.exe and satellite processes
64
-
65
-
- BxlServer.exe and satellite processes
69
+
If you are new to Resource Governor, see this topic for a quick walkthrough of how to modify the instance default resources and create a new external resource pool: [How To: Create a Resource Pool for R](../../advanced-analytics/r/how-to-create-a-resource-pool-for-r.md)
66
70
67
-
- Satellite processes launched by LaunchPad
71
+
You can use the *external resource pool* mechanism to manage the resources used by the following executables that are used in machine learning:
68
72
69
-
However, direct management of the Launchpad service by using Resource Governor is not supported. That is because the [!INCLUDE[rsql_launchpad](../../includes/rsql-launchpad-md.md)] is a trusted service that can by design host only launchers that are provided by Microsoft. Trusted launchers are also configured to avoid consuming excessive resources.
73
+
+ Rterm.exe and satellite processes
74
+
+ Python.exe and satellite processes
75
+
+ BxlServer.exe and satellite processes
76
+
+ Satellite processes launched by Launchpad
70
77
71
-
We recommend that you manage satellite processes using Resource Governor and tune them to meet the needs of the individual database configuration and workload. For example, any individual satellite process can be created or destroyed on demand during execution.
78
+
> [!NOTE]
79
+
>
80
+
> Direct management of the Launchpad service by using Resource Governor is not supported. That is because the [!INCLUDE[rsql_launchpad](../../includes/rsql-launchpad-md.md)] is a trusted service that can by design host only launchers that are provided by Microsoft. Trusted launchers are configured to avoid consuming excessive resources.
81
+
>
82
+
> We recommend that you manage satellite processes using Resource Governor and tune them to meet the needs of the individual database configuration and workload. For example, any individual satellite process can be created or destroyed on demand during execution.
72
83
73
-
## Disable External Script Execution
74
-
Support for external scripts is optional in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] setup. Even after installing [!INCLUDE[rsql_productname_md](../../includes/rsql-productname-md.md)], the ability to execute external scripts is OFF by default, and you must manually reconfigure the property and restart the instance to enable script execution.
75
-
76
-
Therefore, if there is a resource issue that needs to be mitigated immediately, or a security issue, an administrator can immediately disable any external script execution by using [sp_configure (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md) and setting the property `external scripts enabled` to FALSE, or 0.
77
-
78
-
## See Also
79
-
[Managing and Monitoring R Solutions](../../advanced-analytics/r-services/managing-and-monitoring-r-solutions.md)
80
-
[How To: Create a Resource Pool for R](../../advanced-analytics/r-services/how-to-create-a-resource-pool-for-r.md)
Support for external scripts is optional in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] setup. Even after installing the machine learning features, the ability to execute external scripts is OFF by default, and you must manually reconfigure the property and restart the instance to enable script execution.
87
+
88
+
Therefore, if there is a resource issue that needs to be mitigated immediately, or a security issue, an administrator can immediately disable any external script execution by using [sp_configure (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md) and setting the property `external scripts enabled` to FALSE or 0.
82
89
90
+
## See also
91
+
92
+
[Managing and monitoring machine learning solutions](../../advanced-analytics/r/managing-and-monitoring-r-solutions.md)
93
+
94
+
[Create a resource pool for machine learning](../../advanced-analytics/r/how-to-create-a-resource-pool-for-r.md)
0 commit comments