当前位置:网站首页>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.
边栏推荐
- ImportError: libmysqlclient. so. 20: Cannot open shared object file: no such file or directory solution
- L2-007 家庭房产 (25 分)
- Did you forget to register or load this tag
- Neo4j installation tutorial
- Project practice - background employee information management (add, delete, modify, check, login and exit)
- Tcp/ip protocol (UDP)
- 误删Path变量解决
- MySQL completely uninstalled (windows, MAC, Linux)
- [number theory] divisor
- Error reporting solution - io UnsupportedOperation: can‘t do nonzero end-relative seeks
猜你喜欢
Use dapr to shorten software development cycle and improve production efficiency
How to configure flymcu (STM32 serial port download software) is shown in super detail
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_s instead
Machine learning notes week02 convolutional neural network
QT creator test
QT creator specify editor settings
自动机器学习框架介绍与使用(flaml、h2o)
Data dictionary in C #
02 staff information management after the actual project
Why can't I use the @test annotation after introducing JUnit
随机推荐
MySQL master-slave replication, read-write separation
AcWing 242. A simple integer problem (tree array + difference)
Learning question 1:127.0.0.1 refused our visit
Did you forget to register or load this tag
Pytorch基础
【博主推荐】C#MVC列表实现增删改查导入导出曲线功能(附源码)
Machine learning -- census data analysis
SSM整合笔记通俗易懂版
QT creator create button
Attention apply personal understanding to images
Remember a company interview question: merge ordered arrays
Tcp/ip protocol (UDP)
Heating data in data lake?
Armv8-a programming guide MMU (2)
[ahoi2009]chess Chinese chess - combination number optimization shape pressure DP
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
TCP/IP协议(UDP)
Software testing and quality learning notes 3 -- white box testing
软件测试-面试题分享
Did you forget to register or load this tag 报错解决方法