【转载】How long is “too long” for MySQL Connections to sleep?
From:http://dba.stackexchange.com/questions/1558/how-long-is-too-long-for-mysql-connections-to-sleep
|
I logged onto my server to check the status of the database and noticed on the
How do I set the time limit in MySQL 5.0.51a-3ubuntu5.4? Note: I am using PHP 5.2.x and symfony framework 1.2. |
||||
|
mysqld will timeout DB Connections based on two(2) server options:
Both are 28800 seconds (8 hours) by default. You can set these options in /etc/my.cnf If your connections are persistent (opened via mysql_pconnect) you could lower these numbers to something reasonable like 600 (10 min) or even 60 (1 min). Or, if your app works just fine, you can leave the default. This is up to you. You must set these as follows in my.cnf (takes effect after mysql restart):
If you do not want to restart mysql, then run these two commands:
This will not close the connections already open. This will cause new connections to close in 180 sec. |
|||||||||||||
|
【转载】How long is “too long” for MySQL Connections to sleep?的更多相关文章
- 【转载】 使用Anemometer基于pt-query-digest将MySQL慢查询可视化
原文地址:使用Anemometer基于pt-query-digest将MySQL慢查询可视化 作者:84223932 本文主要介绍使用Anemometer基于pt-query-digest将MySQL ...
- 转载---Beats:如何使用Filebeat将MySQL日志发送到Elasticsearch
在今天的文章中,我们来详细地描述如果使用Filebeat把MySQL的日志信息传输到Elasticsearch中.为了说明问题的方便,我们的测试系统的配置是这样的: 我有一台MacOS机器.在上面我安 ...
- 转载:centos7下使用yum安装mysql
转自:http://www.cnblogs.com/hwd-cnblogs/p/5213337.html CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql ...
- [转载] 运维角度浅谈:MySQL数据库优化
一个成熟的数据库架构并不是一开始设计就具备高可用.高伸缩等特性的,它是随着用户量的增加,基础架构才逐渐完善. 作者:zhenliang8,本文转自51CTO博客,http://lizhenliang. ...
- 【转载】MyBatis JdbcType 与Oracle、MySql数据类型对应关系详解
[原文链接]:MyBatis JdbcType 与Oracle.MySql数据类型对应关系详解 1. Mybatis JdbcType与Oracle.MySql数据类型对应列表 2. Mybatis ...
- mysql connections
在使用MySQL数据库的时候,经常会遇到这么一个问题,就是“Can not connect to MySQL server. Too many connections”-mysql 1040错误,这是 ...
- (转载)Mysql查找如何判断字段是否包含某个字符串
(转载)http://www.th7.cn/db/mysql/201306/31159.shtml 有这样一个需求,在Mysql数据库字符串字段(权限)中,用户有多个不同的邮箱,分别被‘,’分开,现在 ...
- (转载)mysql中百万级数据插入速度测试
(转载)http://www.111cn.net/database/mysql/42453.htm 100W的数据对于很多朋友来说算小菜了,但今天我就想到创建一个大量数据的测试环境,于是找了一下怎么插 ...
- MYSQL 50 基础题 (转载)
MYSQL 50 基础题 (转载) 前言:最近在强化MYSQL 能力 答案在(也是转载处) https://www.cnblogs.com/kangxinxin/p/11585935.html 下面是 ...
随机推荐
- Educational Codeforces Round 47 (Rated for Div. 2) :C. Annoying Present(等差求和)
题目链接:http://codeforces.com/contest/1009/problem/C 解题心得: 题意就是一个初始全为0长度为n的数列,m此操作,每次给你两个数x.d,你需要在数列中选一 ...
- linux进程 生产者消费者
#include<stdio.h> #include<unistd.h> #include<stdlib.h> #include<string.h> # ...
- jenkins 构建部署时tomcat7 内存溢出解决方案
在使用jenkins构建部署时一直出现tomcat7内存溢出 WARNING: Unexpected node monitoring termination: Clock Difference jav ...
- 从PRISM开始学WPF(一)WPF-更新至Prism7.1
原文:从PRISM开始学WPF(一)WPF-更新至Prism7.1 我最近打算学习WPF ,在寻找MVVM框架的时候发现了PRISM,在此之前还从一些博客上了解了其他的MVVM框架,比如浅谈WPF中的 ...
- 在WPF中自定义控件(3) CustomControl (下)
原文:在WPF中自定义控件(3) CustomControl (下) 在WPF中自定义控件(3) CustomControl (下) ...
- android .9图制作
andorid .9 图,可用于适配各种屏幕.制作的时候,很简单. 在stadio 里面,把鼠标放到图片的边界,点一下.这时候,图片的边缘会有黑块. 然后把鼠标放到黑块上,发现可以拉伸区域了. 这个区 ...
- 【个人训练】(POJ3279)Fliptile
最近在刷kuangbin神犇的各种套题....感觉自己好弱啊.....还是要多多训练,跟上大神的脚步.最近的这十几题都比较水,记下来这一条我比较印象深刻.也比较难的题目吧(之后应该不会再有水题写了,珍 ...
- ES6 语法糖
重新认识ES6中的语法糖:https://segmentfault.com/a/1190000010159725
- 第三十三篇 Python中关于OOP(面向对象)的常用术语
面向对象的优点 从编程进化论可知,面向对象是一种更高等级的结构化编程方式,它的好处主要有两点: 1. 通过封装明确了内外,你做为类的缔造者,你就是女娲,女娲造物的逻辑别人无需知道,女娲想让你知道,你才 ...
- Wannafly挑战赛21:C - 大水题
链接:Wannafly挑战赛21:C - 大水题 题意: 现在给你N个正整数ai,每个数给出一“好数程度” gi(数值相同但位置不同的数之间可能有不同的好数程度).对于在 i 位置的数,如果有一在j位 ...
What duration should the connection time limit be before the connection should be killed?