thread_pool_size的调整

根据mysql官方文档的定义,thread_pool_size定义为同时运行sql语句的mysql的线程数,是mysql thread最重要的

性能参数.说是商业版才可能调整,但是我使用percona 的版本也可以动态调整.

版本:percona 5.5.33-rel31.1-log Percona Server with XtraDB (GPL).

cpu: 双核,超线程

os:rhel 5.5

以下是测试结果:

mysql> set global thread_pool_size=1;

Query OK, 0 rows affected (0.00 sec)

[root@localhost tmp]# sysbench --test=oltp  --oltp-table-size=1000 --num-threads=32 --oltp-table-name=t1

--mysql-user=root --mysql-password=root  --mysql-db=frank --mysql-port=3306  run

total:                           492424

transactions:                        10000  (87.34 per sec.)

deadlocks:                           16451  (143.69 per sec.)

read/write requests:                 455973 (3982.54 per sec.)

other operations:                    36451  (318.37 per sec.)

[root@localhost tmp]# sysbench --test=oltp  --oltp-table-size=1000 --num-threads=64 --oltp-table-name=t1

--mysql-user=root --mysql-password=root  --mysql-db=frank --mysql-port=3306  run

transactions:                        10000  (57.63 per sec.)

deadlocks:                           42338  (244.00 per sec.)

read/write requests:                 871349 (5021.81 per sec.)

other operations:                    62338  (359.27 per sec.)

mysql> set global thread_pool_size=32;

Query OK, 0 rows affected (0.00 sec)

[root@localhost tmp]# sysbench --test=oltp  --oltp-table-size=1000 --num-threads=32 --oltp-table-name=t1

--mysql-user=root --mysql-password=root  --mysql-db=frank --mysql-port=3306  run

transactions:                        10000  (129.22 per sec.)

deadlocks:                           15736  (203.34 per sec.)

read/write requests:                 444481 (5743.47 per sec.)

other operations:                    35736  (461.77 per sec.)

[root@localhost tmp]# sysbench --test=oltp  --oltp-table-size=1000 --num-threads=64 --oltp-table-name=t1

--mysql-user=root --mysql-password=root  --mysql-db=frank --mysql-port=3306  run

transactions:                        10000  (358.17 per sec.)

deadlocks:                           44513  (1594.33 per sec.)

read/write requests:                 906167 (32456.43 per sec.)

other operations:                    64513  (2310.68 per sec.)

[root@localhost tmp]# sysbench --test=oltp  --oltp-table-size=1000 --num-threads=128

--oltp-table-name=t1 --mysql-user=root --mysql-password=root  --mysql-db=frank --mysql-port=3306  run

total:                           1915131

transactions:                        10000  (174.78 per sec.)

deadlocks:                           100061 (1748.87 per sec.)

read/write requests:                 1795070 (31374.22 per sec.)

other operations:                    120061 (2098.43 per sec.)

从上面的可以看出在thread_pool_size 为同时连接数(thread_running)的2倍的时候,性能最好.这个时候TPS的吞吐

量最大,达到358 TPS。通过极端,我设置为1,对应的TPS只有57.

