Re: Monitoring and insight into NOTIFY queue - Mailing list pgsql-general

From Matthew Kelly
Subject Re: Monitoring and insight into NOTIFY queue
Date
Msg-id 1B77A079-857D-46CD-956F-D50257AFFB51@tripadvisor.com
Whole thread Raw
In response to Re: Monitoring and insight into NOTIFY queue  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
I just ran into monitoring this and came up with the following 1 liner for monitoring this in releases < 9.6 through
theSQL layer.  Once you are at 9.6 Jeff Janes solution is correct. 

It does make the assumption that the queue size is 8GB.  It can misjudge the queue usage by up to one file segment
size. If you are using this for nagios monitoring, however, that error just disappears as a couple thousandths of a
percentof noise. 

SELECT sum((pg_stat_file('pg_notify/' || pg_ls_dir)).size)/(8 * pow(1024, 3)) * 100 as notify_queue_usage_percent FROM
pg_ls_dir('pg_notify');



pgsql-general by date:

Previous
From: Ben Buckman
Date:
Subject: Using a VIEW as a temporary mechanism for renaming a table
Next
From: Andy Colson
Date:
Subject: Re: Using a VIEW as a temporary mechanism for renaming a table