MySQL Reliability Recipes

MySQL at peak runs out of connections with ERROR 1040. Replica lag is the quieter failure: it serves stale reads and logs nothing, so you need an alert for it. Start with Fix MySQL ERROR 1040 Too Many Connections.