Skip to content

Conversation

@GregSutcliffe
Copy link

Similar to previous PRs. Tested against csb2.stg, check that host for the 3 new items (1 here, 2 direct via the agent) and triggers.

Signed-off-by: Greg Sutcliffe <centos@emeraldreverie.org>
@GregSutcliffe GregSutcliffe assigned arrfab and unassigned arrfab Nov 28, 2025
@GregSutcliffe GregSutcliffe requested a review from arrfab November 28, 2025 13:38
@GregSutcliffe GregSutcliffe changed the base branch from master to staging November 28, 2025 13:59

# Check idle_connections in PostgreSQL
cd /tmp # avoid dir_read issues with sudo
idle=$(sudo -u postgres psql koji -A -t -F" " \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need/want to hardcode a db name for postgresql activity itself, as koji db doesn't exist everywhere :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, let me template that

# Check idle_connections in PostgreSQL
cd /tmp # avoid dir_read issues with sudo
idle=$(sudo -u postgres psql koji -A -t -F" " \
-c "select state, count(*) from pg_stat_activity where state = 'idle' and pid <> pg_backend_pid() group by 1 order by 1;" |\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering (just another metric) selecting active, idle , others, and the three together == count() from pg_stat_activity , or just count() from pg_activity ?

select count(*) from pg_stat_activity ; 
 count 
-------
    91

 select state, count(*) from pg_stat_activity  where pid <> pg_backend_pid() group by 1 order by 1;
 state  | count 
--------+-------
 active |     4
 idle   |    93
        |     5

There can be time were there is no active connections and that's fine too (so sending zero)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants