MariaDB 10 Parallel Replication — Latency Test Results

Test Parameters:
sysbench  --test=/root/sysbench0.5/sysbench/tests/db/insert.lua 
--mysql-table-engine=innodb --oltp-table-size=1000000 
--max-requests=0 --max-time=300 --num-threads=16 
--oltp-tables-count=10 --report-interval=10 
--mysql-host=10.8.8.100 --mysql-port=3312 --mysql-user=admin 
--mysql-password=123456  --mysql-db=test run
 

10 tables with 1 million rows each, 16 concurrent threads, pure insert operations.

 

  1. MySQL Parameters:
  2. sync_binlog = 0
  3. innodb_flush_log_at_trx_commit = 0
  4. innodb_flush_method = O_DIRECT
  5. innodb_flush_neighbors = 1
  6. innodb_buffer_pool_size = 10G
  7. innodb_io_capacity = 500
  8. innodb_log_file_size = 512M
  9. innodb_log_files_in_group = 3
  10. innodb_log_buffer_size = 16M

Regular Replication Latency:
 

  1. Master_Log_File: mysql-bin.000004
  2. Read_Master_Log_Pos: 567748597
  3. Relay_Log_File: host-100-relay-bin.000005
  4. Relay_Log_Pos: 66853042
  5. Relay_Master_Log_File: mysql-bin.000003
  6. Slave_IO_Running: Yes
  7. Slave_SQL_Running: Yes
  8. Replicate_Do_DB: 
  9. Replicate_Ignore_DB: 
  10. Replicate_Do_Table: 
  11. Replicate_Ignore_Table: 
  12. Replicate_Wild_Do_Table: 
  13. Replicate_Wild_Ignore_Table: 
  14. Last_Errno: 0
  15. Last_Error: 
  16. Skip_Counter: 0
  17.  
  1. Exec_Master_Log_Pos: 469504741select 1024-469504741/1024/1024+567748597/1024/1024;
  2. +----------------------------------------------+
  3. | 1024-469504741/1024/1024+567748597/1024/1024 |
  4. +----------------------------------------------+
  5. |                                1117.69264221 |
  6. +----------------------------------------------+
  7. 1 row in set (0.00 sec)
  8. MariaDB [(none)]> 

 

1117MB still lagging behind

 

Parallel Replication (8 concurrent threads, GTID mode disabled) Latency:

  1. Master_Log_File: mysql-bin.000022
  2. Read_Master_Log_Pos: 333773843
  3. Relay_Log_File: host-100-relay-bin.000073
  4. Relay_Log_Pos: 134217580
  5. Relay_Master_Log_File: mysql-bin.000021
  6. Slave_IO_Running: Yes
  7. Slave_SQL_Running: Yes
  8. Replicate_Do_DB: 
  9. Replicate_Ignore_DB: 
  10. Replicate_Do_Table: 
  11. Replicate_Ignore_Table: 
  12. Replicate_Wild_Do_Table: 
  13. Replicate_Wild_Ignore_Table: 
  14. Last_Errno: 0
  15. Last_Error: 
  16. Skip_Counter: 0
  17. Exec_Master_Log_Pos: 722396020

 

  1. MariaDB [(none)]> select 1024-722396020/1024/1024+333773843/1024/1024;
  2. +----------------------------------------------+
  3. | 1024-722396020/1024/1024+333773843/1024/1024 |
  4. +----------------------------------------------+
  5. |                                 653.38101101 |
  6. +----------------------------------------------+
  7. 1 row in set (0.00 sec)

 

653MB still lagging behind

 

Parallel Replication (8 concurrent threads, GTID mode enabled) Latency:

  1. Master_Log_File: mysql-bin.000002
  2. Read_Master_Log_Pos: 365095829
  3. Relay_Log_File: host-100-relay-bin.000008
  4. Relay_Log_Pos: 134217572
  5. Relay_Master_Log_File: mysql-bin.000001
  6. Slave_IO_Running: Yes
  7. Slave_SQL_Running: Yes
  8. Replicate_Do_DB: 
  9. Replicate_Ignore_DB: 
  10. Replicate_Do_Table: 
  11. Replicate_Ignore_Table: 
  12. Replicate_Wild_Do_Table: 
  13. Replicate_Wild_Ignore_Table: 
  14. Last_Errno: 0
  15. Last_Error: 
  16. Skip_Counter: 0
  17. Exec_Master_Log_Pos: 811005100
  1. MariaDB [(none)]> select 1024-811005100/1024/1024+365095829/1024/1024;
  2. +----------------------------------------------+
  3. | 1024-811005100/1024/1024+365095829/1024/1024 |
  4. +----------------------------------------------+
  5. |                                 598.74778080 |
  6. +----------------------------------------------+
  7. 1 row in set (0.00 sec)

598MB still lagging behind

 

Conclusion:

In this test, parallel replication was more than twice as fast as regular replication.

Leave a Comment

Your email address will not be published.