SHARE
TWEET

Untitled

chrissharp123 Jan 16th, 2018 79 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top