Testing Your Network Speed with ping
You may have heard about the concept of “pinging” a website. But what does that actually mean and why would you ping a domain?
Pinging a domain is when you send small packets of information to a target server and wait to see how long it takes to get that information back. This tells you how fast your server is responding to requests. How fast your server responds impacts how fast your website loads. If you don’t get a response to a ping request, something is wrong with your server. Ping can help you diagnose these problems.
If you search for “ping test” in your web browser, you’ll find multiple websites that will run ping tests for you. But, you can also ping using the command line interface (CLI) on your computer. The command line is a way to control your computer using only the keyboard and was the only way people could control computers until the 1960s. Every computer still has a way to use command line commands.
Pinging a domain is a great start to learning how to use the command line. You can use commands in Windows, OSX, and Linux.
Using ping in Windows
- Every version of Windows has a slightly different Start menu, but click on the Start menu icon or switch to the Start screen and type “command” into the search bar.
- Click on Command Prompt to open the command line interface.
- In the Command Prompt window, type
ping mysite.com -n 5
- and press Enter (replace “mysite.com” with the domain you want to ping).
- The -n 5 part of your command says you only want a certain number of ping tests sent—5.
- You should start seeing your ping test results.
Using ping in OSX
- Click on your Launchpad icon, then search for “Terminal.”
- Click on Terminal to launch the CLI.
- In the Terminal window, type
ping -c 5 mysite.com
and press Enter (replace “mysite.com” with the domain you want to ping).
- The -c 5 part of your command says you only want a certain number of ping tests sent—5.
- You should start seeing your ping test results.
Using ping in Linux
- Open your terminal window.
- In your terminal, type
ping -c 5 mysite.com
and press Enter (replace “mysite.com” with the domain you want to ping).
- The -c 5 part of your command says you only want a certain number of ping tests sent—5.
- You should start seeing your ping test results.
ping Check Results
Your results should look something like this:
$ ping -c 5 google.com PING google.com (172.217.4.110) 56(84) bytes of data. 64 bytes from ord36s04-in-f14.1e100.net (172.217.4.110): icmp_seq=1 ttl=56 time=8.17 ms 64 bytes from ord36s04-in-f14.1e100.net (172.217.4.110): icmp_seq=2 ttl=56 time=6.89 ms 64 bytes from ord36s04-in-f14.1e100.net (172.217.4.110): icmp_seq=3 ttl=56 time=7.64 ms 64 bytes from ord36s04-in-f14.1e100.net (172.217.4.110): icmp_seq=4 ttl=56 time=6.89 ms 64 bytes from ord36s04-in-f14.1e100.net (172.217.4.110): icmp_seq=5 ttl=56 time=6.90 ms --- google.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 6.895/7.302/8.177/0.523 ms
Let’s break down the results using one ping.
Ideally, you want 0% packet loss and a fairly consistent ping response time. If you try to ping your domain when a lot of people are visiting your website and the ping response is really slow, you will want to look into ways to create shorter response times during high traffic.