Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
-- Check lag on replica SHOW REPLICA STATUS\G -- Seconds_Behind_Source -- Causes of lag: -- 1. Long transactions on primary -- 2. Network latency -- 3. Heavy read load on replica competing with SQL thread -- Reduce lag with parallel replication (MySQL 5.7+): -- slave_parallel_workers = 4 -- slave_parallel_type = LOGICAL_CLOCK -- Monitor in MySQL 8: SELECT * FROM performance_schema.replication_applier_status_by_worker;
Result
Open