溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Linux系統(tǒng)日志報(bào)“Time wait bucket table overflow”錯(cuò)誤怎么解決

發(fā)布時(shí)間:2022-01-21 11:31:07 來源:億速云 閱讀:346 作者:柒染 欄目:開發(fā)技術(shù)

Linux系統(tǒng)日志報(bào)“Time wait bucket table overflow”錯(cuò)誤怎么解決,相信很多沒有經(jīng)驗(yàn)的人對(duì)此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

問題現(xiàn)象

  • Linux系統(tǒng)日志/var/log/messages中全是類似“kernel: TCP: time wait bucket table overflow”的報(bào)錯(cuò)信息,提示“time wait bucket table”溢出,系統(tǒng)顯示類似如下。

    Feb 18 12:28:38 i-*** kernel: TCP: time wait bucket table overflow
    Feb 18 12:28:44 i-*** kernel: printk: 227 messages suppressed.
    Feb 18 12:28:44 i-*** kernel: TCP: time wait bucket table overflow
    Feb 18 12:28:52 i-*** kernel: printk: 121 messages suppressed.
    Feb 18 12:28:52 i-*** kernel: TCP: time wait bucket table overflow
    Feb 18 12:28:53 i-*** kernel: printk: 351 messages suppressed.
    Feb 18 12:28:53 i-*** kernel: TCP: time wait bucket table overflow
    Feb 18 12:28:59 i-*** kernel: printk: 319 messages suppressed.
  • 執(zhí)行以下命令,統(tǒng)計(jì)處于TIME_WAIT狀態(tài)的TCP連接數(shù),發(fā)現(xiàn)處于TIME_WAIT狀態(tài)的TCP連接非常多。

    netstat -ant|grep TIME_WAIT|wc -l

原因分析

參數(shù)net.ipv4.tcp_max_tw_buckets可以調(diào)整內(nèi)核中管理TIME_WAIT狀態(tài)的數(shù)量。當(dāng)實(shí)例中處于TIME_WAIT狀態(tài),及需要轉(zhuǎn)換為TIME_WAIT狀態(tài)的連接數(shù)之和超過net.ipv4.tcp_max_tw_buckets參數(shù)值時(shí),messages日志中將報(bào)“time wait bucket table” 錯(cuò)誤,同時(shí)內(nèi)核關(guān)閉超出參數(shù)值的部分TCP連接。您需要根據(jù)實(shí)際情況適當(dāng)調(diào)高net.ipv4.tcp_max_tw_buckets參數(shù),同時(shí)從業(yè)務(wù)層面去改進(jìn)TCP連接。

解決方法

  1. 執(zhí)行以下命令,統(tǒng)計(jì)TCP連接數(shù)。

    netstat -anp |grep tcp |wc -l
  2. 執(zhí)行以下命令,查詢net.ipv4.tcp_max_tw_buckets參數(shù)。如果確認(rèn)連接使用很高,則容易超出限制。

    vi /etc/sysctl.conf
  3. 根據(jù)現(xiàn)場情況,增加net.ipv4.tcp_max_tw_buckets參數(shù)值的大小。

  4. 執(zhí)行sysctl -p命令,使配置生效。

看完上述內(nèi)容,你們掌握Linux系統(tǒng)日志報(bào)“Time wait bucket table overflow”錯(cuò)誤怎么解決的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI