V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xuboying
V2EX  ›  Ubuntu

Ubuntu ssh 每天第一次登陆奇慢无比

  •  
  •   xuboying · 2016-04-23 10:47:51 +08:00 · 4326 次点击
    这是一个创建于 2922 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我的 ubuntu server 版运行在家用虚拟机上,我发现每天第一次登陆总是非常慢,要 7 到 8 秒才出现下面内容,之后就快一些, 3 秒左右,是不是这个屏幕的信息读取导致了启动慢?
    但这个信息还是有用的,比如上次登录 IP 之类的

    他会在这个时刻去检查更新导致变慢么?
    74 packages can be updated.
    52 updates are security updates.



    Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 4.2.0-27-generic x86_64)

    * Documentation: https://help.ubuntu.com/

    System information as of Sat Apr 23 00:42:30 CST 2016

    System load: 0.08 Processes: 101
    Usage of /: 10.2% of 16.86GB Users logged in: 0
    Memory usage: 61% IP address for eth0: yyyyyyyy
    Swap usage: 0%

    Graph this data and manage this system at:
    https://landscape.canonical.com/

    74 packages can be updated.
    52 updates are security updates.

    Last login: Sat Apr 23 00:42:40 2016 from gggggggg
    第 1 条附言  ·  2016-04-23 16:25:25 +08:00
    解决了,是 mot 的原因,和 dns 关系不是太大


    https://askubuntu.com/questions/23246/how-do-i-edit-the-ssh-motd

    全部禁用以后就快了,缺点是没 ssh 后没信息了


    qqqqqqq@ubuntu:/etc/update-motd.d$ time /usr/bin/landscape-sysinfo
    System load: 0.32 Processes: 101
    Usage of /: 10.0% of 16.86GB Users logged in: 1
    Memory usage: 61% IP address for eth0: 192.168xxxxx
    Swap usage: 0%

    Graph this data and manage this system at:
    https://landscape.canonical.com/

    real 0m2.329s
    user 0m1.844s
    sys 0m0.480s


    qqqqqq@ubuntu:/etc/update-motd.d$ find
    .
    ./disable
    ./disable/50-landscape-sysinfo
    ./disable/90-updates-available
    ./disable/91-release-upgrade
    ./disable/98-reboot-required
    ./disable/10-help-text
    ./disable/98-fsck-at-reboot
    ./disable/00-header
    13 条回复    2016-04-23 17:38:20 +08:00
    402124773
        1
    402124773  
       2016-04-23 11:29:37 +08:00
    之前到网上看到过一个相关的问题分析,最后的原因好像是 DNS 网络的原因导致的,时间长了也不记得哪里看到的了
    Septembers
        2
    Septembers  
       2016-04-23 11:30:33 +08:00
    see http://www.cnblogs.com/ggjucheng/p/3348499.html
    主要原因是 GSSAPI 导致
    xuboying
        3
    xuboying  
    OP
       2016-04-23 13:22:57 +08:00
    @Septembers 不是这个问题,慢是密码输入以后
    ETiV
        4
    ETiV  
       2016-04-23 14:47:19 +08:00 via iPhone
    sshd_config 里加个 UseDNS no 再重启 ssh 看看?
    xuboying
        5
    xuboying  
    OP
       2016-04-23 14:58:44 +08:00 via Android
    @ETiV 我改了一台,明天看效果
    neilp
        6
    neilp  
       2016-04-23 15:46:50 +08:00
    应该是 dns 的问题。 先检查一下 服务器上那个的能正常解析域名吗. 我也遇到过
    Tink
        7
    Tink  
       2016-04-23 15:51:56 +08:00 via iPhone
    我跟你一样
    402124773
        9
    402124773  
       2016-04-23 16:12:50 +08:00
    @jackroyal
    好像是这个文章,随便看看的,看完就忘了。
    ssh , scp , rsync 确实是很方便的命令
    Tink
        10
    Tink  
       2016-04-23 16:15:54 +08:00 via iPhone
    应该是 dns ,我把服务器 ip 加到 hosts 里之后快多了
    akira
        11
    akira  
       2016-04-23 16:17:31 +08:00
    域名反向解析的原因吧
    xuboying
        12
    xuboying  
    OP
       2016-04-23 16:23:56 +08:00   ❤️ 1
    @402124773 @ETiV @Septembers @Tink @jackroyal @neilp

    解决了,是 mot 的原因,和 dns 关系不是太大


    https://askubuntu.com/questions/23246/how-do-i-edit-the-ssh-motd

    全部禁用以后就快了,缺点是没 ssh 后没信息了


    qqqqqqq@ubuntu:/etc/update-motd.d$ time /usr/bin/landscape-sysinfo
    System load: 0.32 Processes: 101
    Usage of /: 10.0% of 16.86GB Users logged in: 1
    Memory usage: 61% IP address for eth0: 192.168xxxxx
    Swap usage: 0%

    Graph this data and manage this system at:
    https://landscape.canonical.com/

    real 0m2.329s
    user 0m1.844s
    sys 0m0.480s


    qqqqqq@ubuntu:/etc/update-motd.d$ find
    .
    ./disable
    ./disable/50-landscape-sysinfo
    ./disable/90-updates-available
    ./disable/91-release-upgrade
    ./disable/98-reboot-required
    ./disable/10-help-text
    ./disable/98-fsck-at-reboot
    ./disable/00-header
    whatisnew
        13
    whatisnew  
       2016-04-23 17:38:20 +08:00
    如果不装 `ubuntu standard system utilities` 就没事
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5767 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 01:51 · PVG 09:51 · LAX 18:51 · JFK 21:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.