14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发
14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发 InnoDB 使用操作系统threads 来处理用户的事务请求。(事务可以执行很多请求到InnoDB 在它们提交或者回 滚前) 在现代的操作系统和多核服务器,
上下文切换是有效的,很多的负载运行很多在没有任何并发数限制。 可扩展性改进在MySQL 5.5和以上版本按降低了并发数量的限制 它是有助于减少上下文切换在threads之间,InnoDB 可以使用一些技术来限制并发执行操作系统threads的数 量
(因此,在任何一个时间点处理的请求数). 当InnoDB 接收一个新的请求从一个用户会话,如果threads的并发数量在一个预先定义的限制, 新的请求sleep 短暂的时间在它再次尝试之前,请求不能被重新安排在sleep 被放入到 first-in/first-out 队列
你可以限制并发线程数 通过设置 innodb_thread_concurrency. mysql> show variables like '%innodb_thread_concurrency%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| innodb_thread_concurrency | 0 |
+---------------------------+-------+
1 row in set (0.00 sec) 一旦 执行的threads 达到这个限制,额外的threads 会等待数微妙, 此前, 它需要经验来找到优化的值对于innodb_thread_sleep_delay, 优化的值可以改变依赖复杂, 在MySQL 5.6.3 和更高的版本,你可以设置配置选项 innodb_adaptive_max_sleep_delay 到允许的对于innodb_thread_sleep_delay, InnoDB 自动调整innodb_thread_sleep_delay 高或者低 依赖于当前的thread-scheduling activity 这个动态调整有助于thread scheduling 机制来工作平顺的 在系统是负载较轻的和接近于满负荷 InnoDB 使线程sleep只有当 并发的线程数受限制, 当对于线程数没有限制的时候, 所有的线程都会被调度。也就是说, 如果 innodb_thread_concurrency是0, innodb_thread_sleep_delay 会被忽略。 当这里有限制限制时( 当innodb_thread_concurrency 值大于0), InnoDB 降低上下文负载通过允许多个请求 在单个SQL语句执行期间来进入InnoDB 没有关注 innodb_thread_concurrency的设置。 因为一个SQL语句(比如一个关联)
可能 包含多个行记录在InnoDB,InnoDB 分配一个指定数量的tickets 允许一个线程被调度多次 以最小的开销 当一个SQL 语句启动, 一个thread 没有tickets, 它必须观察innodb_thread_concurrency。 一旦线程有权进入InnoDB, 它会被分配一个 rickets的number 可以用于随后进入InnoDB 来执行记录操作。 如果tickets 用完, thread 被驱逐,innodb_thread_concurrency 再次观察,可以放置thread 到 等待thread 的first-in/first-out queue。 当thread 是再次允许进入InnoDB, tickets 再次被分配。 分配的tickets 的数量是通过全局变量 innodb_concurrency_tickets指定,默认是5000 mysql> show variables like '%innodb_concurrency_tickets%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| innodb_concurrency_tickets | 5000 |
+----------------------------+-------+
1 row in set (0.00 sec) 一个thread 等待一个lock 是给一个ticket 一旦locks 变的可用 那些变量的争取的值依赖你的环境和负载, 尝试一些不同的值来决定最合适的值对你的应用。 在限制并发执行threads的数量, 重新查询配置选项 可能改善InnoDB的性能
14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发的更多相关文章
- 14.6.6 Configuring Thread Concurrency for InnoDB 配置线程并发
14.6.6 Configuring Thread Concurrency for InnoDB 配置线程并发 InnoDB 使用操作系统线程来处理请求(用户事务) 事务可能执行很多次在它们提交或者回 ...
- 14.6.11 Configuring Optimizer Statistics for InnoDB 配置优化统计信息用于InnoDB
14.6.11 Configuring Optimizer Statistics for InnoDB 配置优化统计信息用于InnoDB 14.6.11.1 Configuring Persisten ...
- 15.6.6 Configuring Thread Concurrency for InnoDB
innodb_thread_concurrency 设置inndb线程个数,如果超过则休眠一段时间,时间根据 innodb_thread_sleep_delay 单位为微妙,然后放进队列. innod ...
- MySQL InnoDB配置并发线程( innodb_thread_concurrency)
http://www.ywnds.com/?p=9821 一.thread_concurrency 首先,最重要的一点,这个参数已经在最新版本的MySQL中被移除了,官方最新5.7版本的doc上面对t ...
- 14.6.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB 主线程IO 速率:
14.6.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB 主线程IO 速率: 主线程 在InnoDB 是一个线程 执行各种任务在后台. ...
- 14.4.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB Master Thread I/O Rate
14.4.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB Master Thread I/O Rate 主的master thread ...
- 14.6.7 Configuring the Number of Background InnoDB IO Threads 配置InnoDB IO Threads的数量
14.6.7 Configuring the Number of Background InnoDB IO Threads 配置InnoDB IO Threads的数量 InnoDB 使用后台线程来服 ...
- 14.6.2 Configuring InnoDB for Read-Only Operation
14.6.2 Configuring InnoDB for Read-Only Operation 配置InnoDB只读操作 你可以查询InnoDB 表MySQL 数据目录是一个只读介质,通过启用 - ...
- 14.4.7 Configuring the Number of Background InnoDB IO Threads 配置 后台InnoDB IO Threads的数量
14.4.7 Configuring the Number of Background InnoDB IO Threads 配置 后台InnoDB IO Threads的数量 InnoDB 使用bac ...
随机推荐
- 基于visual Studio2013解决C语言竞赛题之0906文件插入
题目
- 道格拉斯—普克(Douglas一Peukcer)节点抽稀算法
Douglas一Peukcer算法由D.Douglas和T.Peueker于1973年提出,简称D一P算法,是眼下公认的线状要素化简经典算法.现有的线化简算法中,有相当一部分都是在该算法基础上进行改进 ...
- Xcode6使用storyboard在TabBarController上建立三个以上Item
在Xcode5上做以上的操作没有问题,这次是要在Xcode6上实现之,特记录以备用. 首先新建一个storyboard文件.取名Custom.storyboard.拖动菜单添加一个TabBarComt ...
- [置顶] CopyU!v2插件合集 [2013年7月18日更新]
这里提供了所有可供CopyU!v2使用的功能插件,您可以根据自己的需要下载安装使用,需要提醒您的是,安装过多的插件会影响CopyU!的运行性能,请合理的安装使用! 1.打包插件 版本:1.0.12.1 ...
- cocos2d-x的经历(含源码——)
源于手游的火爆和大环境的影响,最近在学习cocos2d-x.其实以前一直有想搞andriod和ios的尝试,可惜本屌丝没钱买mac os x,只好先开始学习andriod,于是买了小米2s作为测试机, ...
- Spring笔记 - Bean xml装配
命名空间表 aop Provides elements for declaring aspects and for automatically proxying @AspectJannotated c ...
- FileStream -- 复制文件
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Windows NT 技术简介
Windows NT 技术简介 NT:New Technoly(新技术,因比DOS.WIN9X采用了很多新技术而得名) Windows NT基本介绍 WindowsNT是Microsoft推出的面向工 ...
- python编写网络抓包分析脚本
python编写网络抓包分析脚本 写网络抓包分析脚本,一个称手的sniffer工具是必不可少的,我习惯用Ethereal,简单,易用,基于winpcap的一个开源的软件 Ethereal自带许多协议的 ...
- 基于visual Studio2013解决C语言竞赛题之1011对称
题目 解决代码及点评 /* 11. 判断一个给定的5×5方阵是否以第3列为轴线对称? */ #include <stdio.h> #include <s ...