From 20c7cb5c9388db1f3592c5d7c5ecf5ef41480a72 Mon Sep 17 00:00:00 2001 From: Mario Olivio Flores Date: Wed, 13 Jan 2016 14:19:00 +0100 Subject: [PATCH] README: various updates * remove outdated step-two references * clarify staging delpoy * provide simpler one-liner for dumping db connections --- README.md | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3f93dcd..96276cb 100644 --- a/README.md +++ b/README.md @@ -69,15 +69,11 @@ To hook up this app with Heroku's command line tool in your development environm 1. Get someone to add you as a collaborator on the staging Heroku app 1. Install the Heroku toolbelt on your machine: https://toolbelt.herokuapp.com/ 1. Once installed, run the `heroku login` command -1. `cd` into your clone of this repository, and run `heroku git:remote --app mayone-staging` +1. `cd` into your clone of this repository, and run `heroku git:remote -r staging --app mayone-staging` You can test if it works by running a command like `heroku logs`. -### Step Two Staging - -To access the step two staging Heroku app, follow the instructions for the staging app and then run `git remote add step-two https://git.heroku.com/mayday-step-two.git`. - -You can now run commands against the step two staging app like this: `heroku logs -a mayday-step-two`. +You can now deploy to staging the standard Heroku way. Example: `git push mayone-staging master` ### Common Staging Commands @@ -141,18 +137,9 @@ Sometimes the production site has hiccups. Here are tips on how to solve some co #### Maxing out Postgres connections -Sometimes a New Relic alert gets triggered because our Heroku dynos can't connect to the Postgres database. This is most likely because the Postgres database has run out connections - our current plan only allows for 20. - -Until we can figure out something better, solve this by running `heroku pg:psql --app mayone-prod`. Then run: - -``` -SELECT pg_terminate_backend(pg_stat_activity.pid) -FROM pg_stat_activity -WHERE datname = current_database() - AND pid <> pg_backend_pid(); -``` +About every other month, a New Relic alert gets triggered because our Heroku dynos can't connect to the Postgres database. This is most likely because the Postgres database has run out connections - our current plan only allows for 20. -That will terminate all connections to the Postgres database. You should then run `heroku restart --app mayone-prod` **immediately** so that all worker and web dynos reestablish their connections to the database. +Until we can figure out something better, solve this by running killing the current connections. Run `heroku pg:killall -amayone-prod`. That will terminate all connections to the Postgres database. You should then run `heroku restart --app mayone-prod` **immediately** so that all worker and web dynos reestablish their connections to the database. We haven't prioritized resolving this as it doesn't seem related to traffic congestion. ## Contributing / Code Review Process