MySQL DNS反解析過慢問題的解決辦法

來源:互聯網
上載者:User

最近發現新專欄的資料庫連接非常慢,登陸MySQL資料庫

mysql>show processlist;

| 20681949 | unauthenticated user | 10.10.4.193:52497 | NULL | Connect | | Reading from net | NULL |

| 20681948 | unauthenticated user | 10.10.4.193:52495 | NULL | Connect | | Reading from net | NULL

發現有非常多的 unauthenticated user 嘗試做登入使用 mysql 的情況 ,當這種情況無限制發生時就會造成系統十分緩慢。

查閱mysql官方網站得知,這屬於官方一個系統上的特殊設定,就把他當成mysql的一個bug算了。不管連結的的方式是經過 hosts 或是 IP 的模式,他都會對 DNS 做反查 mysqld 會嘗試去反查 IP -> dns ,由於反查解析過慢,就會無法應付過量的查詢。

解決辦法:

/usr/local/mysql/bin/mysqld_safe --skip-name-resolve --user=mysql&

加 --skip-name-resolve 這麼一個參數就可以,關閉mysql的dns反查功能。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.