Contact Free trial Login

Application Monitoring and Automatic Restarts

logo cloud active logo hybrid disabled logo server disabled logo rtf disabled

CloudHub monitors all applications and enables you to receive notifications and diagnostic information if your application becomes unresponsive.

You can enable automatic restarts so that your application can recover automatically without your intervention.

How Application Monitoring Works

Monitoring works differently depending on your Mule version.

  • Mule 4.x

    Every 30 seconds, CloudHub checks the PID of the Mule process.

    If CloudHub detects that the application process is not running three times in a row, the logs print a warning.

  • Mule 3.8.x

    When you deploy, CloudHub inserts a monitoring ping flow into your application.

    When the application starts, the logs display a message to indicate that monitoring is enabled and that the ping flow has been injected into your application:

    Monitoring enabled and Registering ping flow injector message in the logs
    Figure 1. The arrow shows the Monitoring enabled and Registering ping flow injector messages in the logs.

    Every 30 seconds, CloudHub sends an HTTP GET request to the ping flow.

    If the application is running normally, the ping flow sends a response. If CloudHub receives no response from three consecutive pings, the logs display a warning and a full thread dump.

In both cases, CloudHub triggers a notification to the console to alert you that a worker for an application stopped responding.

If you configure email alerts, the unresponsive worker also triggers an email alert based on the Worker Not Responding event.

Enable Automatic Restarts

You can enable automatic restarts when you deploy a new application or redeploy an existing application.

  • Deploy a new app

    1. In Runtime Manager, click Applications in the menu on the left.

    2. Click Deploy Application and select CloudHub from Deployment Target.

    3. Select the Automatically restart application when not responding option:

      Automatically restart application when not responding option
      Figure 2. The arrow shows the Automatically restart application when not responding option.
    4. Click Deploy Application.

  • Redeploy an existing app

    1. In Runtime Manager, click Applications in the menu on the left.

    2. Click the app status to display the details pane on the right

    3. Click the Manage Application button to display the Settings page for the app.

    4. Select the Automatically restart application when not responding option:

      Automatically restart application when not responding option
      Figure 3. The arrow shows the Automatically restart application when not responding option.
    5. Click Apply Changes.

How Automatic Restarts Work

If you select the Automatically restart application when not responding option, CloudHub monitors the worker and also automatically restarts the application if necessary.

CloudHub displays a notification that the app is restarting and another to report the success or failure of the restart.

  • If the restart succeeds, the ping script is reinitialized so that monitoring continues.

  • If the restart fails, CloudHub continues to attempt restarting the app up to a total of five times.

After the maximum number of restart attempts is exceeded, CloudHub takes no further action. The monitoring script exits and the application is left unchanged until you manually intervene.

The logs report the details of the restart procedure.

If you don’t select the Automatically restart application when not responding option, the monitoring script exits and the application is left unchanged until you manually restart.

CloudHub displays a notification and a log message and takes no further action.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.