SHOW_POOL_BACKEND_STATS(1)
π SHOW_POOL_BACKEND_STATS π
okay bestie, real talk: this is a page from the pgpool-II 4.7.2 Documentation crew, and it's about the SHOW_POOL_BACKEND_STATS command. Lowkey obsessed with how much it tells you. Let's get into it π«Ά
β¨ NAME β¨
SHOW_POOL_BACKEND_STATS β bestie, it shows you the backend SQL command statistics. that's the whole vibe π
πΈ SYNOPSIS πΈ
SHOW POOL_BACKEND_STATS
periodt. that's it. no args, no flags, just send it β¨
π¦ DESCRIPTION π¦
so SHOW POOL_BACKEND_STATS spills the tea on every backend: the node id, the hostname, the port, the status, the role, and the query counts for SELECT/INSERT/UPDATE/DELETE/DDL/other, broken down per backend. it also counts up the error messages that came back from the backend and shows them, sorted by severity. ngl that's a lot of intel. π΅οΈββοΈ
the node id, the hostname, the port, the status and the role are the exact same ones you'd see from SHOW POOL_NODES β check SHOW_POOL_NODES(1) if you need the lore π
now the counts, fr fr:
select_cnt,insert_cnt,update_cnt,delete_cnt,ddl_cnt,other_cntare how many SQL commands of each kind βSELECT,INSERT,UPDATE,DELETE,DDLand others β got issued since Pgpool-II started. β°- commands that failed (like, say, a
SELECTfrom a table that literally does not exist π) are counted. no skipping, no mercy. - commands that got rolled back are also counted. π
- and here's the spicy bit: currently, every command that isn't
SELECT/WITH/INSERT/UPDATE/DELETE/CHECKPOINT/DEALLOCATE/DISCARD/EXECUTE/EXPLAIN/LISTEN/LOAD/LOCK/NOTIFY/PREPARE/SET/SHOW/Transaction commands/UNLISTENgets classified as DDL. yes way. that's just how it is π
gateway drug to monitoring your cluster btw. once you see these numbers you'll never look away π
here's a lil example session, so you can see the aesthetic in action π:
test=# show pool_backend_stats;
node_id | hostname | port | status | role | select_cnt | insert_cnt | update_cnt | delete_cnt | ddl_cnt | other_cnt | panic_cnt | fatal_cnt | error_cnt
---------+----------+-------+--------+---------+------------+------------+------------+------------+---------+-----------+-----------+-----------+-----------
0 | /tmp | 11002 | up | primary | 12 | 10 | 30 | 0 | 2 | 30 | 0 | 0 | 1
1 | /tmp | 11003 | up | standby | 12 | 0 | 0 | 0 | 0 | 23 | 0 | 0 | 1
(2 rows)
look at those two rows just sitting there, thriving, up and unbothered β¨ two backends, one primary, one standby, and yes the error_cnt is 1 on both β not me zooming in on that π
and that's the whole page, bestie!! mwah π
this was brought to you by pgpool-II 4.7.2 β documentation from the year 2023, and the page is SHOW_POOL_BACKEND_STATS(1) (yes the footer truncates it to SHOW POO...END_STATS(1) because even manpages run out of room π). anyway, go run it on your cluster and slay. π
π¦ 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