On MYSQL\MARIADB multithreading replication

Source: Internet
Author: User

Background:

MariaDB has supported the function of concurrent replication in 10.0.0.5, that is, multi-threaded copying from libraries. MySQL was first supported in 5.6.3. Currently there is no use of MySQL5.6 version, so temporarily only to mariadb some instructions, the later will be explained to MySQL.

For replication many classmates are already very familiar with, here slightly, in the replication process has 3 threads: Master on the IO thread and slave on the IO, SQL thread, the principle of replication can go Google search. From the library has always been the asynchronous replication of the main library, through show SLAVE STATUS can see the time from the library behind the main library, of course, this time is not necessarily accurate. A large part of the reason behind the main library from the library is that the program executes SQL on the main library in multiple threads, while copying the main library from the library has only one thread. This was always the case before MariaDB10.0.0 and MySQL5.6.3. In the later version of the support for multi-threaded replication, below to see how to open, and after the effect, currently only for MARIADB.


Description

MARIADB is added in the MYSQLD option group for the configuration file:

Slave-parallel-threads

I manually modified to 8, the parameter can be changed dynamically, before the change needs to stop slave. The effect after the modification:

You can see that there are 8 copies of the thread. Describes the ability to turn on multi-threaded replication.

MySQL is added in the MYSQLD option group of the configuration file:

Slave_parallel_workers

......

......

Multi-threaded replication solves the problem of delaying the main library from the library and is difficult to catch up with, and interested classmates can play the multi-threaded copy of MySQL.

References:

MariaDB multithreaded Replication Description: https://mariadb.com/kb/en/mariadb/parallel-replication/
MySQL multithreaded Copy Description: Http://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#sysvar_slave_parallel_workers

On MYSQL\MARIADB multithreading replication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.