3 ms·
This process has saved me from an outage more than once. I keep a dashboard of running pids, and get alerts when any of them take more than N minutes (exceptin
by superb-owl 4y ago
This process has saved me from an outage more than once.
I keep a dashboard of running pids, and get alerts when any of them take more than N minutes (excepting autovacuum). Once every few months I have to psql into prod and cancel one.
- CraigJPerry 4y agoYeah that’s a super handy resource for all sorts of stuff, if you dump a view of pids by age and also a separate view of pg_locks joined to pg_stat_activity to show blockers and their blocked pids, and i’ve always dumped disk and cpu markers too, then journal that every few seconds to disk, it’s super handy for tailing it in a web dashboard view as you said - which also has a convenient side benefit of stopping every man and their granny having duplicate squizzes at the pg_* tables if there’s been a suspected wobble of some sort. But it’s also really great for providing a cheap historical snapshot of activity for historical investigations and course grained analysis. There are potential dangers with going overboard in this like inadvertently asserting troublesome locks or leaking sensitive data, but fairly easy to avoid.
- nrmitchi 4y agoIf you use separate postgres users for different service components you an also set `statement_timeout` on the user itself.