Main Content

Health Check API

Use the health check API to determine if the server has a valid license and is able to process HTTP requests. The health check classifies the server as healthy or unhealthy depending on whether the server has a valid license and can communicate with the Network License Manager. To check the server health, use GET Server Health.

A server is healthy when it is in one of the following states:

  • The server is operating with a valid license. The server is communicating with the network license manager, and the required number of license keys are checked out.

  • The server has lost communication with the network license manager, but the server is still fully operational and will remain operational until the end of the grace period as specified by the license-grace-period property.

If the health check is successful, the server responds with a 200 OK HTTP status code and a JSON object indicating that the server is healthy.

{
  "status": "ok"
}

When the server is unavailable to process HTTP requests, the health check API returns a 503 Health Check Failed HTTP response code with an empty response body. The health check fails when the server has lost communication with the Network License Manager for a period of time exceeding the grace period. When the server is in this state, it actively attempts to reestablish communication with the license manager. Request processing resumes if the sever is able to reestablish communication with the license manager.

A failed health check does not provide additional information about the cause of failure in the response body. Server administrators can use mps-status to get detailed information about the server status. Your terminal must be on the same system as the server to run mps-status.

For more information on licensing, see Manage Licenses for MATLAB Production Server.

See Also

| | (MATLAB Compiler SDK) | (MATLAB Compiler SDK)

Related Topics