Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


What tests can I run when SSH'ng into a VPS starts to sssssllllowwwww down?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

What tests can I run when SSH'ng into a VPS starts to sssssllllowwwww down?

gutshotzgutshotz Member
edited February 2014 in General

Every once in a while my terminal session with a VPS becomes unresponsive or just slows down (ie typing a character may take a few seconds before it actually displays).

Of course, sometimes, it is due to some app (like FTP) that I am running locally in the background, but often not.

So I was wondering, when this happens, are there any standard tests (besides ping) that you can run on your VPS to track down the culprit and help you determine whether the bottleneck is on the VPS provider's side or just some net related 'hiccup'? What do you do?

Follow-up note: Sometimes just logging out, then back in, takes care of the problem.

Comments

  • Install MTR on another server and watch the effected server. My guess is that the route to your VPS has packet loss occurring somewhere causing your SSH session to act buggy.

    Mun

  • Thanks for the idea. So I installed MTR on a server and ran a '--report' to the other server, resulting in:

    mtr --report my.slow.ssh.vps
    Start: Fri Feb  7 22:27:54 2014
    HOST: origin                         Loss%   Snt   Last   Avg  Best  Wrst StDev
      1.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
      2.|-- ae0-132.sea23.ip4.tinet.n  0.0%    10    0.2   0.2   0.2   0.2   0.0
      3.|-- as2828.sea21.ip4.tinet.ne  0.0%    10   15.1   8.5   0.3  66.0  20.7
      4.|-- vb2000d1.rar3.seattle-wa.  0.0%    10   65.4  68.3  62.9  85.7   8.4
      5.|-- te-4-0-0.rar3.denver-co.u  0.0%    10   73.1  69.4  62.7  76.5   4.3
      6.|-- te-4-1-0.rar3.chicago-il.  0.0%    10   68.1  65.5  61.7  70.9   3.1
      7.|-- 216.156.0.254.ptr.us.xo.n  0.0%    10   61.3  61.3  61.2  61.4   0.0
      8.|-- 207.86.157.14              0.0%    10   73.9  68.1  61.6  73.9   4.8
      9.|-- host.colocrossing.com      0.0%    10   71.1  71.1  71.0  71.1   0.0
     10.|-- ny3.serverinthe.us         0.0%    10   70.3  70.4  70.3  70.4   0.0
     11.|-- host.colocrossing.com      0.0%    10   70.4  70.4  70.3  70.5   0.0
    

    I'm not sure why the 100% loss on the first hop. The firewall didn't stop any packets on the origin server, and there is no firewall up on the destination.

  • top/htop might help.

  • @gutshotz said:
    Thanks for the idea. So I installed MTR on a server and ran a '--report' to the other server, resulting in:

    > mtr --report my.slow.ssh.vps
    > Start: Fri Feb  7 22:27:54 2014
    > HOST: origin                         Loss%   Snt   Last   Avg  Best  Wrst StDev
    >   1.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
    >   2.|-- ae0-132.sea23.ip4.tinet.n  0.0%    10    0.2   0.2   0.2   0.2   0.0
    >   3.|-- as2828.sea21.ip4.tinet.ne  0.0%    10   15.1   8.5   0.3  66.0  20.7
    >   4.|-- vb2000d1.rar3.seattle-wa.  0.0%    10   65.4  68.3  62.9  85.7   8.4
    >   5.|-- te-4-0-0.rar3.denver-co.u  0.0%    10   73.1  69.4  62.7  76.5   4.3
    >   6.|-- te-4-1-0.rar3.chicago-il.  0.0%    10   68.1  65.5  61.7  70.9   3.1
    >   7.|-- 216.156.0.254.ptr.us.xo.n  0.0%    10   61.3  61.3  61.2  61.4   0.0
    >   8.|-- 207.86.157.14              0.0%    10   73.9  68.1  61.6  73.9   4.8
    >   9.|-- host.colocrossing.com      0.0%    10   71.1  71.1  71.0  71.1   0.0
    >  10.|-- ny3.serverinthe.us         0.0%    10   70.3  70.4  70.3  70.4   0.0
    >  11.|-- host.colocrossing.com      0.0%    10   70.4  70.4  70.3  70.5   0.0
    > 

    I'm not sure why the 100% loss on the first hop. The firewall didn't stop any packets on the origin server, and there is no firewall up on the destination.

    Did you do the MTR while you were having issues?

    Mun

  • The short version: First hop/any hop that has 100% loss is a firewall dropping icmp packets so long as the hops after it do not have 100% loss. Only worry about a hop that has high % loss with high % loss after that hop.

    You can also try using larger packet sizes to stress the network and demonstrate issues.

  • Install mosh. I rarely SSH if it's outside of my network now

  • I tried mosh a while back but kept getting errors and could never get it working. Maybe its time to give it another try.

  • dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync; unlink test

    Run the above and tell us the output, it might be a really slow disk I/O

    Thanked by 1rsk
  • DewlanceVPSDewlanceVPS Member, Patron Provider

    Maybe your local internet speed is slow?

  • @DewlanceVPS said:
    Maybe your local internet speed is slow?

    Nope, because I have no problems ssh'n into various other VPSes. It doesn't happen on just one VPS provider, pretty much all of them every once in a while, so I was just wondering what I could do to determine the cause..when it happens.

    Right now everything is fine, but when it happens again I will try Mun's suggestion and report back.

    Thanks

  • rskrsk Member, Patron Provider
    edited February 2014

    Mun said: dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync; unlink test

    Run the above and tell us the output, it might be a really slow disk I/O

    @gutshotz do exactly this. When a lot of process are hogging the CPU+i/o, it leads what you are facing (OpenVZ).

  • gutshotzgutshotz Member
    edited February 2014

    Ok, so it slowed down again just now and I ran those tests:

    16384+0 records in
    16384+0 records out
    1073741824 bytes (1.1 GB) copied, 23.9563 s, 44.8 MB/s
    

    What does it mean? Running the same test on another, very responsive VPS, gave:

    16384+0 records in
    16384+0 records out
    1073741824 bytes (1.1 GB) copied, 1.06269 s, 1.0 GB/s
    

    Quite the difference, so I take it 44.8MB/S means something on the VPS is hogging resources?

    I just tried it again on the slow VPS and it is now 90.3MB/s, but still nowhere near the 1.0GB/s of my RamNode VPS.

  • @gutshotz said:
    Ok, so it slowed down again just now and I ran those tests:

    > 16384+0 records in
    > 16384+0 records out
    > 1073741824 bytes (1.1 GB) copied, 23.9563 s, 44.8 MB/s
    > 

    What does it mean? Running the same test on another, very responsive VPS, gave:

    > 16384+0 records in
    > 16384+0 records out
    > 1073741824 bytes (1.1 GB) copied, 1.06269 s, 1.0 GB/s
    > 

    Quite the difference, so I take it 44.8MB/S means something on the VPS is hogging resources?

    I just tried it again on the slow VPS and it is now 90.3MB/s, but still nowhere near the 1.0GB/s of my RamNode VPS.

    Now wait for the server to be working fine and rerun the test, but 40 MBps is fine. Ramnode has very good I/O and isn't a good measure against your current VPS that is having issues.

  • It is responsive again, so I ran the test and got 90.8/MBs - pretty much the same as my last test. So that didn't really reveal the source of the slowdown...I'm going to try running mosh again, to see if that makes any difference.

  • My guess is still that you are having packet loss, try and do an MTR when you notice the slow down.

    Mun

  • Alright a couple of my sessions turned into molasses today, each on a different provider in different regions (NY and LV), and both had dd test results around the 40/MBs mark.

    When I ran 'mtr --report my.host.com' or 'mtr --report IP' the packets get lost after passing my local router (192.168.2.1). I even disabled the firewall on the VPSes, and made sure no local firewall wasn't stopping any packets. What is going on?

    HOST: server.local          Loss%   Snt   Last   Avg  Best  Wrst StDev
      1.|-- 192.168.2.1                0.0%    10    0.4   0.6   0.4   2.2   0.6
      2.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
    

    And a ping results in:

    PING server (142.22.13.77): 56 data bytes
    64 bytes from 142.22.13.77: icmp_seq=0 ttl=48 time=58.470 ms
    64 bytes from 142.22.13.77: icmp_seq=1 ttl=48 time=58.110 ms
    64 bytes from 142.22.13.77: icmp_seq=2 ttl=48 time=57.778 ms
    64 bytes from 142.22.13.77: icmp_seq=3 ttl=48 time=57.965 ms
    64 bytes from 142.22.13.77: icmp_seq=4 ttl=48 time=58.193 ms
    
    --- server ping statistics ---
    5 packets transmitted, 5 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 57.778/58.103/58.470/0.231 ms
    

    And mtr from one VPS to another:

    HOST: server                        Loss%   Snt   Last   Avg  Best  Wrst StDev
      1.|-- Node13.weloveservers.net   0.0%    10    0.0   0.0   0.0   0.1   0.0
      2.|-- host.colocrossing.com      0.0%    10    0.6   0.8   0.5   2.9   0.7
      3.|-- host.colocrossing.com      0.0%    10    0.5   0.6   0.5   0.7   0.1
      4.|-- host.colocrossing.com      0.0%    10    0.4   0.4   0.2   0.6   0.1
      5.|-- host.colocrossing.com      0.0%    10    0.3   0.3   0.2   0.5   0.1
    
  • VDS6VDS6 Member
    edited February 2014

    Add 'UseDNS no' to ssh config and /etc/init.d/ssh restart.
    It might help.

  • gutshotzgutshotz Member
    edited February 2014

    @VDS6 said:
    Add 'UseDNS no' to ssh config and /etc/init.d/ssh restart.
    It might help.

    already a standard setting in all my VPSes

Sign In or Register to comment.