Redigera

Dela via


Manage Python and R workloads with Resource Governor in SQL Server Machine Learning Services

Applies to: SQL Server 2016 (13.x) and later versions

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 computed 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.

Note

Resource Governor is an Enterprise Edition feature.

Default allocations

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 using whatever capacity you make available to external processes.

Optionally, 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.

  1. Enable resource governance (it's off by default).

  2. Run CREATE EXTERNAL RESOURCE POOL to create and configure the resource pool, followed by ALTER RESOURCE GOVERNOR to implement it.

  3. Create a workload group for granular allocations, for example between training and scoring.

  4. Create a classifier to intercept calls for external processing.

  5. Execute queries and procedures using the objects you created.

For a walkthrough, see Create a resource pool for SQL Server Machine Learning Services 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

Note

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.

Next steps