there are two ways:
- to write bash script with condition if number of conn. is > 1000 send me email and put that script in crontab
- monitor it with external monitoring system like zabbix, nagios etc....
2016-04-04 18:00 GMT+03:00 Moreno Andreo <moreno.andreo@xxxxxxxxxx>:
Thanks, but this way I get the "sample" on that actual moment: what I'd need is to monitor, or to have something warning me like "Hey, You've got 2000 active connections! Time to grow up!" :-)Il 04/04/2016 16:54, Artem Tomyuk ha scritto:
You can achieve that just running simple query like
select count(*) from pg_stat_activity where state = 'active'
Cheers,
Moreno.-