How to identify bottlenecks on Linux
To identify Linux system bottlenecks, you should first check the following four aspects. 1. The CPU usage is too high: Use top, htop or mpstat to check to find out the processes with high usage and optimize or limit their resource usage. 2. Insufficient memory leads to frequent swapping: check Swap usage through free -h, /proc/meminfo or vmstat, increase memory, reduce memory consuming programs or adjust the swappiness parameter. 3. Disk I/O bottleneck: Use iostat -x to monitor disk utilization and response time, optimize applications, upgrade storage media, or enable caching mechanisms. 4. Network delay or bandwidth is full: analyze traffic through iftop, nload or sar -n DEV, optimize transmission, limit abnormal access or use CDN. During the investigation, each case should be analyzed one by one to avoid misjudgment.

Identifying bottlenecks in a Linux system is not difficult, the key is knowing where to start. Slow system, delayed response, and high resource utilization may all be symptoms of bottlenecks. But to really find the problem, you need to investigate in an organized manner.
The following areas are common sources of bottlenecks and are areas you should check first.
1. CPU usage is too high
The CPU is one of the components most prone to bottlenecks. If you find that the system responds slowly, especially when performing tasks, it may be that the CPU is insufficient.
How to check:
- Use
toporhtopto view overall CPU usage. - Use
mpstat(from the sysstat package) to view the load on each CPU core. - If you see that
%sy(system call) is very high, it means that the kernel is busy; if%us(user mode) is very high, it may be that a process is occupying the CPU.
what to do:
- Find the process with the highest CPU usage:
ps aux --sort=-%cpu | head - Check whether the program logic can be optimized or its CPU usage limited (such as using
cpulimit) - If it is frequently full, consider upgrading the hardware or doing load balancing
2. Insufficient memory leads to frequent swapping (Swap)
When there is not enough memory, Linux will use Swap space to relieve pressure, but this will cause a significant drop in performance. Swap is used more often, which usually means that memory has become a bottleneck.
How to check:
- Look at the output of
free -h, especially the usage of Swap - Observe
/proc/meminfoor usevmstat - If
si/so(swap in/out) continues to be greater than 0, it means frequent swapping
what to do:
- Increase physical memory (the most direct and effective)
- Reduce the number of memory-intensive programs
- Adjust
swappinessparameter (/proc/sys/vm/swappiness) to control swapping tendency - Check for memory leaks (such as Java applications)
3. Disk I/O becomes a bottleneck
Disk read and write speeds cannot keep up with requests, which can cause the entire system to slow down, especially when processing a large number of logs, database operations, or virtual machines.
How to check:
- Use
iostat -xto view%utilandawaitof the device - If
%utilis close to 100%, the disk is saturated - A high
await(for example, more than 10ms) indicates a slow response
what to do:
- Optimize applications to reduce unnecessary IO
- Use faster storage media (such as SSD instead of HDD)
- Spread data across multiple disks (RAID or LVM)
- Enable caching mechanisms (such as Redis, Memcached)
4. Network delay or bandwidth is full
Network bottlenecks usually occur when communicating between servers, uploading and downloading large files, or being attacked by DDoS.
How to check:
- Use
iftopornloadto view real-time bandwidth usage -
sar -n DEVcan see historical traffic trends - If you find that the bandwidth is full or packet loss is severe, it means there is a problem with the network.
what to do:
- Upgrade bandwidth or optimize transmission protocols (such as compression, chunking)
- Analyze traffic sources to prevent abnormal access (such as iptables speed limit)
- Use CDN to ease public network access pressure
- For LAN issues, check the switch or network card configuration
The bottleneck is often not a single one, but is often caused by the superposition of multiple factors. Therefore, you must be in order when investigating, one by one, and don't rush to conclusions.
That's basically it. Starting from these four aspects, most common bottlenecks can be located.
The above is the detailed content of How to identify bottlenecks on Linux. For more information, please follow other related articles on the PHP Chinese website!
Hot AI Tools
Undress AI Tool
Undress images for free
AI Clothes Remover
Online AI tool for removing clothes from photos.
Undresser.AI Undress
AI-powered app for creating realistic nude photos
ArtGPT
AI image generator for creative art from text prompts.
Stock Market GPT
AI powered investment research for smarter decisions
Hot Article
Popular tool
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
Hot Topics
20518
7
13631
4
How to manage software packages using Dnf and Rpm in Linux?
Mar 07, 2026 am 01:50 AM
dnfinstall prompts packagenotfound because it queries the enabled warehouse rather than the local installation status; rpm-q queries the local RPM database, and the scopes of the two are different.
How to monitor system performance and resources in Linux? (Top & Htop)
Mar 06, 2026 am 01:04 AM
The total top CPU usage is not 100% because it is calculated based on a single core, and the maximum is 800% for an 8-core system; the htop terminal size error needs to be fixed with eval$(resize); the real memory pressure is available rather than used; top command line truncation can be solved with the -c parameter.
How to setup file sharing using Samba on Linux? (SMB Protocol)
Mar 13, 2026 am 12:33 AM
The main reason why Windows cannot see the Samba share is that the firewall blocks UDP137–139/TCP445 or NetBIOS name resolution fails; it is necessary to confirm that the workgroup is consistent, the interfaces are configured correctly, the file permissions match forceuser/forcegroup, and set doscharset=UTF-8 to solve Chinese garbled characters.
How to extend a Logical Volume (LVM) in Linux without downtime?
Mar 13, 2026 am 12:53 AM
Logical volumes and file systems can be expanded online. You need to expand the LV first and then the file system. It is recommended to use lvextend-r for automatic synchronization adjustment, but you must ensure that the LVM and file system tool versions are compatible.
How to check open ports and listening services in Linux? (Netstat & SS)
Mar 10, 2026 am 01:08 AM
Netstat displays fewer LISTEN ports than ss because it does not display process information by default that non-root users do not have access to; ss can read all listening sockets by default without process names, and sudonetstat-tulpn is required to display them completely.
How to set up SSH key authentication on Linux? (Passwordless Login)
Mar 11, 2026 am 12:46 AM
It is recommended to use ssh-keygen-ted25519 to generate a key pair, because it is faster, more secure, and has a shorter key than the default RSA; it is necessary to strictly set the ~/.ssh directory permissions to 700 and authorized_keys to 600, and use ssh-v to confirm whether the client is Offering public key and whether the server rejects it.
How to format disk partitions using the command line in Linux?
Mar 15, 2026 am 12:01 AM
When fdisk is stuck at the Command prompt, it is normally waiting for input. Enter q to exit safely; you must umount before mkfs, otherwise it may fail silently; partedmkpart does not support the specified file system type, and mkfs needs to be executed separately.
How to configure a static IP address on Linux? (Netplan & NetworkManager)
Mar 14, 2026 am 12:02 AM
Netplan reports "InvalidYAML" when configuring a static IP due to indentation errors, missing spaces after colons, or mixed tabs; gateway4 has been deprecated and routes to:default must be used instead; NetworkManager needs to be modified before down/up takes effect; the renderer field is used to determine the backend during coexistence; incorrect DNS configuration will cause ping to succeed but curl to fail.





