Networking Troubleshooting

From wikinotes

NOTE:

don't use this, identify the networking layer with the problem and use appropriate tools.

troubleshooting websites

curl

I find curl most helpful in identifying code problems.
For example, I had issues with HTTP_HOST http headers behind a reverse proxy.
curl (in addition to sourcecode) helped me identify which HTTP header I needed to change.

curl -i http://website.com | less -Ri  # show page && headers
curl -vX OPTIONS http://website.com    # prints headers

chromium

I found this most helpful for everything following the initial connection.
chrome will show you get requests (and urls) for all of the resources (ex: css, images, ..).

Options > More Tools > Developer Tools:
  - Console:   # show connections, and status (mouseover to see request urls)

troubleshooting DNS

  • use dig to see how long the DNS resolve actually took
  • try using the ip address directly and compare results
  • test using ping

troubleshooting speed

  • test using traceroute/tracert (see which part of ping is taking a long time)
  • use wget -d website.com to identify if send or reply is cause of slowness

References

https://unix.stackexchange.com/questions/210614/what-commands-can-i-use-to-debug-or-profile-a-slow-dns-internet-connection
https://serverfault.com/questions/909838/server-too-slow-due-to-dns-resolution-issue
https://softwareengineering.stackexchange.com/questions/349032/what-is-the-ideal-response-size-to-consider-when-designing-api-objects-and-sub-o