Sysbench 开启超线程/关闭超线程以及容器运行数据库的性能损耗
Sysbench 开启超线程/关闭超线程性能损耗
摘要
Stress-NG 测试完之后
突然想 使用sysbenchen也进行一次压测
验证一把 超线程对数据的性能影响.
压测命令
./sysbench \
--db-driver=pgsql \
--pgsql-host=10.24.2x.xx \
--pgsql-port=5432 \
--pgsql-user=xxxx \
--pgsql-password=password \
--pgsql-db=postgres \
--threads=10 --time=30 \
--events=0 \
--report-interval=10 \
--percentile=99 ../share/sysbench/oltp_read_write.lua \
prepare
./sysbench \
--db-driver=pgsql \
--pgsql-host=10.24.2x.xx \
--pgsql-port=5432 \
--pgsql-user=xxxx \
--pgsql-password=password \
--pgsql-db=postgres \
--threads=10 --time=30 \
--events=0 \
--report-interval=10 \
--percentile=99 ../share/sysbench/oltp_read_write.lua \
run
./sysbench \
--db-driver=pgsql \
--pgsql-host=10.24.2x.xx \
--pgsql-port=5432 \
--pgsql-user=xxxx \
--pgsql-password=password \
--pgsql-db=postgres \
--threads=10 --time=30 \
--events=0 \
--report-interval=10 \
--percentile=99 ../share/sysbench/oltp_read_write.lua \
cleanup
结果分析
| 是否开启超线程 | 事务效率(每秒) | 查询效率(每秒) | 最小响应时间(ms) | 平均响应时间 | 99%的响应时间 |
|---|---|---|---|---|---|
| 是 32核心/64线程 | 211.63 | 4329.45 | 20.03 | 47.22 | 102.97 |
| 否 32核心/32线程 | 217.78 | 4459.01 | 16.59 | 45.89 | 139.85 |
| 否 32核心/32线程 | 244.78 | 5011.98 | 14.43 | 40.82 | 97.55 |
| 关闭超线程提升 | 103% | 103% | 120% | 103% | 74% |
| 本地部署vsdocker | 112% | 112% | 115% | 112% | 143% |
注意1 效率提示部分 我都换算成了越大越好
注意2 除了99%响应时间,关闭超线程对数据库都有大约3%的性能提升
注意3 使用apt 本地文件部署. 比使用docker部署性能提升12%
本地文件启动命令, 注意ubuntu的不挑一样
/usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile restart
事务效率

查询效率

响应时间

