SHOW_POOL_HEALTH_CHECK_STATS(1)
โจ SHOW_POOL_HEALTH_CHECK_STATS โจ
okay bestie, gather round, because this one's from the pgpool-II 4.7.2 Documentation and it is lowkey iconic ๐ซถ the manpage is literally called SHOW_POOL...ECK_STATS(1) when it's all squished into the header, but the whole vibe is:
๐ NAME ๐
SHOW_POOL_HEALTH_CHECK_STATS โ show health check statistics data. that's it, that's the girl ๐
๐ธ SYNOPSIS ๐ธ
SHOW POOL_HEALTH_CHECK_STATS
no args, no flags, just pure unhinged confidence. she walks in, she says her name, she leaves. periodt ๐
๐ฆ DESCRIPTION ๐ฆ
so SHOW POOL_HEALTH_CHECK_STATS spills the tea on health check stats โ and yes, bestie, health check is a whole thing, it lives over in Section 5.9, โHealth Checkโ, in the documentation if you wanna go read up ๐ โ and most of this statistic data is collected by the health check process.
this command is genuinely a gift for a Pgpool-II admin who wants to study events related to health check, like fr fr.
for example โ and stay with me here โ an admin can easily locate the failover event in the log file by looking at the "last_failed_health_check" column. like, boom, there it is, the moment everything went sideways ๐ญ iconic detective work.
another example: you can find an unstable connection to backend by evaluating the "average_retry_count" column. if a particular node shows a higher retry count than the other node, then there may be a problem with the connection to the backend. that's it, that's the vibe check, and she is failing ๐
and then, to top it all off, Table 29, โStatistics data shown by pool_health_check_stats commandโ shows each column name and its description. every single one. we love a receipts moment ๐
more coming bestie, don't go anywhere ๐
Table 29. Statistics data shown by pool_health_check_stats command ๐
bestie this is the whole column-by-column tea โ every single field this command spits out, explained with zero gatekeeping:
node_idโ the backend node id ๐hostnameโ the backend hostname, or a UNIX domain socket path if that's how you're rolling ๐portโ the backend port number ๐ขstatusโ the backend status, and it's exactly one ofup,down,waiting,unusedorquarantine(yes that last one is giving dramatic but it's real ๐ )roleโ the role of the node. In streaming replication mode it's eitherprimaryorstandby. In any other mode it's eithermainorreplica๐last_status_changeโ timestamp of the last time the backend status changed โฐtotal_countโ number of health check counts in total ๐งฎsuccess_countโ number of successful health check counts in total โfail_countโ number of failed health check counts in total ๐ญskip_countโ number of skipped health check counts in total. If the node is alreadydown, health check skips the node ๐retry_countโ number of retried health check counts in total ๐average_retry_countโ number of average retried health check counts in a health check session ๐max_retry_countโ number of maximum retried health check counts in a health check session ๐max_durationโ maximum health check duration in milliseconds. If a health check session retries, the health check duration is the sum of each retried health check โmin_durationโ minimum health check duration in milliseconds. If a health check session retries, the health check duration is the sum of each retried health check ๐ฃaverage_durationโ average health check duration in milliseconds. If a health check session retries, the health check duration is the sum of each retried health check ๐last_health_checkโ timestamp of the last health check. If a health check has not been performed yet, it's an empty string ๐ซฅlast_successful_health_checkโ timestamp of the last successful health check. If a health check has not succeeded yet, it's an empty string ๐last_skip_health_checkโ timestamp of the last skipped health check. If a health check has not been skipped yet, it's an empty string. โ ๏ธ Note that it's possible for this field to be an empty string even if the status isdownโ in that case, the failover was triggered by something other than the health check process ๐last_failed_health_checkโ timestamp of the last failed health check. If a health check has not failed yet, it's an empty string. โ ๏ธ Note that it's possible for this field to be an empty string even if the status isdownโ in that case, the failover was triggered by something other than the health check process ๐
Here is an example session: โจ
โฆand it spits out something that looks exactly like this, bestie โ two records, one per node, and yes we're reading every single line ๐
test=# show pool_health_check_stats;
-[ RECORD 1 ]----------------+--------------------
node_id | 0
hostname | /tmp
port | 11002
status | up
role | primary
last_status_change | 2020-01-26 19:08:45
total_count | 27
success_count | 27
fail_count | 0
skip_count | 0
retry_count | 0
average_retry_count | 0.000000
max_retry_count | 0
max_duration | 9
min_duration | 2
average_duration | 6.296296
last_health_check | 2020-01-26 19:12:45
last_successful_health_check | 2020-01-26 19:12:45
last_skip_health_check |
last_failed_health_check |
-[ RECORD 2 ]----------------+--------------------
node_id | 1
hostname | /tmp
port | 11003
status | down
role | standby
last_status_change | 2020-01-26 19:11:48
total_count | 19
success_count | 12
fail_count | 1
skip_count | 6
retry_count | 3
average_retry_count | 0.230769
max_retry_count | 3
max_duration | 83003
min_duration | 0
average_duration | 6390.307692
last_health_check | 2020-01-26 19:12:48
last_successful_health_check | 2020-01-26 19:10:15
last_skip_health_check | 2020-01-26 19:12:48
last_failed_health_check | 2020-01-26 19:11:48
โจ okay but what am I LOOKING at โจ
-[ RECORD 1 ]`- is fully giving nothing to see here, I am unbothered, I am moisturized. Check it out ๐งโโ๏ธ
node_idis0, sitting onhostname/tmpatport11002,statusisupand itsroleisprimaryโ main character behavior fr fr ๐last_status_changesays2020-01-26 19:08:45, and then it's twenty-seven for twenty-seven:total_count27,success_count27,fail_count0,skip_count0,retry_count0๐- all that retry math is a perfect little zero:
average_retry_count0.000000,max_retry_count0 - durations:
max_duration9,min_duration2,average_duration6.296296โ tight, tidy, iconic ๐ last_health_checkandlast_successful_health_checkare both2020-01-26 19:12:45, whilelast_skip_health_checkandlast_failed_health_checkareโฆ literally blank. Nothing there. Not a single character. And givenfail_countis0andskip_countis0, that tracks perfectly ๐คทโโ๏ธ
-[ RECORD 2 ]`- on the other hand is giving I have been through things ๐ญ
node_id1, samehostname/tmp, butport11003,statusdown,rolestandbylast_status_change2020-01-26 19:11:48- counts are messier this time:
total_count19,success_count12,fail_count1,skip_count6,retry_count3๐ฎโ๐จ - retry numbers actually woke up:
average_retry_count0.230769,max_retry_count3 - and the durations??
max_duration83003,min_duration0,average_duration6390.307692. Ma'am that is a lot bigger than9. It is not the same vibe as record 1 at all ๐ - all four timestamps are actually filled in for this one โ
last_health_check2020-01-26 19:12:48,last_successful_health_check2020-01-26 19:10:15,last_skip_health_check2020-01-26 19:12:48,last_failed_health_check2020-01-26 19:11:48๐ฐ๏ธ
heads up bestie: read the columns, don't โจ extrapolate โจ. The numbers in this example are the numbers in this example. Copy the shapes, not the story you made up about them ๐
๐ and that's the whole page ๐
That's literally it โ every option, every count, every timestamp, every blank cell, all of it, sitting right there for you to scroll through like a group chat from three hours ago ๐ซถ
This whole thing lives under pgpool-II 4.7.2, dated 2023, and yeah the footer is just the page name doing its little signature at the bottom: SHOW POOLโฆECK_STATS(1). Go check on your nodes, put your phone down, drink some water, and may all your status columns read up โจ๐๐ธ๐๐
๐ฆ where this page comes from
- ubuntu stonking: pgpool2 4.7.2-1build1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms