Troubleshoot high network bandwidth on Linux instances
High network bandwidth usage on a Simple Application Server Linux instance slows down your services or makes them unavailable. Locate the network interface, peer IP address, and process that consume the bandwidth, and then apply the remedy that matches the cause.
Symptoms
Degraded or unavailable service — Service response time increases significantly, and requests time out or the service becomes inaccessible.
Bandwidth usage alert — You receive an SMS message or email indicating that network bandwidth usage has exceeded the preset alert threshold.
Causes
-
Abnormal processes or malicious programs: The instance is infected with cryptocurrency mining programs or Trojans, or it is acting as a bot in a DDoS attack. These malicious programs generate a large amount of abnormal network traffic.
-
Network attacks: The public-facing ports of the instance are targeted by malicious access attempts, such as application-layer CC attacks, DDoS attacks, or brute-force attacks. These attacks can saturate the inbound bandwidth with invalid requests.
-
Insufficient instance network capacity: As your business grows, the instance's configured bandwidth can no longer handle the normal service traffic, creating a network performance bottleneck.
-
Prerequisites
Administrator permissions on the Simple Application Server instance. All commands in this topic run with
sudo.A connection to the instance. This topic uses a rescue connection from the Simple Application Server console.
The
iftopornethogstool. Step 2 provides the commands to install either tool from the package manager of the instance.(Optional) Security Center, if you need to scan for and remove malware. The virus scan feature of Security Center is a paid feature.
Procedure
First, use the sar tool to locate the network interface with abnormal traffic. Then, analyze the NIC traffic by using the iftop tool to identify the peer IP address consuming the bandwidth, or the nethogs tool to identify the high-traffic process. Finally, take appropriate actions based on the nature of the process and IP address.
Step 1: Identify the high-traffic network interface
Use the sar tool to identify the high-traffic NIC and define the troubleshooting target.
Log on to the Simple Application Server instance using a rescue connection.
-
Go to the Servers page in the Simple Application Server console.
On the server card, click Connect. In the Rescue Logon section of the dialog box, click Log on Now. Enter your username and password to log on to the Simple Application Server instance.
-
Gather network interface statistics.
# -n DEV: Reports network device statistics # 1 5: Samples every 1 second for a total of 5 times sudo sar -n DEV 1 5 -
Identify the high-traffic NIC.
Focus on the
Averagevalue oftxkB/s(average outbound bandwidth). By comparing the values, find theIFACE(NIC name) with the highest value.rxkB/srepresents the average inbound bandwidth rate.Linux 5.10.134-19.1.al8.x86_64 (iZbp1e5xxx) 11/14/2025 _x86_64_ (2 CPU) 04:11:13 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 04:11:14 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:14 PM eth0 317.00 580.00 21.36 933.00 0.00 0.00 0.00 0.00 04:11:14 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:14 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 04:11:15 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:15 PM eth0 328.00 582.00 22.34 943.08 0.00 0.00 0.00 0.00 04:11:15 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:15 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 04:11:16 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:16 PM eth0 352.00 595.00 24.08 935.58 0.00 0.00 0.00 0.00 04:11:16 PM eth1 1.00 1.00 0.04 0.04 0.00 0.00 0.00 0.00 04:11:16 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 04:11:17 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:17 PM eth0 347.00 581.00 23.58 943.02 0.00 0.00 0.00 0.00 04:11:17 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:17 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 04:11:18 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:11:18 PM eth0 367.00 623.00 24.98 952.79 0.00 0.00 0.00 0.00 04:11:18 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: eth0 342.20 592.20 23.27 941.49 0.00 0.00 0.00 0.00 Average: eth1 0.20 0.20 0.01 0.01 0.00 0.00 0.00 0.00In this example, the
eth0NIC has the highesttxkB/svalue. Therefore,eth0is the high-traffic NIC.
Step 2: Identify the peer IP address and the process that consume the bandwidth
Analyze the traffic on the NIC.
-
iftop: Monitors NIC traffic from a connection perspective. It identifies the IP addresses and ports that generate the most traffic with your instance.For web services, you can use
iftopto locate high-traffic IP addresses and combine it with tools likelogwatchto analyze web logs and determine if the traffic is legitimate. -
nethogs: Monitors NIC traffic from a process perspective. It identifies the process that consumes the most network bandwidth.
iftop
-
Install the
iftoptool.-
For Alibaba Cloud Linux and CentOS:
sudo yum install -y iftop -
For Ubuntu and Debian:
sudo apt update sudo apt install -y iftop
-
-
Monitor the high-traffic NIC.
Replace
<IFACE>with the name of the high-traffic NIC that you identified in Step 1.# -i <IFACE>: Specifies the NIC to monitor. # -P: Displays port numbers. sudo iftop -i <IFACE> -PFor example, if the high-traffic NIC is
eth0, runsudo iftop -i eth0 -P. -
Analyze the NIC traffic to find the peer IP address consuming the bandwidth.
19.1Mb 38.1Mb 57.2Mb 76.3Mb 95.4Mb iZbp1e5w04k4l xxx => 140.205.11 xxx 4.32Mb 3.17Mb 1.06Mb <= 62.9Kb 47.7Kb 15.1Kb iZbp1e5w04k4l xxx => 140.xxx 0b 164Kb 41.1Kb <= 0b 4.97Kb 1.30Kb iZbp1e5w04k4l xxx => 140.xxx 796Kb 159Kb 40.1Kb <= 15.5Kb 3.10Kb 804b iZbp1e5w04k4l xxx => 140.xxx 0b 89.9Kb 29.2Kb <= 0b 2.97Kb 882b iZbp1e5w04k4l xxx => 140.xxx 0b 83.9Kb 46.4Kb <= 0b 2.55Kb 1.25Kb iZbp1e5w04k4l xxx => 140.xxx 0b 78.9Kb 50.7Kb <= 0b 2.50Kb 1.52Kb iZbp1e5w04k4l xxx => 140.xxx 0b 71.0Kb 89.6Kb <= 0b 2.51Kb 2.85Kb iZbp1e5w04k4l xxx => 140.xxx 0b 66.1Kb 26.2Kb <= 0b 2.29Kb 822b iZbp1e5w04k4lv xxx => 140.xxx 0b 65.6Kb 16.4Kb <= 0b 1.62Kb 416b iZbp1e5w04k4l xxx => 140.xxx 0b 61.1Kb 23.2Kb <= 0b 1.77Kb 656b iZbp1e5w04k4l xxx => 140.xxx 0b 56.2Kb 55.6Kb <= 0b 1.53Kb 1.54Kb iZbp1e5w04k4lv xxx => 140.xxx 0b 52.1Kb 75.3Kb <= 0b 1.65Kb 2.40Kb iZbp1e5w04k4l xxx => 140.xxx 0b 52.0Kb 13.0Kb <= 0b 1.42Kb 363b ───────────────────────────────────────────────────────────────────────────────────────────────────── TX: cum: 80.9MB peak: 14.3Mb rates: 7.15Mb 6.52Mb 11.2Mb RX: 1.91MB 440Kb 146Kb 154Kb 276Kb TOTAL: 82.8MB 14.6Mb 7.30Mb 6.67Mb 11.4MbThe output sorts real-time traffic information in descending order. The
=>symbol indicates the rate at which your instance is sending data to a peer IP address. In this example, the average outbound traffic rate from the instance to the IP address140.205.11.xover the last 2 seconds is4.32Mb/s. -
Press
qto exit theiftopinterface. -
View the process that corresponds to the port.
Replace
<PEER_IP_ADDRESS>with the peer IP address that you obtained in the previous step.sudo netstat -antp | grep <PEER_IP_ADDRESS>The following example shows a sample output.
tcp 0 172.16.0.xxx xxx 140.205.11.xxx xxx ESTABLISHED 2282/nginx: worker tcp 0 172.16.0.xxx xxx 140.205.11.xxx xxx ESTABLISHED 2282/nginx: worker tcp 0 172.16.0.xxx xxx 140.205.11.xxx xxx ESTABLISHED 2282/nginx: worker tcp 0 172.16.0.xxx xxx 140.205.11.xxx xxx ESTABLISHED 2282/nginx: worker tcp 0 172.16.0.xxx xxx 140.205.11.xxx xxx ESTABLISHED 2282/nginx: worker tcp 0 172.16.0.xxx xxx 140.205.11.xxx xxx ESTABLISHED 2282/nginx: workerIn this example, the local IP address is
172.16.0.x, the peer IP address is140.205.11.x, the corresponding process isnginx: worker, and the PID is2282.
nethogs
Example
-
Install the nethogs tool.
-
For Alibaba Cloud Linux and CentOS:
sudo yum install -y nethogs -
For Ubuntu and Debian:
sudo apt update sudo apt install -y nethogs
-
-
Monitor the high-traffic NIC.
Replace
<IFACE>with the name of the high-traffic NIC that you identified in Step 1.# The default monitoring interval is 1 second. You can use -d to specify the monitoring interval. sudo nethogs <IFACE>For example, if the high-traffic NIC is
eth0, runsudo nethogs eth0. -
Analyze the NIC traffic.
NetHogs version 0.8.5 PID USER PROGRAM DEV SENT RECEIVED 2282 nginx nginx: worker process 696.898 19.289 KB/sec 15823 root sshd: root@pts/3 0.773 0.231 KB/sec ? root 172.16.xxx.54.137:80 0.000 0.000 KB/sec ? root 172.16.xxx.26.209:80 0.000 0.000 KB/sec ? root 172.16.xxx.45.106:80 0.000 0.000 KB/sec ? root 172.16.xxx.4.191:80 0.000 0.000 KB/sec ? root 172.16.xxx.154.78:80 0.000 0.000 KB/sec 1749 root /usr/local/cloudmonitor/bin/argusagent 0.000 0.000 KB/sec ? root 172.16.xxx.54.135:80 0.000 0.000 KB/sec ? root 172.16.xxx.26.207:80 0.000 0.000 KB/sec ? root 172.16.xxx.4.217:80 0.000 0.000 KB/sec ? root 172.16.xxx.89.115:80 0.000 0.000 KB/sec 6215 root /opt/aliyun-security/ilogtail/ilogtail-aliyun-security 0.000 0.000 KB/sec ? root 172.16.xxx.154.78:80 0.000 0.000 KB/sec ? root 172.16.xxx.83.69:80 0.000 0.000 KB/sec ? root 172.16.xxx.54.132:80 0.000 0.000 KB/sec ? root 172.16.xxx.26.210:80 0.000 0.000 KB/sec ? root 172.16.xxx.4.217:80 0.000 0.000 KB/sec ? root 172.16.xxx.89.113:80 0.000 0.000 KB/sec ? root 172.16.xxx.154.78:80 0.000 0.000 KB/sec 1806 root /usr/local/aegis/aegis_client/aegis_12_61/AliYunDun 0.000 0.000 KB/sec 2810 root /usr/local/aegis/alihips/AliHips 0.000 0.000 KB/sec 6172 root /opt/aliyun-security/rapt-daemon/rapt-daemon 0.000 0.000 KB/sec ? root unknown TCP 0.000 0.000 KB/secThe
SENTcolumn shows the rate at which your instance is sending data to the receiver (the peer IP address). In this example, the process consuming the most traffic isnginx: worker process, with an outbound traffic rate of about 696 KB/s and a process ID (PID) of2282. Pressqto exit the tool's interface.
Step 3: Resolve the high-traffic issue
Choose a solution based on the process, peer IP address, or traffic pattern that you identified in Step 2:
If an identified process, such as a download tool (
wgetorcurl) or an unknown program, exhibits suspicious behavior or communicates with a malicious peer IP address:Terminate the suspicious process — Run
sudo kill -15 <PID>to end the suspicious process. Replace<PID>with the PID of the high-traffic process that you identified.ImportantBefore you end the process, make sure that it is not a core business process to avoid service interruptions.
Block the malicious IP address — Set up a firewall to block access from the malicious IP address.
Scan for and remove malware — Use the virus scan feature of Security Center to perform a full scan of the instance and remove malware.
If external clients send invalid requests to the public-facing ports of the instance and saturate its inbound bandwidth:
Add DDoS protection — To strengthen protection against network attacks, use Anti-DDoS Origin or Anti-DDoS Pro and Anti-DDoS Premium, and then configure protected objects and mitigation policies.
If the high traffic comes from a legitimate business process:
Optimize the program — Check whether your business code can be optimized. For example, reduce unnecessary data transfers, add caching, or compress data.
Throttle the traffic — If your business allows, use tools such as
iptablesto limit the traffic rate for specific IP addresses or ports, so that a single user or service does not consume all available bandwidth.Move to an ECS instance — If the instance can no longer handle your normal service traffic, switch to an ECS instance. When you switch to an ECS instance, see Migrate data from a Simple Application Server instance to an ECS instance to migrate your data.
Step 4: Verify that bandwidth usage returns to normal
After you apply a remedy, run sudo sar -n DEV 1 5 again and compare the Average value for the high-traffic NIC with the value that you observed in Step 1. Check txkB/s (average outbound bandwidth) if the high traffic is outbound, or rxkB/s (average inbound bandwidth) if invalid requests saturate the inbound bandwidth of the instance. A significantly lower value indicates that the remedy took effect. If the value remains high, return to Step 2 to identify the peer IP address or process that now consumes the bandwidth.
Next steps
(Recommended) Periodically collect system metrics for continuous analysis. For more information, see Use the atop tool to monitor Linux system metrics.