Skip to content

Instantly share code, notes, and snippets.

@randomstatistic
Created May 7, 2014 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randomstatistic/a7a026798880e1003777 to your computer and use it in GitHub Desktop.
Save randomstatistic/a7a026798880e1003777 to your computer and use it in GitHub Desktop.
Microsecond timing of DNS resolution
for x in `seq 1 20`; do strace -f -tt -o /tmp/st dig
www.google.com > /dev/null && grep -P '(send|recv)msg\(20'
/tmp/st | grep -v EAGAIN | awk '/sendmsg/ {f= substr($2,7)} /recvmsg/
{e= substr($2,7)} END {print e-f}'; done | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment