Ohh I missed the whole idea that nginx is used as tcp balancer for mysql. But imo it is still more simple (unless you can't do anything with the DB server) to balance the remote server rather than split and bind local clients: upstream backend { least_conn; server ip1:3306; server ip2:3306; server ip3:3306; } rr