All Products
Search
Document Center

:How to adjust the huge page memory of Linux instances

Last Updated:Dec 28, 2020

Disclaimer: this article may be contributed by the community or involve third-party product information. We recommend that you visit the community or the official website of third-party products for help and support. Third-party products will not be provided by Alibaba Cloud after-sales support. This document is for reference only. Alibaba Cloud makes no guarantee by express or any other means.

Introduction

If the instance huge page memory is too large, you may fail to connect to the instance. You must modify the value of huge page memory in the /etc/sysctl.conf file.

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.
  1. Remotely log on to the Linux instance through VNC. For more information about how to log on remotely, see ECS connection methods overview.
    Note: If you cannot log on to the ECS instance remotely, you can detach the system disk of the abnormal ECS instance and attach the disk as a data disk to a normal ECS instance. For more information, see Step 1 to step 4 of how to detach a system disk from a Linux instance and attach it to another ECS instance as a data disk.

  2. Run the following command to back up the /etc/sysctl.conf file:
    cp /etc/sysctl.conf /etc/sysctl.conf_bak
  3. Run the following command to edit the /etc/sysctl.conf file:
    vim /etc/sysctl.conf
  4. Press A to locate the vm.nr_hugepages configuration items, adjust the configuration items to A reasonable value, and press Esc to exit the editing mode. Enter : WQ, press Enter, save and exit.
    Note:
    • The colon (:) in : WQ needs to be output by pressing the Shift + colon (:) key.
    • vm.nr_hugepages configuration items is measured in KB.
    • You can modify the value of the vm.nr_hugepages configuration items as needed.


  5. Run the following command to make the configuration take effect.
    sysctl -p

Application scope

  • Elastic Compute Service