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参数繁多,是一个需要根据具体业务.软硬件环境 ...
随机推荐
- 7.5 C++基本序列式容器
参考:http://www.weixueyuan.net/view/6402.html 总结: vector可以理解为可以在两端插入.删除数据的数组,它提供了丰富的成员函数,用于操作数据. begin ...
- ssh免密登陆
1:建立新用户hadoop 2:进入/home/hadoop/.ssh/目录 3:所有要免密连接的终端运行: ssh-keygen -t rsa 三次回车后会产生:id_rsa,id_rsa.pub两 ...
- centos7中docker操作
docker部署nginx 1. 下载nginx [root@localhost my.Shells]# docker images REPOSITORY TAG IMAGE ID CREATED S ...
- Java与C++简单对比
Java语言让编程者无法找到指针来直接访问内存,并且增添了自动的内存管理功能,从而有效的组织了C/C++语言中指针操作失误,如滥用指针所造成的系统崩溃,Java的指针在虚拟机内部使用,这保证了Java ...
- dubbo的几种配置方式(转)
昨天刚接触公司dubbo,发现公司中项目里面的spring-dubbo-privider的dubbo中<dubbo:application name=""/>和< ...
- ios 第4天
dealloc method 会在对象释放前调用这个方法(函数) 可以让对象在释放前把一些自己申请的对象 先释放了 满足 谁申请 谁释放 的原则 例如 dealloc 会自动调用 ...
- activemq spring 集成与测试
1.下载安装activemq 2.pom依赖配置 3.spring配置 4.生产消息,消费消息(同步消费),监听消息(异步消费) 4.测试 5.参考博客 http://www.cnblogs.com/ ...
- [Paper] LCS: An Efficient Data Eviction Strategy for Spark
Abstract Classical strategies do not aware of recovery cost, which could cause system performance de ...
- 手机号的 AES/CBC/PKCS7Padding 加解密
前言:接口中上次的手机号码和密码是传入的加密的,模拟自动化的时候也需要先对数据进行加密 1.各种语言实现 网上已经各种语言实现好的AES加密,可以点击查看:http://outofmemory.cn/ ...
- ES6 函数的扩展-rest参数
ES6 引入 rest 参数(形式为...变量名),用于获取函数的多余参数,这样就不需要使用arguments对象了.rest 参数搭配的变量是一个数组,该变量将多余的参数放入数组中. functio ...