Understanding your VPS's actual network performance helps diagnose slow application response times and verify your hosting provider's advertised bandwidth. This guide covers the standard tools for testing.
Testing Latency (Ping)
ping -c 10 8.8.8.8
Lower average round-trip time indicates lower latency. Values under 20ms are excellent, under 50ms are good for most applications, and over 100ms can noticeably affect interactive applications.
Testing Latency to a Specific Destination
ping -c 10 yourdomain.com
Tracing the Network Path
traceroute 8.8.8.8
Shows each network hop between your VPS and the destination — useful for identifying where latency is being introduced along the route.
Testing Download/Upload Bandwidth with speedtest-cli
pip install speedtest-cli
speedtest-cli
Or via the official Ookla CLI, if available for your distribution:
speedtest
Testing Bandwidth Between Two Servers with iperf3
On the server acting as the receiver:
sudo apt install iperf3 -y
iperf3 -s
On the client/sender:
iperf3 -c SERVER_IP
This gives a more accurate measure of actual throughput between two specific points than a general internet speed test, which is useful for testing private networking between your own VPS instances.
Testing DNS Resolution Speed
dig yourdomain.com | grep "Query time"
Testing Web Server Response Time Directly
curl -w "@-" -o /dev/null -s https://yourdomain.com <<'EOF'
DNS lookup: %{time_namelookup}s
Connect: %{time_connect}s
TLS handshake: %{time_appconnect}s
Time to first byte: %{time_starttransfer}s
Total: %{time_total}s
EOF
This breaks down exactly where time is being spent — DNS, connection, TLS negotiation, or waiting for the application's response.
Monitoring Network Usage Over Time
sudo apt install vnstat -y
vnstat
Shows historical bandwidth usage — useful for confirming you're not approaching a bandwidth cap, and identifying unusual traffic patterns.
Interpreting Results
| Metric | Good | Investigate If |
|---|---|---|
| Latency (ping) | < 50ms to major destinations | Consistently > 150ms |
| Packet loss | 0% | Any sustained packet loss |
| Bandwidth | Matches or exceeds provider's advertised rate | Significantly below advertised rate consistently |
Common Errors
Speed test results much lower than expected — test at different times of day to rule out temporary network congestion, and test to multiple destination servers to rule out a single test server issue.
High latency to specific destinations only — often a routing/peering issue between networks rather than a problem with your VPS itself; use traceroute to identify where the delay is introduced.
Related Articles
- How to Diagnose a Slow VPS: Complete Performance Checklist
- How to Set Up a CDN in Front of Your VPS
- How to Fix "Connection Timed Out" Errors
