MySQL 4个timeout参数说明

4个timeout都是为了防止某一个链接长时间占用一数据库的描述符,又不干事情,或者网络有问题没有释放

这个描述符,线程阻塞种种资源浪费的情况.我们要主动的"卡"掉对端!

首先看看这4个timeout在mysql5.1手册里的英文解释:

connect_timeout
The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake.
interactive_timeout
The number of seconds the server waits for activity on an interactive connection before closing it.
wait_timeout
The number of seconds the server waits for activity on a noninteractive connection before closing it.
net_read_timeout
The number of seconds to wait for more data from a connection before aborting the read.
net_write_timeout
The number of seconds to wait for a block to be written to a connection before aborting the write.

从意思上可以理解为

connect_timeout在获取连接阶段(authenticate)起作用,

interactive_timeout和wait_timeout在连接空闲阶段(sleep)起作用,

net_read_timeout和net_write_timeout在连接繁忙阶段(query)起作用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值