How to Test Network Speed and Latency on a VPS

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

MetricGoodInvestigate If
Latency (ping)< 50ms to major destinationsConsistently > 150ms
Packet loss0%Any sustained packet loss
BandwidthMatches or exceeds provider's advertised rateSignificantly 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
  • network speed test, iperf3, latency test, vps bandwidth
  • 0 brukere syntes dette svaret var til hjelp
Var dette svaret til hjelp?

Relaterte artikler

DNS Fundamentals: A, AAAA, CNAME, MX, TXT & NS Records Explained

DNS translates human-readable domain names into the information servers actually need — IP...

How to Point a Domain to Your VPS (A/AAAA Records)

Before your website is reachable at yourdomain.com instead of a raw IP address, you need to...

How to Configure MX Records for Email Delivery

MX (Mail Exchange) records tell the internet which servers handle incoming email for your domain....

How to Use CNAME Records Correctly

CNAME records let you alias one domain name to another, but they come with important restrictions...

How to Enable and Configure IPv6 on Your VPS

IPv6 adoption continues to grow, and many VPS plans include a free IPv6 address alongside IPv4....