Problem description
When you use a Linux ECS instance, the following issues may occur:
The system becomes unresponsive, service response times are long, and application performance is degraded.
High memory usage is displayed in the Elastic Compute Service (ECS) console. Memory usage that exceeds 80% is considered high.
Alerts are generated indicating that the memory usage exceeds the specified threshold.
Possible causes
The preceding issue may occur due to the following reasons:
Abnormal processes or services consume a large amount of memory.
The business traffic is too high, and the instance's physical memory is insufficient.
Troubleshoot the issue
Use top to check instance memory usage
Perform the following steps to resolve high memory usage issues:
Connect to the ECS instance. For more information, see Methods for connecting to an ECS instance.
Check for processes that consume a large amount of memory on the instance.
View the CPU utilization and memory usage of processes.
topNoteTo exit the
topcommand, enter q.Press the
Mkey to sort processes by memory usage. The following example output shows that the process with PID13183consumes the most memory.
The following table describes the system information summary and process metric fields.
Resolve the issue
The following table describes the causes of high memory usage issues and their solutions.
Problem description | Cause | Solution |
A single user program or process consumes a large amount of memory for an extended period. | The program or process is abnormal. |
|
A normal user program or process consumes excessive memory resources for an extended period of time. | The program is normal. | If the instance experiences memory resource bottlenecks, you can choose an appropriate method based on your business scenario:
|
A single business program or process occasionally occupies excessive memory resources for a short period. | The program or process has temporary traffic spikes or scheduled tasks that consume excessive memory resources within a short period of time. |
|
No program or process consumes memory resources, but the overall memory usage is high. | Memory resources required for the normal operation of the instance's services exceed the instance's memory size. | If the instance has a memory bottleneck, change the instance type. |
References
For information about how to troubleshoot and resolve high memory usage issues in Windows systems, see What do I do if the memory usage of a Windows instance is high?
To collect network metrics in advance for anomaly analysis, you can use the atop utility. For more information, see Use the atop tool to monitor Linux metrics.