Don’t Assume – Per Session Buffers
MySQL has a number of global buffers, i.e. your SGA. There are also a number of per session/thread buffers that combined with other memory usage constitutes an unbounded PGA. One of the most common errors in mis-configured MySQL environments is the setting of the 4 primary per session buffers thinking they are global buffers.
Global buffers include:
- key_buffer_size – For MyISAM Indexes (note you can define multiple key_buffer’s The MyISAM Key Cache)
- innodb_buffer_pool_size – For Innodb Table/Indexs
- innodb_additional_mem_pool_size – Innodb additional data dictionary data
- query_cache_size – The MySQL Query Cache
The four important per session buffers are:
I have seen people see these values > 5M. The defaults range from 128K to 256K. My advice for any values above 256K is simple. What proof do you have this works better? When nothing is forthcoming, the first move is to revert to defaults or a maximum of 256K for some benchmarkable results. The primary reason for this is MySQL internally as quoted by Monty Taylor – for values > 256K, it uses mmap() instead of malloc() for memory allocation.
These are not all the per session buffers you need to be aware of. Others include thread_stack, max_allowed_packet,binlog_cache_size and most importantly max_connections.
MySQL also uses memory in other areas most noticeably in internal temporary tables and MEMORY based tables.
As I mentioned, there is no bound for the total process memory allocation for MySQL, so some incorrectly configured variables can easily blow your memory usage.
References
- Read Buffer performance hit by Monty Taylor
参考:
http://ronaldbradford.com/blog/dont-assume-per-session-buffers-2010-03-08/
Don’t Assume – Per Session Buffers的更多相关文章
- More on understanding sort_buffer_size
There have been a few posts by Sheeri and Baron today on the MySQL sort_buffer_size variable. I want ...
- Go 2 Draft Designs
Go 2 Draft Designs 28 August 2018 Yesterday, at our annual Go contributor summit, attendees got a sn ...
- CESSNA: Resilient Edge-Computing
CESSNA: 弹性边缘计算 本文为SIGCOMM 2018 Workshop (Mobile Edge Communications, MECOMM)论文. 笔者翻译了该论文.由于时间仓促,且笔者英 ...
- Openfire的启动过程与session管理
说明 本文源码基于Openfire4.0.2. Openfire的启动 Openfire的启动过程非常的简单,通过一个入口初始化lib目录下的openfire.jar包,并启动一个 ...
- ORA-00030: User session ID does not exist.
同事在Toad里面执行SQL语句时,突然无线网络中断了,让我检查一下具体情况,如下所示(有些信息,用xxx替换,因为是在处理那些历史归档数据,使用的一个特殊用户,所以可以用下面SQL找到对应的会话信息 ...
- latch: cache buffers chains故障处理总结(转载)
一大早就接到开发商的电话,说数据库的CPU使用率为100%,应用相应迟缓.急匆匆的赶到现场发现进行了基本的检查后发现是latch: cache buffers chains 作祟,处理过程还算顺利,当 ...
- Session fixation--wiki
http://en.wikipedia.org/wiki/Session_fixation In computer network security, session fixation attacks ...
- Active Session History (ASH) Performed An Emergency Flush Messages In The Alert Log
Active Session History (ASH) Performed An Emergency Flush Messages In The Alert Log (文档 ID 1385872.1 ...
- tomcat集群时统计session与在线人数
tomcat集群时,原来通过HttpSessionListener实现类监听session的创建和销毁来统计在线人数的方法不再有效,因为不是每个人登陆都会在同一个tomcat服务器上,而在另一台tom ...
随机推荐
- 【LeetCode OJ】Pascal's Triangle II
Problem Link: http://oj.leetcode.com/problems/pascals-triangle-ii/ Let T[i][j] be the j-th element o ...
- PHP extract() 函数
PHP extract() 函数从数组中把变量导入到当前的符号表中. 对于数组中的每个元素,键名用于变量名,键值用于变量值. 第二个参数 type 用于指定当某个变量已经存在,而数组中又有同名元素时, ...
- JS实现Tab选项卡
http://www.jb51.net/article/24694.htm http://www.sunsean.com/idTabs/#t1 http://www.cnblogs.com/sskse ...
- C语言--- 字符串数组 、 预处理器和预处理指令 、 多文件编程 、 结构体
1 输入一个姓名,判断是否是五虎上将. 1.1 问题 本案例需要使用交互的方式判断:用户从控制台输入一个名字,由程序判断该名字是否在五虎上将的名单中.五虎上将的名单是:GuanYu.ZhangFei. ...
- hadoop权威指南 读书笔记
1 数据库和MapReduce对比 2 hadoop 包含的内容
- mySQL-CRUD操作(数据库的增删改查)练习题
一.设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表(一)~表(四)所示,数据如表1-2 ...
- selenium执行js报错
selenium执行js报错 Traceback (most recent call last): dr.execute_script(js) File "C:\Python27\l ...
- codeforce The Art of Dealing with ATM
题目大意 ATM取款机有n种不同的钱币kind[i],每次取款允许吐出不超过k张钱币,且钱币的种类数不能超过2(一开始没理解2的意思),现在有q次取款,钱数为ques,问ATM能否凑出这样的钱,若能的 ...
- centos 主从复制
1.主服务器rpm安装mysql 2.复制一台服务器叫slave(从服务器),一会儿要用 3.在主服务器,修改my.cnf文件 找到server-id,在它的下面加上 binlog-do-db = h ...
- 比较字符串,equals防空指针问题
1,比较两个字符串内容的话,用a.equals(b)比较,其中a,b是两个字符串,用a==b的话比较的是a和b的内存地址.2,如果一个字符串是变量,另一个字符串是常量的话,一定要把常量写在前面,变量写 ...