Skip to Main Content
BMC Helix SaaSOps Ideas Portal
Status Will not do
Created by Guest
Created on Feb 17, 2025

Percentage of max connections on PG server

Runbook - Percentage of max connections on postgres server - RaaS - Remedy as-a Service - Confluence

Remediation Steps:

  1. 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
  • Attach files
  • Guest
    Reply
    |
    Feb 18, 2025

    I think we can drop this.