Main Content

Customize Startup Parameters

The MATLAB® Parallel Server™ scripts run using several default parameters. You can customize the scripts, as described in this section.

Modify Script Defaults

The scripts for the server services require values for several parameters. You can set some parameters using flags at the command line, but the full set of user-configurable parameters are in the mjs_def file. To learn more about all the parameters in the mjs_def file, see Define MATLAB Job Scheduler Startup Parameters.

The default parameters used by the server service scripts are defined in the file:

  • matlabroot\toolbox\parallel\bin\mjs_def.bat (on Microsoft® Windows® operating systems)

  • matlabroot/toolbox/parallel/bin/mjs_def.sh (on Linux® operating systems)

To modify the default parameters, edit this file before installing or starting the mjs service.

Set the User

By default, the job manager and worker services run as the user who starts them. To run the services as a different user, modify the MJSUSER and MJSPASS parameters in the mjs_def file.

On UNIX® operating systems, MJSUSER requires that the current machine has the sudo utility installed, and that the current user be allowed to use sudo to execute commands as the user identified by MJSUSER. For further information, refer to your system documentation on the sudo and sudoers utilities (for example, man sudo and man sudoers).

The MJSUSER is granted these permissions on Windows systems:

PrivilegePurposeLocal Security Settings Policy
SeServiceLogonRightRequired to log on using the service logon type.Log on as a service
SeAssignPrimaryTokenPrivilegeRequired to start a process under a different user account.Replace a process level token
SeIncreaseQuotaPrivilegeRequired to start a process under a different user account.Adjust memory quotas for a process

To modify or remove these privileges,

  1. Select the Windows menu Start > Settings > Control Panel.

  2. Double-click Administrative Tools, then Local Security Policy.

  3. In the tree, select Local Policies > User Rights Assignment.

The table above indicates which policies are affected by MJSUSER. Double-click any of the listed policies in the Local Security Settings GUI to alter its setting or remove a user from that policy.

Override Script Defaults

Specify an Alternative Defaults File

The default parameters used by the mjs service, job managers, and workers are defined in the file:

  • matlabroot\toolbox\parallel\bin\mjs_def.bat (on Windows operating systems)

  • matlabroot/toolbox/parallel/bin/mjs_def.sh (on Linux operating systems)

Before installing and starting the mjs service, you can edit this file to set the default parameters with values you require.

Alternatively, you can make a copy of this file, modify the copy, and specify that this copy be used for the default parameters.

On Linux operating systems, enter the command

mjs start -mjsdef my_mjs_def.sh

On Windows operating systems, enter the command

mjs install -mjsdef my_mjs_def.bat
mjs start -mjsdef my_mjs_def.bat

If you specify a new mjs_def file instead of the default file for the service on one computer, the new file is not automatically used by the mjs service on other computers. If you want to use the same alternative file for all your mjs services, you must specify it for each mjs service you install or start.

For more information, see Modify Script Defaults.

Note

The startup script flags take precedence over the settings in the mjs_def file.

Start in a Clean State

When a job manager or worker starts up, it normally resumes its session from the past. This way, a job queue is not destroyed or lost if the job manager machine crashes or if the job manager is inadvertently shut down. To start up a job manager or worker from a clean state, with all history deleted, use the -clean flag on the start command:

startjobmanager -clean -name MyJobManager
startworker -clean -jobmanager MyJobManager

Increase Heap Memory

MATLAB Parallel Server supports MATLAB Job Scheduler clusters with up to 10,000 workers. When you scale up the number of workers or tasks in your cluster, you must increase the heap memory available to the job manager. To do so, set the JOB_MANAGER_MAXIMUM_MEMORY parameter in the mjs_def file based on the following recommendations.

  • Use a minimum value of 1000m (1000 MiB).

  • Use 1000m for every 1,000 workers.

  • Add 1000m for every 100,000 tasks expected to be queued at peak load.

For example, for a cluster with 10,000 workers and a peak queue size of 400,000 tasks, set JOB_MANAGER_MAXIMUM_MEMORY to 14000m.

Related Topics