I have configured two MySQL servers (MySQL-1
, MySQL-2
) in master-master
replication in the same datacenter using a local backend connection with the following options:
innodb_flush_log_at_trx_commit=1
sync_binlog=1
We use a load balancer to round robin MySQL requests back and forth equally between the two MySQL servers. This works great, but I am concerned about replication lag. For example, if user A inserts a row into MySQL-1, then user A selects from MySQL-2, the data may have not been successfully replicated.
Basically, my question is, how much lag should be expected (milliseconds, seconds)? Are their anymore MySQL options to set to prevent/reduce lag?