Configure MATLAB Hardware Resources
When new MATLAB® and storage use cases arise, you might need to change the hardware resources
allocated to MATLAB
Online Server™ service. To change the hardware resource allocation, update the memory and CPU
configuration settings in the matlab-pool.yaml
file.
The MATLAB pool has two containers that control the hardware resources allocated:
The resource-proxy container provisions the storage for each user session.
The MATLAB container assigns MATLAB compute resources to each user.
The default memory and CPU configuration for these containers are as follows:
resourceQuota: matlab-pool-resource-proxy: requests: cpu: "200m" memory: "150Mi" limits: cpu: "500m" memory: "512Mi" matlab-pool-matlab: requests: cpu: "200m" memory: "2Gi" limits: #cpu: #memory: |
With these default settings:
The Resource-Proxy container requests a minimum of 200m CPU and 150Mi of memory, with limits of 500m CPU and 512Mi of memory on the node.
The MATLAB container requests a minimum of 200m CPU and 2Gi of memory on the node, with no limit set on these resources. To add resource limits, remove the comment markers (#) and add values appropriate for your environment and infrastructure. For more details, see Add Limits to MATLAB Container.
For more information about CPU and memory configuration in Kubernetes®, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
.
For GPU configuration, see Configure GPU Support in MATLAB Online Server.
Add Limits to MATLAB Container
Because the default MATLAB container configuration has no resource limits specified, it is possible for a container to use up all CPU and memory on the node.
To set a limit on CPU and memory requests, in the matlab-pool.yaml
file, uncomment the cpu
and memory
fields for the
MATLAB container and set CPU and memory values appropriate for your environment and
infrastructure. For example:
resourceQuota: matlab-pool-matlab: requests: cpu: "200m" memory: "2Gi" limits: cpu: "2000m" memory: "7Gi" |
With these settings, the MATLAB container requests a minimum of 200m CPU and 2Gi of memory and can request a maximum of 2000m CPU and 7Gi of memory. Therefore, the container cannot use all the resources on the node.
Increase Limits of Resource-Proxy
If the amount of data that is mounted through storage profiles is excessive, such as more than 10 TB, the underlying Linux® storage mechanism, FUSE, might need more memory to successfully provision the storage and required permissions.
To increase the limit on requests for CPU and memory, in the
matlab-pool.yaml
file, specify new cpu
and
memory
field values that are appropriate for your environment and
infrastructure. For example:
resourceQuota: matlab-pool-resource-proxy: requests: cpu: "250m" memory: "300Mi" limits: cpu: "750m" memory: "1Gi" |
With these settings, the Resource-Proxy container requests a minimum of 250m CPU and 300Mi of memory and can request a maximum of 750m CPU and 1Gi of memory. Therefore, the storage provisioner can use more hardware resources than the default maximum of 500m CPU and 512Mi of memory.
Update Server
To apply your changes, undeploy and redeploy the MATLAB pool service.
./mosadm undeploy matlab-pool
./mosadm deploy matlab-pool