Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to check the memory usage of a CVM

Shulou Source: shulou.com Published: 2022-06-03 05:40:59 09月12日 Update

How does the CVM view the memory footprint? CVM memory is an essential part of the hardware system. Checking the operation of system memory resources on a regular basis can help us find out whether there is abnormal memory usage in time and ensure the stable operation of the business.

Let's take Linux CVM as an example to introduce several commonly used memory viewing commands.

1.free command

Command format: free-m

Used to check the RAM usage of the system (to see the available and used memory of the system)

Calculation formula of available memory of CVM: available memory = free + buffers + cached

2.vmstat instruction

Command format: vmstat-s (parameter)

Used to view the memory storage information of the system, is a gadget to report virtual memory statistics. Vmstat command reports include: process, memory, paging, blocking IO, interrupt, disk, CPU.

3./proc/meminfo instruction

Command format: cat/proc/meminfo

Used to extract memory-related information from the / proc file system. These files contain internal information about the system and the kernel.

You can also use the command less / proc/meminfo to read the file directly. By using the less command, you can scroll up and down in the long output to find what you need.

4.top instruction

Command format: top

Used to print CPU and memory usage in the system.

One of the best things about top is the process ID number (PID) of a service that may be out of control. With these PID, you can troubleshoot (or kill) problematic tasks.

If you want top to display more friendly memory information, use the command top-o% MEM, which causes top to sort all processes by the memory they use.

5.htop instruction

Command format: htop

Analyze CPU and memory usage in detail.

If you don't have htop installed on your terminal, install it by command first.

Command format: sudo apt-get update

Then enter the following instructions

Command format: sudo apt install htop

As a senior professional cloud computing service provider and cloud security service provider in the industry, it is committed to providing cloud servers for Internet enterprise users and enterprise users in traditional industries. Its products have the characteristics and advantages of "security and stability, easy to use, high service availability, high performance-to-price ratio" and are designed to be customized for enterprises to meet the needs of rich and diversified application scenarios.

Tags: Memory command service system format instruction situation information server process enterprise file user report provider run dedicated industry host task Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Docker Huawei Apple MySQL