Skip to content

Instantly share code, notes, and snippets.

@akhdaniel
Last active April 1, 2019 02:59
Show Gist options
  • Save akhdaniel/432f9fffa42f03b9f205c4b280991abe to your computer and use it in GitHub Desktop.
Save akhdaniel/432f9fffa42f03b9f205c4b280991abe to your computer and use it in GitHub Desktop.
#!/bin/bash
# sesuaikan dengan lokasi folder PG masing-masing
PGDATA=/var/lib/postgresql/9.5/main
pid=`head -1 $PGDATA/postmaster.pid`
echo "Pid: $pid"
peak=`grep ^VmPeak /proc/$pid/status | awk '{ print $2 }'`
echo "VmPeak: $peak kB"
hps=`grep ^Hugepagesize /proc/meminfo | awk '{ print $2 }'`
echo "Hugepagesize: $hps kB"
hp=$((peak/hps))
echo Set Huge Pages: $hp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment