Let’s set the scene: You go to visit a website and you get a “connection timed out” error. Is this a browser, internet, firewall, or hosting server issue? How do I know who to contact to get the issue resolved? Should I use ping, traceroute, or an MTR to get to the bottom of the issue? Let me explain why an MTR can be a great tool to get answers on a connection timeout issue.
MTR (short for “My Traceroute”) stands out as a versatile and insightful tool. Combining the functionality of both ping
and traceroute
, MTR provides a real-time, comprehensive view of the path packets take between a website’s visitor and a website’s server. We will explore what MTR is, how it works, and why it is particularly valuable for website troubleshooting.
An MTR is a diagnostic networking tool that displays the route packets take to their destination (in this case, a website’s server), along with performance metrics for each hop along the way. Developed by Matt Kimball in 1997, MTR continuously sends packets to the server and records information about the path and response times. This dynamic tool enables website developers and hosting server administrators to monitor and diagnose issues impacting a website’s performance or availability.
The MTR tool is available on most Unix-like operating systems, and a Windows version, “WinMTR,” is also widely used.
When you run the MTR command, it performs the following steps:
traceroute
, which provides a static snapshot of the route, MTR updates its statistics in real-time. This dynamic behavior allows users to observe changes in network performance over time.The output of an MTR command typically includes the following:
MTR offers several key advantages over ping
and traceroute
, making it a preferred tool for diagnosing website issues:
Ping is useful for checking if a website’s server is reachable and measuring response times, but it provides no insight into the network path. Traceroute shows the path, but offers limited real-time performance metrics. MTR merges the capabilities of both tools, offering a complete view of the route and performance metrics.
One of MTR’s most significant strengths is its ability to provide continuous, real-time updates. This dynamic monitoring allows website developers to detect intermittent issues, such as fluctuations in response times or packet loss, that might not be apparent with a single execution of ping
or traceroute
.
Website slowdowns or connectivity issues are often caused by packet loss. While ping
can indicate packet loss, it doesn’t reveal where the loss occurs. MTR pinpoints the exact hop(s) where packets are being dropped, enabling faster identification and resolution of the issue.
MTR provides detailed latency metrics, including minimum, average, and maximum response times, as well as standard deviation. These insights help diagnose inconsistent performance or bottlenecks affecting a website’s speed.
MTR’s tabular, real-time output is more intuitive and easier to interpret than the line-by-line format of traceroute
. It provides a clear picture of the website’s network health at a glance.
Using MTR to diagnose website issues is straightforward. Here’s a basic example:
mtr [website-domain]
For example, to trace the route to example.com
, you would run:
mtr example.com
Additional options can enhance its functionality:
-r
: Generates a report after a specified number of packets.-c
: Specifies the number of pings to send.-w
: Produces wide output with additional statistics.$ mtr -4 --report --report-wide example-host.local Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. router.local (192.168.1.1) 40.0% 10 1.1 1.5 0.9 3.6 0.9 2. 10.0.0.1 0.0% 10 4.5 4.9 4.1 6.0 0.6 3. 192.168.20.1 0.0% 10 9.8 10.3 8.7 12.9 1.1 4. 203.0.113.1 0.0% 10 22.4 23.2 21.9 26.4 1.3 5. 198.51.100.2 0.0% 10 34.1 35.7 32.6 39.0 1.9 6. 198.51.100.3 0.0% 10 46.2 47.3 44.7 50.0 1.6 7. example-server.net (203.0.113.50) 0.0% 10 60.3 61.8 58.9 65.4 2.1
$ mtr -4 --report --report-wide example-host.local Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. router.local (192.168.1.1) 0.0% 10 0.5 0.6 0.5 1.2 0.2 2. 10.0.0.1 0.0% 10 5.1 6.2 5.0 10.5 1.9 3. 192.168.10.1 20.0% 10 12.3 14.5 11.8 20.2 3.1 4. 203.0.113.1 30.0% 10 25.6 28.7 24.5 35.4 4.2 5. 198.51.100.2 0.0% 10 40.2 42.1 38.7 50.6 3.8 6. 198.51.100.3 0.0% 10 55.5 57.0 53.2 60.1 2.7 7. example-server.net (203.0.113.50) 0.0% 10 60.3 61.8 58.9 65.4 2.1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install mtr Verify: mtr --version
WinMTR.exe
from the folder.MTR is an invaluable tool for website developers and hosting server administrators tasked with ensuring optimal website performance. By combining the features of ping
and traceroute
with real-time insights, MTR simplifies the process of diagnosing connectivity and performance issues. Whether your website is experiencing packet loss, high latency, or intermittent outages, MTR equips you with the data you need to pinpoint and address the root cause. Next time you’re troubleshooting a website issue, give MTR a try, it could be the key to resolving your problem quickly and efficiently!
Justin Daniel is a System Administrator and Security Analyst who joined the company in 2013. Justin's main responsibilities include supporting monitoring, firewall, and backups. His professional experience covers more than 10yrs of System Administration and Website Security. When he's not checking logs or tuning firewalls, you might find Justin playing video games, working out, or walking his two corgis.