mysql poolsize_thread_pool_size的调整相关推荐

  1. MySQL优化必须调整的10项配置

    来源:http://www.jb51.net/article/47419.htm 这篇文章主要介绍了MySQL优化必须调整的10项配置,使用这些方法可以让你快速地获得一个稳健的MySQL配置,需要的朋 ...

  2. MySQL高级-MySQL并发参数调整

    Mysql并发参数调整 1 max_connections 2 back_log 3 table_open_cache 4 thread_cache_size 5 innodb_lock_wait_t ...

  3. mysql file-pos_mysql-5.7 调整mysql的复制方式由master_log_file+master_log_pos 到gtid 详解

    一.祖传的master_log_file + master_log_pos的复制方式面临的问题: 在很久以前 那个时候我还没有出道,mysql就已经就有复制这个功能了.如果要告诉slave库从mast ...

  4. windows azure mysql data disk_调整Azure中虚拟机数据磁盘大小实践

    首先,在Azure中关于数据存储的付费规则中规定,只要你使用的不是Azure的XIO高级存储提供的I/O密集型的高吞吐低延迟的服务,那么得益于Azure存储设计中采用的稀疏文件方式存储,存储虚拟机VH ...

  5. mysql配置好后_安装完 MySQL 后必须调整的 10 项配置

    当我们被人雇来监测MySQL性能时,人们希望我们能够检视一下MySQL配置然后给出一些提高建议.许多人在事后都非常惊讶,因为我们建议他们仅仅改动几个设置,即使是这里有好几百个配置项.这篇文章的目的在于 ...

  6. mysql安装完后不能配置_安装完 MySQL 后必须调整的 10 项配置

    (www.hackbase.com 黑基网)当我们被人雇来监测MySQL性能时,人们希望我们能够检视一下MySQL配置然后给出一些提高建议.许多人在事后都非常惊讶,因为我们建议他们仅仅改动几个设置,即 ...

  7. MySQL: Connection Refused,调整 mysql.ini中的 max_connections

    连接相同的结构的MySQL数据库,一套库Tomcat启动正常,另一套库一直报Connection Refused. 可以断定是连接数太小了.查找mysql.ini中的 max_connections, ...

  8. mysql查看和调整最大连接数

    show variables like '%max_connections%';  查看最大连接数 set GLOBAL max_connections = 200;    调整最大连接数 转载于:h ...

  9. mysql中如何调整列的顺序,SQL Server 数据库调整表中列的顺序操作

    SQL Server 数据库中表一旦创建,我们不建议擅自调整列的顺序,特别是对应的应用系统已经上线,因为部分开发人员,不一定在代码中指明了列名.表是否可以调整列的顺序,其实可以自主设置,我们建议在安装 ...

最新文章

  1. 云计算技术推动供应链管理发展的5个原因
  2. 数据挖掘十大算法之—C4.5
  3. 第 5-6 课:Java 并发包中的高级同步工具 + 面试题
  4. 用c语言写出一个榜单程序,C语言依然位居榜单前列,依然值得程序员学习
  5. 演练 使用变量存储商品的数据 0126
  6. python代码中使用pip安装文件
  7. 【Flink】Could not complete the operation,Number of retries has been exhausted
  8. js 自动分配金额_深入解析Node.js事件循环工作机制
  9. poj 3256 Cow Picnic 优化深搜
  10. SecureCRT背景颜色设置
  11. Oracle查看表空间使用率及爆满解决方案
  12. 安装idea社区版并开发JavaWeb项目
  13. prometheus 异常退出 报错:opening storage failed
  14. Mal-amido-PEG2-acid,756525-98-1末端羧酸可在活化剂(如EDC或HATU)存在下与伯胺基反应
  15. Ubuntu 复制文件到远端时错误,Permission denied 失败原因深度探索
  16. python 从源码讲解random模块
  17. Kuick:创业大军中脱颖而出的少数派
  18. HOJ P2143 Song(贪心)
  19. 一个团购网站运营总监的自白
  20. 网络语音对讲有什么优势

热门文章

  1. 操作系统大作业模拟实现命令解释器_06 初识shell之系统命令基础
  2. idea 热部署无效
  3. java页面跳转t赋值_java servlet 几种页面跳转的方法及传值
  4. 简述Android 程序执行流程,Android系统启动流程简述
  5. mysql能存储的编码范围_mysql存储乱码之编码问题
  6. OpenShift 4 Tekton - Katacoda的Tekton Pipeline入门示例
  7. MYSQL学习(一) - 数据结构
  8. (三)微调VGG16以对服装进行分类
  9. 依赖反转原理,IoC容器和依赖注入:第3部分
  10. 微软发布首个 Chromium Edge stable 预览版