MySQL semi-synchronous replication
Semi-synchronous features
Receiving ack or closing the semi-synchronization overtime
The slave library only sends an ack to the waiting thread of the master library after flushing the binlog to the repay log. After the
timeout is converted to asynchronous replication, when at least one semi-synchronous slave node catches up Up is, the main library will be automatically converted to semi-synchronous replication
Semi-synchronous must be open on both the master and slave libraries, otherwise it will be asynchronous replication
. Semi-synchronized with the time used for receiving (multiple IDC deployments have at least one slave locally) after_flush on
the main library side
-- only the last event needs to send ACK
after_sync -- the data from the slave library may exceed the data from the master library
after_commit -- the slave library will lose data , the main library waits
after_rollback after commit -- same as after_commit
transmit_start -- make judgment before sending binlog, all main library threads waiting for this point can not wait, directly commit
transmit_stop -- the main library wants to send binlog from the library to end Afterward_send_event
-- before sending binlog, do you need to send ACK information from the library
after_send_event -- after the binlog is sent,
after_reset_master -- after the reset_master statement is executed
Semi-synchronous slave side
Semi-synchronous implementation
Plug-in installation
Semi-synchronous automatic switch
MySQL5.7 multi-threaded replication
Delay optimization method
Increase buffer_pool size, cache more data, reduce IO pressure
Increase log_buffer_size and group, reduce buffer_pool brush IO, improve write performance
Modify flush_method For O_DIRECT, improve write performance
If possible, turn off binlog from the library, or log_slave_uodates and
modify the parameter innodb_flush_log_at_trx_commit to 0 or 2.
If binlog is not turned off, modify the parameter sync_binlog to 0 or a larger number to reduce IO pressure
MySQL5.6 Multi-threaded replication
1. There are more databases
2. The writing of each database is relatively uniform
Because the MySQL 5.6 replication distribution level is set to the library
MySQL 5.7 multi-threaded replication
All transactions in the prepare phase can submit
last_commit
ordered commit in parallel
mysql operation and maintenance diary
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325352872&siteId=291194637
Recommended
Ranking