Configure Persistent Storage Using Admin Portal
R2026bIn the MATLAB® Production Server™ on-premises Admin Portal, you can use a persistence service to cache data between calls to MATLAB code running on a server instance. A persistence service runs separately from the server instance, and you can start and stop it manually. A connection name links a server instance to a persistence service. A persistence service uses a persistence provider to store data. Currently, Redis™ is the only supported persistence provider. You can use the connection name in MATLAB application code to create a data cache in the linked persistence service.
Create Connection to Remote Persistence Service
To create a connection, you must already have a previously created remote persistence service. See Data Caching Basics for more information.
Select Persistence from the left navigation tree.
Click the down arrow next to the + Create Connection button.
Enter details in the Create Connection dialog box.
Provider — By default, the persistence provider is Redis, which is the only supported provider.
Note
If your MATLAB Production Server instance runs on a Windows® machine, then you must install Windows Subsystem for Linux (WSL) and run Redis in WSL.
For details on installing WSL, see the Microsoft documentation.
If the MATLAB Production Server software is installed on a network drive, you must mount that drive in WSL.
Host — Enter a host name that you want the service to use.
Port — Enter a port number that you want the service to use. Only non-SSL ports are supported.
Access Key (optional) — Enter an access key string to connect to an Azure Redis Cache instance. An access key is required only for Azure® Redis Cache instances. Leave this setting empty for local or standard Redis.
Click Create.
Tip
To retrieve an access key for an Azure Redis Cache instance:
Log in to your Azure portal and select your Azure Redis Cache instance.
Select Overview. Under Keys, click Show access keys.
In the resulting blade, copy the access key string listed under Primary.
Manage Persistence Service
From the Persistence page, you can start, stop, restart and delete persistence services.
Select Persistence from the left navigation tree.
Locate the service in the table. This figure shows a table with an example persistence service.

Perform one of these actions to manage the service.
Action Procedure Start a persistence service. In the Control column, click the green arrow start button.
Stop a persistence service. In the Control column, click the orange square stop button.
Restart a persistence service. In the Control column, click the dark gray circle restart button.
Delete a persistence service. In the Manage column, click the trash can button.
Connect Persistence Service to Server Instance
Start the persistence service. See Manage Persistence Service.
Select the server instance from the navigation pane.
Select the Persistence tab.
Locate the connection name that you want to use to connect the persistence service to the server instance.
To attach the connection to the service instance and enable the connection, in the Actions column, click the paperclip button.
Disconnect Persistence Service from Server Instance
Select the running server instance from the navigation pane.
Select the Persistence tab.
Locate the persistence service you want to disconnect from the server instance.
Click the scissors button in the Actions column to detach the connection from the server instance and disable the connection.
Edit Persistence Service Configuration
If the service is running, stop the service. Otherwise, you cannot edit its configuration. See Manage Persistence Service.
Select Persistence from the left navigation tree.
In the list, locate the service whose configuration you want to edit.
Click the pencil button in the Manage column to edit the configuration.