Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The mysql5.7.22 table does not have a primary key and is updated when there is a large amount of data. Experimental verification results in a large number of master-slave delays.

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. introduction of the question

Mysql has three logging modes, which I summarize as follows:

Now, I am doing experiments to verify the last conclusion of the master-slave delay: "the table does not have a primary key and is updated when there is a large amount of data, and the experimental verification leads to a large number of master-slave delay."

The experimental results are as follows: when mysql uses row mode, it encounters a special situation, which leads to the serious master-slave delay, which needs attention. The delay between master and slave can be several days. When deleting, updating and other operations, the deletion from the library is slow because there is no primary key, resulting in master-slave delay.

II. Test statistics

III. Environmental introduction

Two master-slave nodes: 192.168.7.20 master, 192.168.7.34 slave, Centos 7.5, ordinary machine, 2-core 4G

Mysql: mysql linux x86 / 64 5.7.22, row mode

Test table: test table t_trade_order, with more than 50 fields. 900000 pieces of data, this table data file 610m

IV. Testing steps

1. Create table t_trade_order

two。 Table insert 900000 data: mysql-uroot-p123456-P3301-S / data1/mysql3301/mysql.sock-D test

< t_trade_order.sq 3.查看备库是否延迟,延迟时间 :show slave status \G 4.删除90万数据,查看备库是否延迟,延迟时间 : delete from t_trade_order ; 五、配置一测试截图

6. Configuration 2 test screenshot

7. Configure screenshots of three scenarios

Copy parameter configuration in parallel:

Slave_parallel_type = LOGICAL_CLOCK

Slave_parallel_workers = 10

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report