日志输出时区问题


输出日志有这些信息
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端就会进行回收空闲连接 # 解决

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

mysql5.7碰到的坑的更多相关文章

  1. 那些在BAE上部署node.js碰到的坑

    在BAE上使用node.js半年多了,其中碰到了不少因为BAE云环境限制碰到的坑 写下来大家碰到了,也不用那么麻烦的去看好几天代码了,直接对症下药 官方公布的坑有: BAE是使用package.jso ...

  2. spring boot -- 无法读取html文件,碰到的坑

    碰到的坑,无法Controller读取html文件 1. Controller类一定要使用@Controller注解,不要用@RestController 2. resource目录下创建templa ...

  3. 运行Appium碰到的坑们

    运行Appium的时候,碰到的那些坑 1. java命令会出现error:could not open ...jvm.cfg 出现这种情况大多是因为电脑上之前安装过JDK,卸载重装之后,运行java命 ...

  4. 关于使用nodejs的mysql查询时碰到的坑

    今天在编写登录模块时,碰到一个隐蔽的坑,故记录一番 在使用Node.js的mysql模块的query方法时,查询语句使用了 `select password from login where name ...

  5. mysql-5.7.9-winx64遇坑记

    昨天在mysql5.0上导入sql文件时,一直卡在一个地方报错,也没仔细分析,认为应该是mysql版本太低不支持这个语法而已.遂决心下载一个最新版本的mysql,却浑然不知前面无数的坑已经埋伏好了在等 ...

  6. 微信小程序里碰到的坑和小知识

    本文作者:dongtao   来自:授权地址 本人低级程序员,以下bug不能确保在其它地方可以以相同的原因复现.同时, 出现很多bug的原因是小程序的基本知识还有编码的基本功不到位造成 路还很长,共勉 ...

  7. 在win8.1下安装laravel5.1时碰到的坑不少,但总算搞掂,真有点不容易。

    安装好php后,安装laravel的方法有如下几种. 1.先安装好composer, 再用composer下载资源并安装,命令如下: composer create-project laravel/l ...

  8. Angular 新手容易碰到的坑

    Q1.<div ng-include="views/user/show.html"></div> 错在哪里? 如果你这么写过,会发现这个位置啥也没有加载出来 ...

  9. Angular新手容易碰到的坑

    在Angular群里回答新手问题一段时间了,有一些Angular方面的坑留在这里备查,希望能对各位有所帮助.这个文章将来会随时更新,不会单独开新章,欢迎各位订阅. Q1.<div ng-incl ...

随机推荐

  1. Jquery表单验证

    .代码中添加引用(必备引用) <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript&quo ...

  2. iOS中如何隐藏启动图片的状态栏

    只隐藏启动图片顶部的状态栏,而不影响程序运行起来控制器的状态栏显示?在info.plist文件中添加一个Statis bar is...... 默认是NO改为YES即可

  3. Android Fragment 真正的完全解析(下)

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/37992017 上篇博客中已经介绍了Fragment产生原因,以及一些基本的用法和 ...

  4. c++打开浏览器

    调用外部命令 如果用默认浏览器,就调用ShellExecute(NULL, _T("open"), _T("explorer.exe"), _T("h ...

  5. git简单命令

    1. git status(不代参数) -- 查看本地修改过的文件 git status -s (简洁) 2. git add  -- 添加到暂存区 3. git commit -m '提交的mess ...

  6. js 练习

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="req_form.aspx.cs ...

  7. 在Excel中制作复合饼图

    在Excel中插入饼图时有时会遇到这种情况,饼图中的一些数值具有较小的百分比,将其放到同一个饼图中难以看清这些数据,这时使用复合条饼图就可以提高小百分比的可读性. 文中的复合饼图只是方便以后记忆,故不 ...

  8. What is the difference between routine , method , procedure , function ? please explain it with example?

    a method is named and attached to an object. so, for example, a method is like a function but is con ...

  9. CSS里width: auto\9 是什么意思

    color:red;//一般浏览器识别,字体颜色为红color:blue \9;//IE8,IE9及以上版本识别,字体颜色为蓝*color:orange;//IE7识别,字体颜色为橘色_color:b ...

  10. MySql的常用命令

    Ubuntu下的安装 打开"终端窗口",输入sudo apt-get update-->回车-->"输入root用户的密码"-->回车 输入s ...