Manage Python and R workloads with Resource Governor in SQL Server Machine Learning Services
Learn how to use Resource Governor to manage CPU, physical IO, and memory resources allocation for Python and R workloads in SQL Server Machine Learning Services.
Machine learning algorithms in Python and R are typically compute intensive. Depending on your workload priorities, you might need to increase or decrease the resources available for Machine Learning Services.
For more general information, see Resource Governor.
Resource Governor is an Enterprise Edition feature.
By default, the external script runtimes for machine learning are limited to no more than 20% of total machine memory. It depends on your system, but in general, you might find this limit inadequate for serious machine learning tasks such as training a model or predicting on many rows of data.
Manage resources with Resource Governor
By default, external processes use up to 20% of total host memory on the local server. You can modify the default resource pool to make server-wide changes, with R and Python processes utilizing whatever capacity you make available to external processes.
Alternatively, you can create custom external resource pools, with associated workload groups and classifiers, to determine resource allocation for requests originating from specific programs, hosts, or other criteria that you provide. An external resource pool is a type of resource pool introduced in SQL Server 2016 (13.x) to help manage the R and Python processes external to the database engine.
Enable resource governance (it is off by default).
Create a workload group for granular allocations, for example between training and scoring.
Create a classifier to intercept calls for external processing.
Execute queries and procedures using the objects you created.
For a walkthrough, see How to create a resource pool for external R and Python scripts for step-by-step instructions.
For an introduction to terminology and general concepts, see Resource Governor Resource Pool.
Processes under resource governance
You can use an external resource pool to manage the resources used by the following executables on a database engine instance:
- Rterm.exe when called locally from SQL Server or called remotely with SQL Server as the remote compute context
- Python.exe when called locally from SQL Server or called remotely with SQL Server as the remote compute context
- BxlServer.exe and satellite processes
- Satellite processes launched by Launchpad, such as PythonLauncher.dll
Direct management of the Launchpad service by using Resource Governor is not supported. Launchpad is a trusted service that can only host launchers provided by Microsoft. Trusted launchers are explicitly configured to avoid consuming excessive resources.