Main Content

Support Multiple MATLAB Runtime Versions

MATLAB® Production Server™ instances can host deployable archives compiled using multiple versions of MATLAB Compiler SDK™. To do so, you must configure on-premises server instances to use multiple MATLAB Runtime versions. An installation of MATLAB Production Server supports MATLAB Runtime versions up to six releases back. For a server environment deployed in the cloud, the deployment sets the mcr-root property to support multiple MATLAB Runtime versions.

Configure Server to Use Multiple MATLAB Runtime Instances

If you do not have a MATLAB Runtime installation on your on-premises server, you must install it first. For more information, see MATLAB Runtime.

Note

  • Configure a server instance to use MATLAB Runtime roots on a local file system. Otherwise, a network partition might cause worker processes to fail.

  • All paths to the MATLAB Runtime installations must belong to the same operating system and hardware combination.

Specify Multiple MATLAB Runtime Instances Using Command-Line

If you manage server instances using the command-line, add multiple mcr-root properties to the main_config configuration file to support multiple MATLAB Runtime instances.

  1. Stop the server instance, if it is running.

  2. Open the configuration file for the server instance in a text editor.

    The configuration file is at instanceRoot/config/main_config.

  3. Locate the entry for the mcr-root property in the configuration file.

    --mcr-root mCRuNsETtOKEN
  4. For each version of MATLAB Runtime that the instance supports, add an instance of the mcr-root property. Order the MATLAB Runtime versions from the latest to the oldest.

    For example, to configure the instance to use the v98 and v97 versions of the MATLAB Runtime, specify the following.

    --mcr-root C:\Program Files\MATLAB\MATLAB Runtime\v98
    --mcr-root C:\Program Files\MATLAB\MATLAB Compiler Runtime\v97
  5. Restart the server instance.

Specify Multiple MATLAB Runtime Instances Using Dashboard

If you manage server instances using the dashboard, log in to the dashboard and update the server settings to support multiple MATLAB Runtime instances.

  1. Stop the server instance, if it is running.

  2. Under Settings > Core, locate the MATLAB Runtime field.

  3. For each version of MATLAB Runtime that the instance supports, specify the path to the MATLAB Runtime installations separated by a comma. Order the MATLAB Runtime versions from the latest to the oldest.

    For example, to configure the instance to use the v98 and v97 versions of the MATLAB Runtime, specify the following.

    C:\Program Files\MATLAB\MATLAB Runtime\v98,C:\Program Files\MATLAB\MATLAB Runtime\v97
  4. Restart the server instance.

How Server Instances Select Which MATLAB Runtime to Use

After you configure the server instance to use multiple versions of MATLAB Runtime, to process a server request, the server scans the list of MATLAB Runtime versions in the configuration file in order from first to last, and chooses the first MATLAB Runtime installation capable of processing the request. A MATLAB Runtime installation can process a request if it is compatible with the version of MATLAB used to create the deployable archive containing the function being evaluated.

Note

Since the server instance always chooses the first compatible version of MATLAB Runtime, configuring the server instance with multiple instances of the same MATLAB Runtime version has no effect on performance.

Changes to Worker Management

Configuring a server instance to use multiple MATLAB Runtime versions changes management of the workers that process requests.

When using a single MATLAB Runtime installation, the server instance starts the workers as needed until a number of workers specified by the num-workers property are running. Once running, workers can restart depending on the worker-restart-interval property or the worker-restart-memory-limit property. Workers are never fully stopped.

Once a server instance starts using multiple MATLAB Runtime versions, it dynamically manages the worker pool. The server instance starts new workers as needed until num-workers workers are running. The worker instances are spread out over the different MATLAB Runtime versions. Once num-workers workers are running, the server instance returns workers to the pool of available workers based on the worker-memory-trigger property and the queue-time-trigger property. Once a worker returns to the pool, the server can allocate it to process new requests using any of the configured MATLAB Runtime versions.

Related Topics