码迷,mamicode.com
首页 > 数据库 > 详细

MariaDB链接超时优化

时间:2016-05-31 11:55:14      阅读:2235      评论:0      收藏:0      [点我收藏+]

标签:

查看mysql server超时时间:

MariaDB [(none)]> use xspeeder;

MariaDB [xspeeder]> show global variables like %timeout%;

+----------------------------+----------+
| Variable_name              | Value    |
+----------------------------+----------+
| connect_timeout            | 10       |
| deadlock_timeout_long      | 50000000 |
| deadlock_timeout_short     | 10000    |
| delayed_insert_timeout     | 300      |
| innodb_lock_wait_timeout   | 50       |
| innodb_rollback_on_timeout | OFF      |
| interactive_timeout        | 28800    |
| lock_wait_timeout          | 31536000 |
| net_read_timeout           | 30       |
| net_write_timeout          | 60       |
| slave_net_timeout          | 3600     |
| thread_pool_idle_timeout   | 60       |
| wait_timeout               | 28800    |
+----------------------------+----------+
设置超时时间,临时生效(以秒为单位): 
 
  msyql> set global wait_timeout=86400;

  msyql> set global interactive_timeout=86400;

修改配置文件/etc/my.cnf.d/server.conf
        在 [mysqld]下添加
            wait_timeout=86400

默认超时时间是28800即8个小时
86400为24个小时

 

MariaDB链接超时优化

标签:

原文地址:http://www.cnblogs.com/sysk/p/5545106.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!