Brendan Gregg | 5a06c2c | 2016-01-28 23:00:00 -0800 | [diff] [blame] | 1 | .TH gethostlatency 8 "2016-01-28" "USER COMMANDS" |
| 2 | .SH NAME |
| 3 | gethostlatency \- Show latency for getaddrinfo/gethostbyname[2] calls. Uses Linux eBPF/bcc. |
| 4 | .SH SYNOPSIS |
| 5 | .B gethostlatency |
| 6 | .SH DESCRIPTION |
| 7 | This traces and prints when getaddrinfo(), gethostbyname(), and gethostbyname2() |
| 8 | are called, system wide, and shows the responsible PID and command name, |
| 9 | latency of the call (duration) in milliseconds, and the host string. |
| 10 | |
| 11 | This tool can be useful for identifying DNS latency, by identifying which |
| 12 | remote host name lookups were slow, and by how much. |
| 13 | |
| 14 | This tool currently uses dynamic tracing of user-level functions and registers, |
| 15 | and may need modifications to match your software and processor architecture. |
| 16 | |
| 17 | Since this uses BPF, only the root user can use this tool. |
| 18 | .SH REQUIREMENTS |
| 19 | CONFIG_BPF and bcc. |
| 20 | .SH EXAMPLES |
| 21 | .TP |
| 22 | Trace host lookups (getaddrinfo/gethostbyname[2]) system wide: |
| 23 | # |
| 24 | .B gethostlatency |
| 25 | .SH FIELDS |
| 26 | .TP |
| 27 | TIME |
| 28 | Time of the command (HH:MM:SS). |
| 29 | .TP |
| 30 | PID |
| 31 | Process ID of the client performing the call. |
| 32 | .TP |
| 33 | COMM |
| 34 | Process (command) name of the client performing the call. |
| 35 | .TP |
| 36 | HOST |
| 37 | Host name string: the target of the lookup. |
| 38 | .SH OVERHEAD |
| 39 | The rate of lookups should be relatively low, so the overhead is not expected |
| 40 | to be a problem. |
| 41 | .SH SOURCE |
| 42 | This is from bcc. |
| 43 | .IP |
| 44 | https://github.com/iovisor/bcc |
| 45 | .PP |
| 46 | Also look in the bcc distribution for a companion _examples.txt file containing |
| 47 | example usage, output, and commentary for this tool. |
| 48 | .SH OS |
| 49 | Linux |
| 50 | .SH STABILITY |
| 51 | Unstable - in development. |
| 52 | .SH AUTHOR |
| 53 | Brendan Gregg |
| 54 | .SH SEE ALSO |
| 55 | tcpdump(8) |