All Products
Search
Document Center

:How to solve the OOM problem of Linux instances

Last Updated:Dec 24, 2020

Introduction

This article describes how to troubleshoot the OOM error that occurs on your Linux instance.

Background

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

Perform the following operations to locate the problem:

  1. Please refer to the following information to try to analyze the root cause of OOM.
    Information Point Description Remarks
    The time and frequency at which OOM occurs.
    • Linux log
    • Application Logs

    Linux log path is as follows:

    /var/log/message
    System load status of a Linux instance We recommend that you use CloudMonitor to query the load information of your ECS instance. If you are not using CloudMonitor, you can run the free, top, or top commands to view memory information. sar: For more information, see query and Linux instances of overall load .
    Your business load Application Logs Based on the time when the OOM occurs, check the causes of OOM in the business application logs.
    The application log generated when OOM occurs.
  2. Troubleshoot OOM based on the following causes:
    • The memory of the current Linux instance is insufficient to support the business.
      You can upgrade the memory configurations of an instance.
      Note: to upgrade the configuration, you need to restart the instance. Make sure that you have upgraded the memory configuration at the appropriate time.
    • Your business process has defects
      You can optimize your business code based on the issues in application logs.
  3. Continue to observe and confirm that the OOM problem no longer occurs.

Application scope

  • Elastic Compute Service