Help Center/ Cloud Application Engine/ Best Practices/ Health Check/ Cooperation Between Startup and Liveliness Probes
Updated on 2024-05-25 GMT+08:00

Cooperation Between Startup and Liveliness Probes

Prerequisites

Procedure

  1. Log in to CAE. Choose Component Configurations.
  2. Select the target component from the drop-down list in the upper part of the page.

    Figure 1 Selecting a component

  3. Configure the startup and liveliness probes by referring to Figure 2 and Figure 3, and make the configurations take effect. For details, see Configuring Health Check.

    Figure 2 Configuring liveliness probe
    Figure 3 Configuring startup probe

    The startup probe will check an instance every 5 seconds, starting 10 seconds after instance creation. If the check fails for five consecutive times, the container will be restarted. After the startup probe detects that the instance is healthy, the liveliness probe starts detection to prevent the instance from keeping restarting due to slow program startup.

    Ensure that the program can start within the following period: Latency + Check Interval x Failure Threshold. Otherwise, the startup probe will keep restarting the instance. If you are not sure about the program startup time, increase Failure Threshold and Latency.

    As shown in Figure 3, the program needs to start within 35 seconds (10 + 5 x 5 = 35).

  4. Click Component Events. As shown on the page, the program starts after one startup probe detection failure. Then the liveliness probe is switched to and detects that the instance is healthy.

    Figure 4 Viewing events
    Figure 5 Startup probe detection