Adjust down the OOM score on PgSQL databases
authorMatt Palmer <mpalmer@hezmatt.org>
Fri, 16 Oct 2015 11:28:34 +0000 (22:28 +1100)
committerMatt Palmer <mpalmer@hezmatt.org>
Fri, 30 Oct 2015 20:10:42 +0000 (07:10 +1100)
templates/postgres.template.yml

index 76fb51dee78d24d01d35c9f46407d5a1e0b32d49..e48de016b97eae5a51ec0830f726b0ee596a1c5e 100644 (file)
@@ -36,6 +36,7 @@ run:
      contents: |
         #!/bin/sh
         exec 2>&1
+        echo -1000 >/proc/self/oom_score_adj
         HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main
 
   - file: