How to Monitor Your Linux Server Network Speed
Monitoring network speed on a Linux server is essential for maintaining performance, identifying bottlenecks, and ensuring smooth operation. Whether you’re a system administrator, DevOps engineer, or colocation service provider, having the right tools to measure and monitor network speed can help you optimize bandwidth usage and detect potential issues early.
In this blog, we’ll explore the best command-line tools and techniques to monitor network speed on a Linux server effectively.
Why Monitor Network Speed?
Monitoring your Linux server’s network speed helps in:
✔ Detecting network congestion before it affects performance.
✔ Troubleshooting slow connections and high latency.
✔ Ensuring server uptime by identifying network failures early.
✔ Optimizing bandwidth usage to avoid unnecessary costs.
Best Tools to Monitor Network Speed on Linux
1. Speedtest CLI (Speedtest.net)
If you want a quick test of your server’s internet speed, Speedtest CLI (by Ookla) is a great option.
Installation:
For Debian/Ubuntu:
sudo apt install speedtest-cli
For CentOS/RHEL:
sudo yum install speedtest-cli
For all distributions using Python:
pip install speedtest-cli
Usage:
Run a basic speed test:
speedtest-cli
For results in megabits per second (Mbps):
speedtest-cli --simple
2. iftop (Monitor Real-Time Network Traffic)
iftop
is a powerful real-time network bandwidth monitoring tool that displays incoming and outgoing traffic for each connection.
Installation:
For Debian/Ubuntu:
sudo apt install iftop
For CentOS/RHEL:
sudo yum install epel-release -y
sudo yum install iftop -y
Usage:
Run iftop
with root privileges:
sudo iftop
Press q
to exit and h
for help while running.
3. nload (Graphical Network Speed Monitor)
nload
provides real-time graphical visualization of incoming and outgoing network traffic.
Installation:
For Debian/Ubuntu:
sudo apt install nload
For CentOS/RHEL:
sudo yum install nload
Usage:
Run nload
for network monitoring:
nload
This will show live upload and download speeds in an easy-to-read format.
4. vnStat (Lightweight Network Traffic Monitor)
vnStat
is a low-resource tool that logs network traffic statistics over time.
Installation:
For Debian/Ubuntu:
sudo apt install vnstat
For CentOS/RHEL:
sudo yum install epel-release -y
sudo yum install vnstat -y
Usage:
Check daily network usage:
vnstat -d
Monitor real-time network speed:
vnstat -l
5. iperf (Measure Network Speed Between Servers)
If you need to test network speed between two Linux servers, iperf
is the best tool.
Installation:
For Debian/Ubuntu:
sudo apt install iperf3
For CentOS/RHEL:
sudo yum install iperf3
Usage:
On the server side, run:
iperf3 -s
On the client side, run:
iperf3 -c <server-ip>
This tests the actual bandwidth speed between the two servers.
Which Tool Should You Use?
Tool | Use Case |
---|---|
speedtest-cli | Check internet speed from your server |
iftop | Monitor real-time bandwidth usage by connections |
nload | Visualize incoming and outgoing network traffic |
vnStat | Log network traffic over time |
iperf3 | Test network speed between two servers |
Final Thoughts
Monitoring your Linux server’s network speed is crucial for maintaining optimal performance. Whether you need real-time monitoring (iftop, nload), long-term tracking (vnStat), or speed testing (speedtest-cli, iperf3), these tools will help you keep your server running smoothly.
Need help with server management? Let’s talk!
Comments are closed