I use HAProxy 1.5-dev21 to load balance PostgreSQL connections over some read-only Postgresql 9.2 servers.
Version 1.5 of HAProxy implements a pgsql-check option, similar to mysql-check.
Here is my typical HAProxy configuration for such pool:
listen pgsql_pool 0.0.0.0:10001
mode tcp
option pgsql-check user postgres
balance roundrobin
server slave1 10.0.0.1:5432 check
server slave2 10.0.0.2:5432 check
That works, I mean HAProxy detects that slave1/slave2 are up and I can connect normally to PG on port 10001, but I see such messages in postgresql logs, every 2 seconds, due to pgsql-check option:
2014-01-29 17:37:33 CET [17170] postgres postgres (10.0.0.10(56706)) LOG: could not receive data from client: Connection reset by peer
2014-01-29 17:37:35 CET [17173] postgres postgres (10.0.0.10(56707)) LOG: could not receive data from client: Connection reset by peer
Is there a way to fix this?
Maybe I am missing some configuration option somewhere?
Best Answer
I am not sure if this is really a problem. HAProxy documentation says that
Oh the other hand, mysql-check description is little more detailed:
Your log shows exactly this, so I don't think there is anything to worry about, but you might want to wait for pgsql experts or try at dba.stackexchange.com