I'm in the process of setting up replication in this topology:
/--B
A-
\--C--D
In order to achieve this I need log_slave_updates to be enabled on C, so D will also get the changes from A.
C is a pretty beefy server. Amazon EC2-based. 32 cores, 250GB memory and 20000 IOPS data volume. It's more powerful than A, which has less CPU power, memory and 3200 IOPS on its main disk.
As soon as I turn on log_slave_updates on C, it almost immediately falls behind A. This is odd to me because I would expect it to easily outperform, and in my mind log_slave_updates is just writing its log to disk.
I don't know where to start debugging this.
Edit Thanks for your follow-up questions, I added a bit more information here:
I did indeed create the EBS volume from a snapshot, but I warmed it up by reading every byte using dd this took a few days.
Output of SELECT @@INNODB_FLUSH_LOG_AT_TRX_COMMIT, @@SYNC_BINLOG\G is:
@@INNODB_FLUSH_LOG_AT_TRX_COMMIT: 2
@@SYNC_BINLOG: 1
This is the output of SHOW SLAVE STATUS a few minutes after turning log_slave_updates on again:
Slave_IO_State: Waiting for master to send event
Master_Host: anonimized
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.001253
Read_Master_Log_Pos: 969363410
Relay_Log_File: mysql-relay-bin.002984
Relay_Log_Pos: 44865262
Relay_Master_Log_File: mysql-bin.001253
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 910276312
Relay_Log_Space: 103952567
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 259
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 8c7641ba-a380-11e5-a8ee-0e920570e8cb
Master_Info_File: /mnt/mysql-data/database/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Reading event from the relay log
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
iostat -x when log_slave_updates is on:
Linux 4.4.0-53-generic (hostname) 01/07/2017 _x86_64_ (32 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.91 0.00 0.24 1.78 0.00 97.06
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
xvda 0.00 23.56 0.32 50.91 23.53 467.96 19.19 0.29 5.65 9.03 5.63 5.26 26.93
xvdf 0.00 61.33 93.76 163.17 9468.94 8128.52 136.98 1.14 4.44 8.68 2.00 1.89 48.48
iostat -x when log_slave_updates is off:
Linux 4.4.0-53-generic (hostname) 01/07/2017 _x86_64_ (32 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.91 0.00 0.24 1.78 0.00 97.07
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
xvda 0.00 23.55 0.32 50.89 23.52 467.82 19.19 0.29 5.65 9.03 5.63 5.26 26.92
xvdf 0.00 61.60 93.71 163.54 9463.81 8131.70 136.79 1.14 4.43 8.68 2.00 1.88 48.48