Use coredump to analyze instance program exceptions

更新时间:
复制 MD 格式

If a program unexpectedly terminates or stops responding, the operating system records the content of the random access memory (RAM) that is allocated to the program and saves the content to a file for subsequent debugging and analysis. This process is called a core dump. This topic describes how to enable the coredump feature for an elastic container instance in the Elastic Container Instance console. After you enable the coredump feature, you can view and analyze a core file to identify the cause of an issue and fix the program.

Background information

By default, coredump is disabled in elastic container instances to prevent service unavailability that is caused by excessive disk usage. You can manually enable coredump. After you enable coredump, the system generates an O&M task. If a container unexpectedly terminates or exits, the system triggers coredump to generate a core file and save the core file to an Object Storage Service (OSS) bucket.

Limits

  • The generated O&M task is a one-time task. After the task runs successfully and retrieves a core file, coredump is disabled. The O&M task is valid for 12 hours. After this period, the task becomes invalid.

  • This method is not supported in the following regions: China (Ulanqab), China (Heyuan), China (Guangzhou), China (Nanjing - Local Region) (decommissioning), Philippines (Manila), South Korea (Seoul), and Thailand (Bangkok).

Procedure

  1. Log on to the Elastic Container Instance console.

  2. Enable coredump for the ECI instance.

    1. Click the ID of the target instance to go to the instance details page.

    2. Click the O&M tab, select the Core dump tab, and then click Enable.

      After coredump is enabled, an O&M task is generated. If coredump is not triggered, the task status is Pending.

      coredump-1

  3. Trigger coredump.

    Connect to the ECI instance. In the container, run the sleep 100 command and then press Ctrl+\ to trigger a coredump. The generated core file is automatically saved to OSS.coredump2

  4. Download the core file.

    After a coredump is triggered and a core file is generated, the O&M task status changes to Successful. Click Download in the Result column to save the core file to your local computer.

    coredump-2

    Note

    If the download does not start, check the website permission settings in your browser.

References

In addition to manually executing coredump O&M tasks, you can also specify a path to store core files to enable coredump. For more information, see the "Method 2: Specify a path to store core files" section in the Use coredump to analyze instance program exceptions topic.