溫馨提示×

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

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

MySQL Aborted_connects值不斷增大的可能性原因分析

發(fā)布時(shí)間:2021-11-16 09:33:24 來(lái)源:億速云 閱讀:666 作者:柒染 欄目:MySQL數(shù)據(jù)庫(kù)

這篇文章給大家介紹MySQL Aborted_connects值不斷增大的可能性原因分析,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。

最近登錄數(shù)據(jù)庫(kù),查看Aborted_clients的值,發(fā)現(xiàn)在不斷增大。

mysql(mdba@localhost:test 03:36:36)>show global status like 'abort%';
+------------------+---------+
| Variable_name    | Value   |
+------------------+---------+
| Aborted_clients  | 5185350 |
| Aborted_connects | 1788    |
+------------------+---------+
2 rows in set (0.00 sec)

mysql(mdba@localhost:test 03:36:37)>show global status like 'abort%';
+------------------+---------+
| Variable_name    | Value   |
+------------------+---------+
| Aborted_clients  | 5185351 |
| Aborted_connects | 1788    |
+------------------+---------+
2 rows in set (0.00 sec)




mysql(mdba@localhost:test 03:36:38)>show global status like 'abort%';
+------------------+---------+
| Variable_name    | Value   |
+------------------+---------+
| Aborted_clients  | 5185352 |
| Aborted_connects | 1788    |
+------------------+---------+
2 rows in set (0.00 sec)




mysql(mdba@localhost:test 03:36:39)>show global status like 'abort%';
+------------------+---------+
| Variable_name    | Value   |
+------------------+---------+
| Aborted_clients  | 5185355 |
| Aborted_connects | 1788    |
+------------------+---------+
2 rows in set (0.00 sec)


原因分析:


Aborted Clients值解釋?zhuān)?br/>
The number of connections that were aborted because the client died without closing the connection properly.


當(dāng)abort clients增大的時(shí)候意味著有客戶(hù)端成功建立連接,但是很快就斷開(kāi)連接或者被終止了,這種情況一般發(fā)生在網(wǎng)絡(luò)不穩(wěn)定的環(huán)境中。
主要的可能原因有:


  a)客戶(hù)端沒(méi)有主動(dòng)關(guān)閉mysql連接mysql_close()。


  b)wait_timeout設(shè)置很短被mysql干掉了。


  c)客戶(hù)端由于某些原因被干掉了。


Aborted Connection值解釋?zhuān)?br/>

The number of failed attempts to connect to the MySQL server.


當(dāng)有大量的鏈接連接不上mysql的時(shí)候,這個(gè)數(shù)值就會(huì)激增。
主要的可能原因有:


  a)沒(méi)有授權(quán)或者密碼不對(duì)。一般錯(cuò)誤日志中會(huì)有如下報(bào)錯(cuò)(Access denied for ‘user’@‘host’)


  b)連接數(shù)滿(mǎn)了。一般報(bào)錯(cuò)包含(too many connections)


  c)超過(guò)鏈接時(shí)間限制,主要有這個(gè)參數(shù)控制connect_timeout(mysql默認(rèn)是10s,基本除非網(wǎng)絡(luò)環(huán)境極端不好,一般不會(huì)超時(shí)。)

關(guān)于MySQL Aborted_connects值不斷增大的可能性原因分析就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。

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

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

AI