Control Worker Restarts
Restart Workers Based on Up Time
As worker processes evaluate MATLAB® functions, the MATLAB workspace accumulates saved state and other data. This accumulated data can occasionally cause a worker process to fail. One way to avoid random worker failures is to configure the server instances to restart worker processes when they have been running for set period.
If the server instance is running, stop it.
Open the configuration file for the instance in a text editor.
The configuration file is at
.instanceRoot
/config/main_configLocate the entry for the
worker-restart-interval
property.--worker-restart-interval 12:00:00
Change the value to the desired restart interval.
For example, restart workers at intervals of 1 hour, 29 minutes, 5 seconds.
--worker-restart-interval 1:29:05
Restart the server instance.
Restart Workers Based on Amount of Memory in Use
As worker processes evaluate MATLAB functions, the MATLAB workspace accumulates saved state and other data. This accumulated data can occasionally cause a worker process to fail. One way to avoid random worker failures is to configure the server instances to restart worker processes when they begin consuming a predefined amount of memory.
This is done by adjusting three configuration properties:
worker-memory-check-interval
— Interval at which workers are polled for memory usageworker-restart-memory-limit
— Size threshold at which to consider restarting a workerworker-restart-memory-limit-interval
— Interval for which a worker can exceed its memory limit before restart
To adjust memory-based restart thresholds:
If the server instance is running, stop it.
Open the configuration file for the instance in a text editor.
The configuration file is at
.instanceRoot
/config/main_configLocate the entry for the
worker-memory-check-interval
property.--worker-memory-check-interval 0:00:30
Change the value to the desired restart interval.
For example, restart workers at intervals of 1 hour, 29 minutes, 5 seconds.
--worker-memory-check-interval 1:29:05
Add an entry for the
worker-restart-memory-limit
property.For example, consider restarting workers when they consume 1 GB of memory.
--worker-restart-memory-limit 1GB
Add an entry for the
worker-restart-memory-limit-interval
property.For example, restart workers when they exceed the memory limit for 1 hour.
worker-restart-memory-limit-interval 1:00:00
Restart the server instance.
See Also
Server Configuration Properties