Last active
July 5, 2018 17:57
-
-
Save jeremywadsack/958dd193fc1ee500a53cf86ef841cb99 to your computer and use it in GitHub Desktop.
Metrics of postgres temporary file size and memory use
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Records a line with the following space-separated fields | |
# date-time k-pg-tmp-work-mem k-pg-uss k-pg-pss k-pg-rss | |
cat <(du -sk /data/pgsql/9.5/data/base/pgsql_tmp/) <(/usr/local/bin/smem -u | grep postgres) | paste -s | awk '{print strftime("%FT%TZ") " " $1 " " $6 " " $7 " " $8}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment