![](/style/images/good.png)
3
![](/style/images/bad.png)
traceroute(8) gets speed boost
source link: https://undeadly.org/cgi?action=article%3Bsid%3D20210903094704
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
traceroute(8) gets speed boost
Contributed by rueda on 2021-09-03 from the performance-enhancing-florian@ dept.
Florian Obser (florian@
)
has committed
a significant speed boost for
traceroute(8)
:
CVSROOT: /cvs Module name: src Changes by: [email protected] 2021/09/03 03:13:00 Modified files: usr.sbin/traceroute: Makefile traceroute.8 traceroute.c traceroute.h worker.c Log message: Make traceroute(8) faster by sending probes and doing DNS async. Traditional traceroute would send one probe and then wait for up to 5 seconds for a reply and then send the next probe. On a lossy link that eventually ends in a black hole this would take about 15 minutes and people would hit control-c in anger. This rewrites the traceroute engine to use libevent and asr's async DNS interface. Probes are now send every 30ms or as soon as we get an answer back. With that we got the 15 minute worse case down to about 10 seconds. A minor adjustment that is possible with this is to delay printing a line until we get to a line with answers. This has two effects: 1) If there are intermediate hops that don't answer, output pauses for a bit so we keep the visual cue of "something might be wrong here". 2) If there is a black hole at the end, we don't print out many "* * *" lines and thus scrolling the interesting bits out of the terminal. We collapse those lines and just print 64 * * * at the end. Unfortunately the -c option to send udp probes to a fixed port had to go for now. But we should be able to add it back. "Once you have seen the new one you can't go back to the old one" & enthusiastic OK deraadt@ OK sthen@ "I am very distressed that florian went to bed without committing it" beck@
Florian tooted links to recordings showing the old and new behaviours with an earlier version of this work.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK