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参数繁多,是一个需要根据具体业务.软硬件环境 ...
随机推荐
- 《Python》常用模块之collections模块
内置的数据类型: int float complex str list tuple dict set 基础数据类型: int float complex str list tuple ...
- 使用GCD控制网络请求
当,当山峰没有棱角的时候 当河水不再流 当时间停住日夜不分 当天地万物化为虚有!,,,,不好意思跑题了! 当我们在一个页面中需要进行多次网络请求才能满足页面所有的显示需要的时候,我们需要控制这些请求全 ...
- SQL-19 查找所有员工的last_name和first_name以及对应的dept_name,也包括暂时没有分配部门的员工
题目描述 查找所有员工的last_name和first_name以及对应的dept_name,也包括暂时没有分配部门的员工CREATE TABLE `departments` (`dept_no` c ...
- Problem B 字符串类(I)
封装一个字符串类,用于存储字符串和处理的相关功能,支持以下操作: 1. STR::STR()构造方法:创建一个空的字符串对象. 2. STR::STR(const char *)构造方法:创建一个字符 ...
- leetcode第15题:三数之和
给定一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?找出所有满足条件且不重复的三元组. 注意:答案中不可以包含重复的三元组. ...
- zabbix 监控java通用
监控工具 jstat jstack http://www.blogjava.net/jjshcc/archive/2014/03/05/410655.html https://www.cnblogs. ...
- jetty404web界面服务器信息隐藏
jetty服务器报以上的404错误时,为了信息安全必须隐藏信息错误提示 在jetty的配置文件jetty.xml添加以下内容: 重启一下jetty服务器就OK了,在验证时是这样的:
- python flask大型项目目录
Hello World 作者背景 应用程序简介 要求 安装 Flask 在 Flask 中的 “Hello, World” 下一步? 模板 回顾 为什么我们需要模板 模板从天而降 模板中控制语句 模板 ...
- C# Notepad++ 环境配置
第一种方法,使用NppExec插件 1.下载安装插件 NppExec https://nchc.dl.sourceforge.net/project/npp-plugins/NppExec/NppEx ...
- vue学习--自定义全局vue组件
文档目录: |--components |-loading(组件文件夹) |-loading.vue (loading组件核心) |-index.js //配置导出组件,并且install 主要配置到 ...