当前位置:网站首页>Aborted connection 1055898 to db:
Aborted connection 1055898 to db:
2022-07-06 11:22:00 【wx5caecf2ed0645】
mysql In the error log , Find a lot of similar information below :(mysql 5.7.18)
[Note] Aborted connection 1055898 to db: 'xxx' user: 'yyy' host: 'xxx.xxx.xxx.xxx' (Got timeout reading communication packets)
- 1.
such Aborted connection Under the circumstances ,mysql Will increase aborted_clients The value of the status counter . This also means the following questions :
(1) The client is connected normally , But it ended abnormally ( It may be that the program does not close the connection normally )
(2) client sleep More than wait_timeout、 or interactive_timeout Value ( This will cause the connection to be mysql closed )
(3) Client exception terminal , Or the query exceeds max_allowed_packet Value
- 1.
-
mysql> show variables like '%max_allowed_packet%'; -
+--------------------------+------------+ -
| Variable_name | Value | -
+--------------------------+------------+ -
| max_allowed_packet | 16777216 | -
| slave_max_allowed_packet | 1073741824 | -
+--------------------------+------------+
Of course , It may also be caused by other reasons . To be honest , Abnormal terminals are difficult to diagnose , It may also be with the network 、 Firewall related . Consider the following aspects :
1. If there are a large number of connection processes in sleep State time is long , That means the application is not correct 、 Close the database connection in time . It is strongly recommended to properly close the database connection in the application , Otherwise, we need to rely on mysql Of wait_timeout To close the connection .
2. It is recommended to check max_allowed_packet Value , Ensure that the value is set reasonably , In this way, the client will not receive "packet too large" Message tip . If the setting is unreasonable , The connection will be abnormally disconnected .
3. It is suggested to pay attention to the process time_wait Number . If netstat Found a large number of connections in time_wait state , It indicates that the connection closing problem of the proposed application end adjustment .
- 1.
-
# netstat -ano|grep TIME_WAIT -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:55586 TIME_WAIT timewait (32.97/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:55367 TIME_WAIT timewait (27.82/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:55776 TIME_WAIT timewait (37.09/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:56505 TIME_WAIT timewait (54.61/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:55553 TIME_WAIT timewait (31.94/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:56643 TIME_WAIT timewait (57.73/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:55221 TIME_WAIT timewait (23.70/0/0) -
tcp 0 0 xxx.xxx.xxx.xxx:10054 xxx.xxx.xxx.xxx:55920 TIME_WAIT timewait (41.18/0/0)
4. Make sure the transaction is correct 、 Submitted in time .
5. Ensure that there is no abnormal disconnection on the application side , such as php If set max_execution_time=5, Even if you increase connect_timeout The value of will not have an effect . Other programming languages have similar problems .
6. Check DNS Whether there is delay problem in the configuration . Check whether skip_name_resolve, And the use of IP Verify the host instead of using the host name . After setting this parameter , Use ip Verify the host , Instead of using host names . After using this parameter ,mysql In the authorization table host Column must be IP Address or localhost.
7. If it is percona, You can open the audit log .
8. increase net_read_timeout、net_write_timeout Value , And observe whether the error still occurs .net_read_timeout Rarely lead to errors , Unless the network environment is very poor .
The connection to the abnormal terminal is because the connection is not normal .server End will not cause connection abort, Unless the client / There is a network problem on the server . But this is also caused by the network , instead of server End of the problem . Network problems can be viewed with the help of tools , such as :tcpdump,netstat -s
Go back to the problem itself , Have a look first mysql Parameter Settings :
- 1.
-
mysql> show variables like '%timeout%'; -
+-----------------------------+----------+ -
| Variable_name | Value | -
+-----------------------------+----------+ -
| connect_timeout | 10 | -
| interactive_timeout | 1800 | -
| lock_wait_timeout | 31536000 | -
| net_read_timeout | 30 | -
| net_write_timeout | 60 | -
| wait_timeout | 1800 | -
+-----------------------------+----------+ -
mysql> show global variables like '%log_warning%'; -
+---------------+-------+ -
| Variable_name | Value | -
+---------------+-------+ -
| log_warnings | 2 | -
+---------------+-------+ -
1 row in set (0.00 sec) -
mysql>
If log_warnings The value is greater than 1,mysql Similar information will be written to the error log :
- 1.
-
[Warning] Aborted connection 305628 to db: 'db' user: 'dbuser' host: 'hostname' (Got an error reading communication packets) -
[Warning] Aborted connection 305627 to db: 'db' user: 'dbuser' host: 'hostname' (Got an error reading communication packets)
If you don't want to record this information in the log , It can be modified log_waring Value :
mysql>set global log_warnings=1;
- 1.
边栏推荐
猜你喜欢

学习问题1:127.0.0.1拒绝了我们的访问

Machine learning notes week02 convolutional neural network

Knowledge Q & A based on Apache Jena

CSDN markdown editor

Kept VRRP script, preemptive delay, VIP unicast details

安装numpy问题总结

One click extraction of tables in PDF

02-项目实战之后台员工信息管理

Django运行报错:Error loading MySQLdb module解决方法

QT creator test
随机推荐
How to set up voice recognition on the computer with shortcut keys
Codeforces Round #771 (Div. 2)
Machine learning notes week02 convolutional neural network
Antlr4 uses keywords as identifiers
Project practice - background employee information management (add, delete, modify, check, login and exit)
Basic use of redis
02-项目实战之后台员工信息管理
Picture coloring project - deoldify
Are you monitored by the company for sending resumes and logging in to job search websites? Deeply convinced that the product of "behavior awareness system ba" has not been retrieved on the official w
Solve the problem of installing failed building wheel for pilot
Did you forget to register or load this tag
Knowledge Q & A based on Apache Jena
Neo4j installation tutorial
Punctual atom stm32f103zet6 download serial port pin
机器学习--人口普查数据分析
一键提取pdf中的表格
What does usart1 mean
SSM整合笔记通俗易懂版
Ubuntu 20.04 安装 MySQL
The virtual machine Ping is connected to the host, and the host Ping is not connected to the virtual machine