开启超线程的结果
[ 10s ] thds: 10 tps: 184.66 qps: 3794.17 (r/w/o: 2665.11/740.54/388.51) lat (ms,99%): 909.80 err/s: 4.90 reconn/s: 0.00
[ 20s ] thds: 10 tps: 204.91 qps: 4186.76 (r/w/o: 2938.01/819.93/428.82) lat (ms,99%): 114.72 err/s: 5.00 reconn/s: 0.00
[ 30s ] thds: 10 tps: 244.90 qps: 5016.71 (r/w/o: 3519.61/982.40/514.70) lat (ms,99%): 80.03 err/s: 6.30 reconn/s: 0.00
SQL statistics:
queries performed:
read: 91238
write: 25439
other: 13332
total: 130009
transactions: 6355 (211.63 per sec.)
queries: 130009 (4329.45 per sec.)
ignored errors: 162 (5.39 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 30.0274s
total number of events: 6355
Latency (ms):
min: 20.03
avg: 47.22
max: 1124.25
99th percentile: 102.97
sum: 300089.92
Threads fairness:
events (avg/stddev): 635.5000/10.03
execution time (avg/stddev): 30.0090/0.01
关闭超线程的结果
[ 10s ] thds: 10 tps: 185.66 qps: 3793.26 (r/w/o: 2662.08/740.56/390.62) lat (ms,99%): 893.56 err/s: 4.20 reconn/s: 0.00
[ 20s ] thds: 10 tps: 243.81 qps: 5002.51 (r/w/o: 3511.78/975.32/515.41) lat (ms,99%): 81.48 err/s: 6.40 reconn/s: 0.00
[ 30s ] thds: 10 tps: 223.70 qps: 4590.28 (r/w/o: 3222.39/893.50/474.40) lat (ms,99%): 144.97 err/s: 6.70 reconn/s: 0.00
SQL statistics:
queries performed:
read: 94010
write: 26123
other: 13815
total: 133948
transactions: 6542 (217.78 per sec.)
queries: 133948 (4459.01 per sec.)
ignored errors: 173 (5.76 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 30.0383s
total number of events: 6542
Latency (ms):
min: 16.59
avg: 45.89
max: 1103.25
99th percentile: 139.85
sum: 300197.16
Threads fairness:
events (avg/stddev): 654.2000/15.81
execution time (avg/stddev): 30.0197/0.01
关闭超线程以及本地文件部署的效果
[ 10s ] thds: 10 tps: 243.35 qps: 4991.08 (r/w/o: 3504.25/972.02/514.80) lat (ms,99%): 82.96 err/s: 6.10 reconn/s: 0.00
[ 20s ] thds: 10 tps: 288.50 qps: 5892.27 (r/w/o: 4134.45/1152.11/605.71) lat (ms,99%): 68.05 err/s: 6.90 reconn/s: 0.00
[ 30s ] thds: 10 tps: 202.30 qps: 4163.91 (r/w/o: 2923.90/814.10/425.90) lat (ms,99%): 893.56 err/s: 6.50 reconn/s: 0.00
SQL statistics:
queries performed:
read: 105658
write: 29400
other: 15475
total: 150533
transactions: 7352 (244.78 per sec.)
queries: 150533 (5011.98 per sec.)
ignored errors: 195 (6.49 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 30.0331s
total number of events: 7352
Latency (ms):
min: 14.43
avg: 40.82
max: 2938.61
99th percentile: 97.55
sum: 300120.33
Threads fairness:
events (avg/stddev): 735.2000/39.34
execution time (avg/stddev): 30.0120/0.01
Sysbench 开启超线程/关闭超线程以及容器运行数据库的性能损耗的更多相关文章
- 利用 bat 批量处理命令实现手动控制mysql /Oracle 服务的开启和关闭
利用 bat 批量处理命令实现手动控制mysql /Oracle 服务的开启和关闭 因为最近在学习数据库的知识,主要学习的是oracle 数据库,然而好巧啊,java也是在学习,我们老师现在要我们做一 ...
- 程序中使用gc_enable() 和 gc_disable()开启和关闭
在理解PHP垃圾回收机制(GC)之前,先了解一下变量的存储. php中变量存在于一个zval的变量容器中.结构如下: 类型 值 is_ref refcount zval中,除了存储变量的类型和值之外, ...
- win7系统服务print spooler 无法启动解决方法(开启及关闭方法)
以下是小编从新浪博客一个大雕博客中找到的“print spooler 无法启动”解决方法,请您仔细参考. 在下的系统是Windows7正式版,因为经常要制作PDF文件,所以对虚拟打印机使用较多,在下的 ...
- jboss7的服务器开启和关闭命令
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- 使用外部容器运行spring-boot项目:不使用spring-boot内置容器让spring-boot项目运行在外部tomcat容器中
前言:本项目基于maven构建 spring-boot项目可以快速构建web应用,其内置的tomcat容器也十分方便我们的测试运行: spring-boot项目需要部署在外部容器中的时候,spring ...
- 通过C#来开启、关闭、重启Windows服务
通过C#开启服务需要这个C#程序有相应权限,比如服务的账户是Local System的就必须以管理员权限运行C#程序才能开启或关闭. 这里只写重启的方式(就是先关闭,后开启): // Security ...
- redis---安装和开启和关闭
转redis---安装和开启和关闭 http://blog.csdn.net/xing_____/article/details/38457463 系统:centos6.4 redis下载:http: ...
- 使用python中的matplotlib 画图,show后关闭窗口,继续运行命令
使用python中的matplotlib 画图,show后关闭窗口,继续运行命令 在用python中的matplotlib 画图时,show()函数总是要放在最后,且它阻止命令继续往下运行,直到1.0 ...
- service: no such service mysqld 与MySQL的开启,关闭和重启
1.问题原因与解决办法 因为修改了MySQL临时文件的目录后,使用service mysqld restart重启MySQL出现如下错误: service: no such service mysql ...
- win7休眠的开启与关闭方法命令行操作和图文结合的鼠标操作
win7休眠的开启与关闭方法 从開始菜单中找到"附件→命令提示符",手工输入例如以下命令:powercfg -a.从这里能够清楚的看到,计算机是支持休眠的.显示"尚未启用 ...
随机推荐
- 数仓专家面对面 | 为什么我选择GaussDB(DWS)
摘要:你知道数仓是如何应运而生的吗?你了解数仓未来的发展趋势吗?想知道国内数仓专家的看法吗? 导语 数据仓库的发展一直是备受关注的议题,随着近年来技术的不断演进,数仓也在更新迭代. 你知道数仓是如何应 ...
- 教你如何优雅的改写“if-else”
摘要:这些场景,你是怎么写的代码? if-else,这是个再正常不过的coding习惯,当我们代码量小的时候用来做条件判断是再简单不过的了.但对于优秀程序员来说,这却不是好代码. 不信你往下看- 1. ...
- 看FusionInsight Spark如何支持JDBCServer的多实例特性
摘要:采用多主实例模式的HA方案,不仅可以规避主备切换服务中断的问题,实现服务不中断或少中断,还可以通过横向扩展集群来提高并发能力. 本文分享自华为云社区<FusionInsight Spark ...
- vue2升级vue3:class component的遗憾
在vue2,class 写法真的非常爽 import { Component as tsc } from 'vue-tsx-support'; import { Component, Watch } ...
- C# CRC8
C# CRC8 C# /// /// This enum is used to indicate what kind of checksum you will be calculating. /// ...
- EXECL函数
1 COUNTIF 对比两列数据,有相同的即计为1 找一列空白列,输入=COUNTIF(范围,条件),按回车,然后再点击表格右下角的"+" 就可以拉动持续执行这个函数 2 CONC ...
- ZK--简介,部署
官网:https://zookeeper.apache.org/ 本文zk版本:3.7.0 一.简介 ZooKeeper 是一个高可用的分布式数据管理与系统协调软件,它可以为分布式应用提供状态同步.配 ...
- 【Logging 日志库】Cpp 日志库 boost::log 以及 glog 的对比
日志能方便地诊断程序原因.统计程序运行数据,是大型软件系统必不可少的组件之一.本文将从设计上和功能上对比 C++ 语言常见的两款日志库: boost::log 和 google-glog . 设计 b ...
- 【每日一题】1. tokitsukaze and Soldier (优先队列 + 排序)
题目链接:Here 思路:这道题很容易看出来是考察 优先队列(priority_queue) 和 sort . 对于容忍人数越高的人来说,团队人数低也更能做到: for i = 0 to n - 1: ...
- Django 对实体的增删改查样例
class UserInfo(models.Model): """ 人员信息 """ user_id = models.CharField( ...