Main Content

Configure Server

Each MATLAB® Production Server™ instance has its own server configuration file, main_config. To change the server properties for an on-premises server instance managed using the command-line, edit the main_config file that corresponds to your specific server instance. You must restart the server instance for the changes to take effect. The server configuration file is located at server_instance_name.

Edit Server Configuration File

When editing the main_config server configuration file, remember these coding considerations:

  • Each server instance has its own server configuration file.

  • Enter only one configuration property and its options per line. Each configuration property entry starts with two dashes (--).

  • The server ignores any line beginning with a pound sign (#) and considers it as a comment.

  • The server ignores lines of white space.

For on-premises server instances created using the dashboard interface and server deployments on the cloud, use the dashboard to edit the server properties.

Common Customizations

Set Default Port Number for Client Requests

Use the http property to set the default port number on which the server listens for client requests.

Set Number of Available Workers

Use the num-workers property to set the number of concurrent MATLAB execution requests that can be processed simultaneously.

Set Number of Available Threads

Use the num-threads property to set the number of request-processing threads available to the main server process.

Note

For .NET Clients, the HTTP 1.1 protocol restricts the maximum number of concurrent connections between a client and a server to two.

This restriction only applies when the client and server are connected remotely. A local client/server connection has no such restriction.

To specify a higher number of connections than two for remote connection, use the .NET classes System.Net.ServicePoint and System.Net.ServicePointManager to modify maximum concurrent connections.

For example, to specify four concurrent connections, use the following code:

ServicePointManager.DefaultConnectionLimit = 4; 
MWClient client = new MWHttpClient(new MyConfig()); 
MPSClient mpsExample = client.CreateProxy(
            new Uri("http://user01:9910/mpsexample")); 

See Also

Related Topics