Advertisement
chrissharp123

Untitled

Jan 16th, 2018
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement