As your main concern is to have an incremental backup solution, you can change the follow variables:
Changes:
innodb_max_dirty_pages_pct
- set it to 75, then innoDB will cache some changes and flush it to disk at once.
innodb_doublewrite
- Disable the innodb double write
sync_binlog
- Disable syn binlog
long_query_time
- increase the long query time or disable it (at the moment you are logging every single query)
Why slave delays?
Other think is, it looks to be a busy master, on master you are able to handle 768 connections at the same time, it means that 768 thread can be writing data to MySQL, and the server (if not having looking issues) will execute all these queries at same time. In the other end(slave), you have a single replication thread to execute all queries received from master, and if a query take 10 seconds to execute on slave, the only thread available to execute changes from master will be busy, in this case, some delay are expected.
In your case you also use the slave as a read only copy of the master, then the replication thread may also need to wait some other thread release lock on some rows to apply the changes.
my.cnf
.log-slave-updates
or not is the single factor in your environment that makes the difference between whether your slave can keep up or not.. correct?innodb_max_dirty_pages_pct
= 0,sync_binlog
= 1, the slave can keep up normally. But if I enable thelog-slave-updates
, the slave may lag behind the master for a long time. Looks like thesync_binlog
is the main culprit: mysqlperformanceblog.com/2009/01/21/…