Making HAProxy 1.5 replication lag aware in MySQL

Stephane Combaudon explains how to tune the weight of a replica inside HAProxy depending on its replication lag using HAProxy 1.5.