From 31af7235c24cd3e2d406e1e3db8fe51c04a8f69e Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 7 Mar 2022 09:34:19 -0600 Subject: [PATCH] Add Diagnose Problems In A Heroku Postgres Database as a Heroku til --- README.md | 3 ++- ...-problems-in-a-heroku-postgres-database.md | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 heroku/diagnose-problems-in-a-heroku-postgres-database.md diff --git a/README.md b/README.md index bd0dc9c..c80ba91 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1187 TILs and counting..._ +_1188 TILs and counting..._ --- @@ -339,6 +339,7 @@ _1187 TILs and counting..._ ### Heroku - [Deploy A Review App To A Different Stack](heroku/deploy-a-review-app-to-a-different-stack.md) +- [Diagnose Problems In A Heroku Postgres Database](heroku/diagnose-problems-in-a-heroku-postgres-database.md) - [Set And Show Heroku Env Variables](heroku/set-and-show-heroku-env-variables.md) - [SSH Into Heroku Server Hosting App](heroku/ssh-into-heroku-server-hosting-app.md) diff --git a/heroku/diagnose-problems-in-a-heroku-postgres-database.md b/heroku/diagnose-problems-in-a-heroku-postgres-database.md new file mode 100644 index 0000000..bf385ab --- /dev/null +++ b/heroku/diagnose-problems-in-a-heroku-postgres-database.md @@ -0,0 +1,23 @@ +# Diagnose Problems In A Heroku Postgres Database + +Heroku keeps track of all kinds of diagnostics on the performance of your app's +database. From long running queries and transactions to index cache hit rates +to unused indexes to tables with bloat. + +Running the `pg:diagnose` command for your Heroku app will surface all of these +details in the terminal. + +```bash +$ heroku pg:diagnose -a APP_NAME +``` + +The report will start with the biggest problem areas which it color codes in +red. If your app is experiencing degraded performance, the list of red items +would be a good place to start investigating. + +The report will then list less urgent problem areas. Those will be color coded +yellow. Though Heroku has deemed these less serious, you may still want to deal +with these. + +All the other areas of diagnose will fall into the _green_ bucket. Meaning +Heroku doesn't see any issues in those areas.