postgresql - restrict the number of connections in postgres using an ip address -
is possible restrict number of connections in postgres, using ip address of machine, since i'm not able find ip address tagged user / role.
implicitly can pgbouncer - @ least 1.7 version supports hba file, can bond db+user+ip , set limit db+user in ini file. way limiting connections ip or network.
explicitly can try using haproxy's or iptables
(i think prefered way)
lastly can write monkey job check number of connection pg_stat_activity.client_addr
, select pg_terminate_backend(pid) pg_stat_activity client_addr = 'x.x.x.x' order query_started desc limit 10
(to keep first 10 connections), way awful wheel such task i'd say.
Comments
Post a Comment