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参数繁多,是一个需要根据具体业务.软硬件环境 ...
随机推荐
- :观察者模式--Weather
#ifndef __WEATHER_H__ #define __WEATHER_H__ #include <list> #include <iostream> using na ...
- log4net 2.0.8 不支持core 数据库记录日志
经过反编译log4net 标准库的代码,原本有的数据库链接AdoNetAppender 在core里面引用的,没有掉了. 可能新版本会有.
- 用户登录页面——jdbc
登录页面程序login.jsp <%@ page language="java" import="java.util.*" pageEncoding=&q ...
- MyEclipse和Eclipse
Eclipse 分成3个子项目: ·平台Platform ·开发工具箱-Java Development Toolkit(JDT) ·外挂开发环境-Plug-in Development Enviro ...
- Convert the AScii to SAC file
readtable *.txt w sac filename.sac ch delta dela0 w over
- python map 常见用法
python map 常见用法2017年02月01日 19:32:41 淇怪君 阅读数:548版权声明:欢迎转载,转载请注明出处 https://blog.csdn.net/Tifficial/art ...
- Oracal
增删改查 1.增加数据表 Create table users ( userid VARCHAR2(4), username VARCHAR2(20), userpass VARCHAR2(20), ...
- 【MySQL】5.6.x InnoDB Error Table mysql.innodb_table_stats not found
[问题描述]: 检查error log的时候发现大量warnings: [Warning] InnoDB Error Table mysql.innodb_index_stats not found ...
- Java 继承extends、关键字super和this、多态、动态绑定
Manager 经理 extends Employee 雇员 "is-a"(是)关系是继承的一个明显特征.每个经理都是一名雇员. 从术语的角度讲,Manager是子类,Emplo ...
- mysql 批量kill
select concat('kill ',id,';') t from information_schema.processlist order by t