Learn about Centmin Mod LEMP Stack today
Become a Member

Troubleshoot Slow SSH Logins

Discussion in 'Centmin Mod Insights' started by eva2000, Jun 29, 2017.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    29,719
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    10:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin Mod on initial login has a few checks it does for the following
    • yum update checks
    • nginx version checks
    If you have slow SSH logins, it could be related to one of these checks. So to troubleshoot you can post a new thread in System Admin forums with info asked below:
    1. Who's the web host ?
    2. Which plan ?
    3. location of VPS ?
    4. Was it fast when you did initial install or was it always slow ?
    what is output for these commands
    Code (Text):
    yum clean all
    time yum repolist all
    

    Code (Text):
    time yum -v -d 9 list updates
    

    Code (Text):
    time yum -v -d 9 list updates --disableplugin=fastestmirror
    

    Code (Text):
    cat /root/centminlogs/yum-timedhosts.txt
    

    Code (Text):
    sort -k2 /var/cache/yum/x86_64/7/timedhosts.txt
    

    Code (Text):
    cat /etc/resolv.conf
    

    Code (Text):
    tail -1 $(ls -rt /root/centminlogs/cmm-login-git-checks* | tail -1)
    

    Code (Text):
    curl -Iv https://nginx.org/en/download.html
    

    For posting code you might want to use CODE tags for code How to use forum BBCODE code tags :)

    On a few of my slower login servers with 123.09beta01, I am seeing it hang around nginx version check

    process listing output command
    Code (Text):
    ps aufxw
    

    shows at hang time
    Code (Text):
    root     22322  0.0  0.0   9516  1728 pts/1    S+   17:07   0:00              |   \_ /bin/bash /usr/local/bin/dmotd
    root     22323  0.0  0.1 152536  4504 pts/1    S+   17:07   0:00              |       \_ curl -sL https://nginx.org/en/download.html
    root     22324  0.0  0.0   9096   892 pts/1    S+   17:07   0:00              |       \_ grep -E -o nginx\-[0-9.]+\.tar[.a-z]*
    root     22325  0.0  0.0   9876   964 pts/1    S+   17:07   0:00              |       \_ awk -F nginx- /.tar.gz$/ {print $2}
    root     22326  0.0  0.0  13324  1592 pts/1    S+   17:07   0:00              |       \_ sed -e s|.tar.gz||g
    root     22327  0.0  0.0   4324   644 pts/1    S+   17:07   0:00              |       \_ head -n 1
    root     22319  0.0  0.0   4316   704 pts/1    S+   17:07   0:00              \_ tee /root/centminlogs/cmm-login-git-checks_280617-170709.log
    

    so will check that too for me it was IPv6 networking related which I should of disabled but it was enabled
    Code (Text):
    curl -Iv https://nginx.org/en/download.html
    * About to connect() to nginx.org port 443 (#0)
    *   Trying 2606:7100:1:69::3f...
    * Connection timed out
    *   Trying 2001:1af8:4060:a004:21::e3...
    * Connection timed out
    *   Trying 206.251.255.63...
    * Connected to nginx.org (206.251.255.63) port 443 (#0)
    

    to disable IPv6 add to the bottom of /etc/sysctl.conf these 2 lines
    Code (Text):
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    

    then update via
    Code (Text):
    sysctl -p
    

    recheck and fast now connecting via IPv4 ip for nginx.org
    Code (Text):
     curl -Iv https://nginx.org/en/download.html
    * About to connect() to nginx.org port 443 (#0)
    *   Trying 95.211.80.227...
    * Connected to nginx.org (95.211.80.227) port 443 (#0)
    

    I tried re-enabling IPv6 removing the 2 added /etc/sysctl.conf and rebooted my server to see if it was network related and that fixed it for IPv6 connection to nginx.org and allowed fast ssh login to Centmin Mod 123.09beta01 based server as for me it was related to IPv6 issues
    Code (Text):
    curl -Iv https://nginx.org/en/download.html
    * About to connect() to nginx.org port 443 (#0)
    *   Trying 2606:7100:1:69::3f...
    * Connected to nginx.org (2606:7100:1:69::3f) port 443 (#0)
    

     
    Last edited: Jun 29, 2017
    • Informative Informative x 3
  2. eva2000

    eva2000 Administrator Staff Member

    29,719
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    10:47 AM
    Nginx 1.13.x
    MariaDB 5.5
    Another reason for slow SSH logins is due to the login Centmin Mod Git repo update check to alert you to updates available for Centmin Mod code at /usr/local/src/centminmod. SSH logins will be slower if there are actually Git updates available. You can thus speed up SSH logins if you setup Centmin Mod code at /usr/local/src/centminmod to auto update via cronjob outlined at https://community.centminmod.com/threads/cronjob-auto-updating-centmin-mod-code-guide.3398/. If cronjob auto updates the code, SSH login check for updates will go faster as there is no updates to check for.
     
Thread Status:
Not open for further replies.