department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
284 stars 206 forks source link

Resolve database capacity issue on Heroku for pact broker #14067

Closed rianfowler closed 4 years ago

rianfowler commented 4 years ago

Overview

Pact broker runs on Heroku and will stop working when the db reaches capacity with the current Heroku plan.

Notes

Alert from Heroku:

The database DATABASE_URL on Heroku app vagov-pact-broker is approaching its allocated storage capacity.

The database contains 7,326 rows. The Hobby-dev plan allows a maximum of 10,000 rows. If the databases exceeds 10,000 rows then INSERT privileges will be revoked, preventing more data from being written. INSERT privileges are automatically reinstated if rows are removed and the database once again complies with the plan limit.

To avoid a disruption to your service, migrate the database to a Basic ($9/month) or higher plan:

https://hello.heroku.com/upgrade-heroku-postgres#upgrading-with-pg-copy

If you are unable to upgrade the database, you should limit or reduce the number of records in it.

rianfowler commented 4 years ago

Note from @U-DON:

It looks like we're on a paid Heroku plan. The dashboard says I'm on an Enterprise Account. And the broker is an app under that enterprise team.

I don't see an option to upgrade the database plan, though. Maybe only members with billing privileges can fiddle with that.

Not sure how our plan factors into the pricing for add-ons like Postgres. It could be that the add-on's plans are included due to being under the org, but I don't have a way to confirm.

gunsch commented 4 years ago

Today's alert:

The database DATABASE_URL on Heroku app vagov-pact-broker has exceeded its allocated storage capacity. Immediate action is required.

The database contains 10,032 rows, exceeding the Hobby-dev plan limit of 10,000. INSERT privileges to the database will be automatically revoked in 7 days. This will cause service failures in most applications dependent on this database.

To avoid a disruption to your service, migrate the database to a Hobby Basic ($9/month) or higher database plan:

https://hello.heroku.com/upgrade-postgres-c#upgrading-with-pg-copy

If you are unable to upgrade the database, you should reduce the number of records stored in it.

meganhkelley commented 4 years ago

convo from Slack

Demian Ginther Yesterday at 4:40 PM updates on the ops side, Pact broker is up and running inside the utility VPC. I think the remaining issue is just one of revproxy configuration and deciding which environment we are going to try to pass the URL through on

Megan Kelley 6 hours ago this is the sprint objective I had written for Sprint 37 — would you consider this complete now, then? Implement a solution for Pact broker hosting (either resolve database capacity issue on Heroku or move Pact infrastructure to AWS).

Demian Ginther 4 hours ago not complete, no, we still have to get the automation part working

Demian Ginther 4 hours ago I would consider it complete once we are using the new pact broker

Megan Kelley 4 hours ago ok got it thank you!

f1337 commented 4 years ago

We're going to continue to truncate the table at Heroku until we're done migrating Pact to the new infra.

meganhkelley commented 4 years ago

Resolved in #15188