<ubuntu ping響應慢 延遲嚴重的解決>,ubuntuping

來源:互聯網
上載者:User

<ubuntu ping響應慢 延遲嚴重的解決>,ubuntuping
 解決ubuntu反應慢、延遲問題  最近發現線下有幾台ubuntu server12.04.2的,ping  www.baidu.com反應慢的要命,ip配的也沒問題,dns解析寫的也完全ok,它奶奶的,ping 就是反應慢的要命,有時還不通,監控一直警示,煩的要命。  排除這幾項:試著新裝ubuntu server看看,ping 依舊存在此問題,centos、redhat玩多了,碰到這個還真是太相信自己水平,但就是解決不了ping的問題。 後來發現是因為/etc/nsswitch.conf檔案中hosts的配置有問題,做如下修改後正常: 

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

#hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4   //注釋掉此行
hosts:          files dns        //添加下面這行
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
~

 不用重啟,現在ping一切正常了。 問題錯在哪?   當需要提供nsswitch.conf檔案所描述的資訊的時候,系統將檢查含有適當info欄位的配置行。它按照從左向右的順序開始執行配置行中指定的方法。在預設情況下,如果找到期望的資訊,系統將停止搜尋。如果沒有指定action,那麼當某個方法未能返回結果時,系統就會嘗試下一個動作。有可能搜尋結束都沒有找到想要的資訊。  例如下面兩行nsswitch.conf檔案配置行: host nis files dns 通過#strace /etc/nsswitch.conf  可以查看到其實,延遲的原因是在nis這塊,它在調用搜尋nis庫時,一直找不到,耽誤過多的時間。繼續下一個搜尋,找到了。從而出現延遲。 參考部落格:http://www.cnblogs.com/cute/archive/2012/05/17/2506342.html       nsswitch.conf檔案的分析

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.