Runbook - Percentage of max connections on postgres server - RaaS - Remedy as-a Service - Confluence
Remediation Steps:
Take output of the below query and also terminate the idle session when 1st alert appears. Forward the query output to R&D and DB team.
select pid,datname,usename,application_name,left(query,150),pg_terminate_backend(pid) FROM pg_stat_activity where pid != pg_backend_pid() and state='idle' and state_change < now()-'15 minutes'::interval;
2. Set an alert for max connection >95% . This is when we execute terminate all idle session mentioned below.
SELECT pid,datname,usename,application_name,left(query,150),pg_terminate_backend(pid) FROM pg_stat_activity where pid != pg_backend_pid() and state='idle' ;
2 events per month
1.5 hours per month
I want it... | No rush - I just think it's cool |
I think we can drop this.