日志输出时区问题


输出日志有这些信息
2016-08-16T02:23:09.831827Z 112241 [Note] Aborted connection 112241 to db: 'test' user: 'admin_logs' host: 'ip' (Got an error reading communication packets)
时区信息比系统时间晚八个小时
mysql> show global variables like '%time%';
+----------------------------------+-------------------+
| Variable_name                    | Value             |
+----------------------------------+-------------------+
| binlog_max_flush_queue_time      | 0                 |
| connect_timeout                  | 10                |
| datetime_format                  | %Y-%m-%d %H:%i:%s |
| default_password_lifetime        | 0                 |
| delayed_insert_timeout           | 300               |
| explicit_defaults_for_timestamp  | ON                |
| flush_time                       | 0                 |
| have_statement_timeout           | YES               |
| innodb_flush_log_at_timeout      | 1                 |
| innodb_lock_wait_timeout         | 3                 |
| innodb_old_blocks_time           | 1000              |
| innodb_rollback_on_timeout       | OFF               |
| interactive_timeout              | 3600              |
| lc_time_names                    | en_US             |
| lock_wait_timeout                | 31536000          |
| log_timestamps                   | UTC               |
| long_query_time                  | 2.000000          |
| max_execution_time               | 0                 |
| net_read_timeout                 | 30                |
| net_write_timeout                | 60                |
| rpl_stop_slave_timeout           | 31536000          |
| slave_net_timeout                | 60                |
| slow_launch_time                 | 2                 |
| slow_query_log_always_write_time | 10.000000         |
| system_time_zone                 | CST               |
| thread_pool_idle_timeout         | 60                |
| time_format                      | %H:%i:%s          |
| time_zone                        | SYSTEM            |
| wait_timeout                     | 3600              |
+----------------------------------+-------------------+
从上面结果可以看到log_timestamps为UTC
修改日志格式时区为system
SET GLOBAL log_timestamps = SYSTEM;

线程池idle超时问题

现象


2016-08-16T10:34:05.578546+08:00 112225 [Note] Aborted connection 112225 to db: 'admin_pandatv_logs' user: 'admin_logs' host: '10.110.19.72' (Got an error reading communication packets)
2016-08-16T10:36:32.357267+08:00 112144 [Note] Aborted connection 112144 to db: 'admin_pandatv_logs' user: 'admin_logs' host: '10.110.19.73' (Got an error reading communication packets)
2016-08-16T10:37:35.649574+08:00 112243 [Note] Aborted connection 112243 to db: 'admin_pandatv_logs' user: 'admin_logs' host: '10.110.19.72' (Got an error reading communication packets)
2016-08-16T10:41:14.044258+08:00 112091 [Note] Aborted connection 112091 to db: 'admin_pandatv_logs' user: 'admin_logs' host: '10.110.19.72' (Got an error reading communication packets)
2016-08-16T10:43:58.980932+08:00 112228 [Note] Aborted connection 112228 to db: 'admin_pandatv_logs' user: 'admin_logs' host: '10.110.19.73' (Got an error reading communication packets)

原因

 


thread_pool_idle_timeout 设置的是60S
当有业务访问时,atlas会和mysql建立连接池,60S内如果持续有访问那么会复用该连接池,如果60S内无访问,那么mysql端就会进行回收空闲连接

解决


对于这种问题,个人觉得不用去刻意更改他,对于高并发业务这个错误不会出现,对于低并发业务重新建立一次连接本身也不会有多大性能损耗
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值