ssh - Why do I experience latency to certain IP's

07
2014-04
  • Michael Quale

    This one has me stumped. I read a lot and ask very few questions.

    I usually have 2 or 3 SSH sessions at any given time. Monitoring applications, working on server configs that type of daily grind. Lately a couple of hosts that I work on regularly will get extremely laggy and slow to respond to commands. When I type keystrokes into a shell prompt they should echo immediately, not 1 or 2 or 30 seconds later.

    So I started to troubleshoot. What I have done and managed to conclude thus far is this:

    • Ping times from my location to high availability sites like google.com and arpa DNS servers are rock solid.
    • Ping times from my location to hosts that are lagging sporadically timeout. then respond, then timeout in no discernable pattern.
    • Ping times from another server to lagging hosts are also stable.

    This in my eyes indicates a problem with routes. I have seen this before during my tenure as a local field engineer for Road Runner business class customers.

    I think the solution then was to incorporate a static route to bypass any congestion or saturated hops.

    Am I even close...anyone?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    networking - Factors affecting network latency
  • cornjuliox

    I frequently maintain a constant connection with some private servers. I need to be connected with very little latency. The servers measure response time (*ping) in milliseconds.

    What factors come into play when calculating this response time? Is it simply the distance between my computer and the server? Does bandwidth fit in here somehow?


  • Related Answers
  • RJFalconer

    Your ping is the time taken for a packet to go from your PC, to the server, and back again. It can be affected by a variety of things, including;

    • Bandwidth of your internet connection
    • What other applications/users are using the bandwidth on your local network
    • Your contention ratio
    • Distance from your local exchange
    • What, if any, throttling / traffic shaping your ISP is performing
    • The load of the server you are connecting to
  • rob

    Bandwidth doesn't directly affect your latency, but the number of routers between you and the server you're connecting to can affect your ping times dramatically. Each router can introduce a routing delay, so generally you want a network route with the fewest number of hops (although that is not always the case, since some networks may be faster than others).

    You can use traceroute (tracert on Windows), a command-line program, to check the number of hops between your computer and the server, as well as the latency to each router.

  • Satanicpuppy

    One other, often over-looked item that I haven't seen mentioned yet: MTU. The mtu represents the largest single packet that can move from your network, through the ISP, to the destination.

    Generally it's around 1500, and most routers default to this. HOWEVER, if you're using DSL or some other technology with a packet overhead (PPPoE), you may need to lower your MTU to keep from having packet fragmentation. Packet fragmentation has a DRAMATIC HORRIBLE EFFECT ON YOUR NETWORK SPEED.

    As a simple example, if your PC has defaulted to 1500, but your DSL line can only take 1492 (because it's 802.3), every single packet you send will be fragmented into one 1492-byte packet, and 1 8-byte packet...You'll be sending twice as many packets, your collisions will be higher, your overhead will be higher, and your connection will suffer.