200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > mysql数据库binlog是否可能会读取脏数据 – 数据库 – 前端 mysqld safe 失败

mysql数据库binlog是否可能会读取脏数据 – 数据库 – 前端 mysqld safe 失败

时间:2024-06-28 10:13:30

相关推荐

mysql数据库binlog是否可能会读取脏数据 – 数据库 – 前端 mysqld safe 失败

根据之前的经验这套测试环境在 120 个表 + 240 个并发的情况,可以取得一个性能上的极大值;所以在这里就直接使用这个作为测试压力。

8.0.19 场景

第一步:安装。

dbma-cli-single-instance –port=3306 –max-mem=131072 \–pkg=mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz install

第二步:创建测试用户。

create user sysbench@’%’ identified by ‘sysbench’;create database tempdb;grant all on tempdb.* to sysbench@’%’;

第三步:填充数据并进行压力测试。

sysbench –mysql-host=192.168.100.10 –mysql-port=3306 –mysql-user=sysbench \–mysql-password=sysbench –tables=120 –table_size=100000 –mysql-db=tempdb \–time=3600 –threads=240 oltp_point_select preparesysbench –mysql-host=192.168.100.10 –mysql-port=3306 –mysql-user=sysbench \–mysql-password=sysbench –tables=120 –table_size=100000 –mysql-db=tempdb \–time=3600 –threads=240 oltp_point_select run

性能表现。

资源消耗情况。

8.0.20 + binlog 压缩

第一步:安装。

dbma-cli-single-instance –port=3306 –max-mem=131072 \–pkg=mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz install

第二步:创建测试用户。

create user sysbench@’%’ identified by ‘sysbench’;create database tempdb;grant all on tempdb.* to sysbench@’%’;– dbm-agent 默认会开启 binlog 压缩show global variables like ‘binlog_transaction_compression%’;+——————————————-+——-+| Variable_name | Value |+——————————————-+——-+| binlog_transaction_compression | ON || binlog_transaction_compression_level_zstd | 3|+——————————————-+——-+2 rows in set (0.00 sec)

第三步:填充数据并进行压力测试。

sysbench –mysql-host=192.168.100.10 –mysql-port=3306 –mysql-user=sysbench \–mysql-password=sysbench –tables=120 –table_size=100000 –mysql-db=tempdb \–time=3600 –threads=240 oltp_point_select preparesysbench –mysql-host=192.168.100.10 –mysql-port=3306 –mysql-user=sysbench \–mysql-password=sysbench –tables=120 –table_size=100000 –mysql-db=tempdb \–time=3600 –threads=240 oltp_point_select run

性能表现。

资源消耗情况。

8.0.20 + binlog 不压缩

第一步: 关闭 binlog 压缩功能。

set @@global.binlog_transaction_compression=’OFF’;show global variables like ‘binlog_transaction_compression%’;+——————————————-+——-+| Variable_name | Value |+——————————————-+——-+| binlog_transaction_compression | OFF || binlog_transaction_compression_level_zstd | 3|+——————————————-+——-+2 rows in set (0.01 sec)

第二步:进行压力测试。

sysbench –mysql-host=192.168.100.10 –mysql-port=3306 –mysql-user=sysbench \–mysql-password=sysbench –tables=120 –table_size=100000 –mysql-db=tempdb \–time=3600 –threads=240 oltp_point_select run

性能表现。

资源消耗情况。

结论

开启 binlog 压缩会对性能有影响,大概会让性能下降 1%,cpu 多消耗 1%。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。