chrissharp123

Untitled

Jan 16th, 2018
123
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. script calm.sql:
  2.  
  3. select pg_cancel_backend(pid) from pg_stat_activity where state not like 'idle%' and now() - query_start > '20 seconds' and query ~ 'bib search' order by 1 desc;
  4.  
  5. cron entry (as postgres):
  6.  
  7. */1 * * * * psql -U evergreen < /var/lib/postgresql/scripts/calm.sql >> /var/lib/postgresql/scripts/calm.log
RAW Paste Data