MySQL--数据超时相关参数
===============================================
connect_timeout
connect_timeout用在client和server之间建立连接时等待的握手超时时间,仅在登录时有效。在网络不好或网络丢包导致重试的情况下可适当增加该值,否则保留默认值即可。
The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake. The default value is 10 seconds as of MySQL 5.1.23 and 5 seconds before that.
Increasing the connect_timeout value might help if clients frequently encounter errors of the form Lost connection to MySQL server at ‘XXX’, system error: errno.
===============================================
wait_timeout
The number of seconds the server waits for activity on a noninteractive connection before closing it.
On thread startup, the session wait_timeout value is initialized from the global wait_timeout value or from the global interactive_timeout value, depending on the type of client (as defined by the CLIENT_INTERACTIVE connect option to mysql_real_connect()).
===============================================
interactive_timeout
The number of seconds the server waits for activity on an interactive connection before closing it. An interactive client is defined as a client that uses the CLIENT_INTERACTIVE option to mysql_real_connect().
wait_timeout和interactive_timeout在MySQL 5.7版本默认值为28800秒=8小时,用来设置连接处于不活动状态后多长时间未激活则关闭该连接。
wait_timeout作用于非交互式连接,而interactive_timeout作用于交互式连接。
===============================================
net_write_timeout和net_read_timeout
net_write_timeout
The number of seconds to wait for a block to be written to a connection before aborting the write.
net_read_timeout
The number of seconds to wait for more data from a connection before aborting the read. When the server is reading from the client, net_read_timeout is the timeout value controlling when to abort. When the server is writing to the client, net_write_timeout is the timeout value controlling when to abort.
===============================================
slave_net_timeout
The number of seconds to wait for more data from a master/slave connection before aborting the read. Setting this variable has no immediate effect. The state of the variable applies on all subsequent START SLAVE commands.
当从库在slave_net_timeout阀值时间内未获得主库的同步信息,会断定与主库的连接出现问题,并尝试关闭当前连接并重新建立新连接。
===============================================
delayed_insert_timeout
作用于MyISAM引擎表,在INSERT DELAY中止前等待INSERT语句的时间
How many seconds an INSERT DELAYED handler thread should wait for INSERT statements before terminating.
===============================================
innodb_lock_wait_timeout
innodb_lock_wait_timeout仅作用于innodb的行锁,对表锁的等待无效。当执行的语句等待行锁时间超过innodb_lock_wait_timeout阀值后,会回滚该语句,但不会回滚整个事务。在高并发的OLTP系统中,可以适当降低该阀值来降低锁等待的时间。可以在线修改全局或回话级别的innodb_lock_wait_timeout参数。
The length of time in seconds an InnoDB transaction waits for a row lock before giving up. The default value is 50 seconds. A transaction that tries to access a row that is locked by another InnoDB transaction waits at most this many seconds for write access to the row before issuing the following error:
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
When a lock wait timeout occurs, the current statement is rolled back (not the entire transaction). To have the entire transaction roll back, start the server with the --innodb_rollback_on_timeout option.
===============================================
innodb_rollback_on_timeout
InnoDB rolls back only the last statement on a transaction timeout by default. If --innodb_rollback_on_timeout is specified, a transaction timeout causes InnoDB to abort and roll back the entire transaction.
默认innodb_rollback_on_timeout被关闭,当innodb_rollback_on_timeout被指定时,最后一条语句超时会导致整个事务发生回滚。
MySQL--数据超时相关参数的更多相关文章
- MySQL Disk--磁盘相关参数
/sys/block/sda/queue/nr_requests 磁盘队列长度.默认只有 128 个队列,可以提高到 512 个.会更加占用内存,但能更加多的合并读写操作,速度变慢,但能读写更加多的量 ...
- 数据库相关文章转载(1) MySQL性能优化之参数配置
1.目的: 通过根据服务器目前状况,修改Mysql的系统参数,达到合理利用服务器现有资源,最大合理的提高MySQL性能. 2.服务器参数: 32G内存.4个CPU,每个CPU 8核. 3.MySQL目 ...
- MySQL性能优化之参数配置
1.目的: 通过根据服务器目前状况,修改Mysql的系统参数,达到合理利用服务器现有资源,最大合理的提高MySQL性能. 2.服务器参数: 32G内存.4个CPU,每个CPU 8核. 3.MySQL目 ...
- MySQL优化二 缓存参数优化
数据库属于 IO密集型的应用程序,其主要职责就是数据的管理及存储工作.而我们知道,从内存中读取一个数据库的时间是微秒级别,而从一块普通硬盘上读取一个IO是在毫秒级别,二者相差3个数量级.所以,要优化数 ...
- Mysql性能优化之参数配置(转)
前言: Mysql作为数据库中广泛应用的开源产品,需要面对不同的生产压力,而有些性能问题通过配置优化就可以得到解决,优化可以分为几个方向:1.优化参数配置.2.优化数据库索引.3.优化数据库结构,如分 ...
- MySQL 各种超时参数的含义
MySQL 各种超时参数的含义 今日在查看锁超时的设置时,看到show variables like '%timeout%';语句输出结果中的十几种超时参数时突然想整理一下,不知道大家有没有想过,这么 ...
- MySQL 主从复制相关参数
列举了MySQL主从复制主要的相关参数 binlog server_id 服务器在集群中唯一标识符 log_bin[=binlog_name] 启动二进制日志 log_bin_index 二进制日志索 ...
- MYSQL连接相关参数和状态值详解
针对mysql的连接参数和状态值,本文做些介绍和对比 一.MYSQL连接参数变量 1.常用连接数限制参数 show variables like '%connect%'; | max_connect_ ...
- MySQL相关参数总结
保留个原文链接,避免被爬虫爬了过去,以便后续更正补充:https://www.cnblogs.com/wy123/p/11273023.html MySQL参数繁多,是一个需要根据具体业务.软硬件环境 ...
随机推荐
- VSTO:使用C#开发Excel、Word【1】
<Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath >——By Eric C ...
- Invalid MEX-file: caffe.mexa64 的解决方案
http://blog.csdn.net/iamzhangzhuping/article/details/53105708
- matlab中diff的用法
若是diff(),括号里的元素为向量,那么前一个减后一个即为diff后的结果: 若diff(),括号里的元素为矩阵,那么下一行减上一行即为diff 后的结果:
- ubuntu apache ssl配置
参考连接: http://blog.csdn.net/sky_qing/article/details/44303221 http://blog.sina.com.cn/s/blog_6ad62438 ...
- android-DNS服务找不到
1.重启eclipse 2.重新建立AVD 3.在建立AVD时sd卡数值不要填
- L290 英语中级班-3月上
1元音饱满度 a [ei] name gamee [i:] he she mei [ai] fine likeo [ou] go homeu [ u:] use blue 2口音适应 刚开始说时,慢点 ...
- shell脚本实例-for实现批量主机的探测
#!/usr/bin/bash >ip.txt for i in {2..254} do { ip=192.168.234.$i ping -c1 -W1 $ip &>/dev/n ...
- jetty调优
jetty服务器使用遇到一下内存溢出的问题: java.lang.OutOfMemoryError: unable to create new native thread 无法创建新的进程 方法: ...
- MYSQL锁表问题解决
本文实例讲述了MYSQL锁表问题的解决方法.分享给大家供大家参考,具体如下: 很多时候!一不小心就锁表!这里讲解决锁表终极方法! 案例一 ? 1 mysql>show processlist; ...
- springBoot AOP学习(一)
AOP学习(一) 1.简介 AOp:面向切面编程,相对于OOP面向对象编程. Spring的AOP的存在目的是为了解耦.AOP可以让一切类共享相同的行为.在OOP中只能通过继承类或者实现接口,使代码的 ...