Remove uses of the read replica database.

https://danbooru.donmai.us/forum_topics/9127?page=283#forum_post_160508

There was a recent outage that was caused by the read replica
(yukinoshita.donmai.us) being temporarily unavailable. The pg driver in
rails got hardstuck trying to connect to the replica, which brought down
the whole site. The app servers stopped responding and could only be
brought down with SIGKILL. Even try to boot the rails console didn't
work.

We only really used this to calculate tag counts inside Post.fast_count,
which wasn't really beneficial since the read replica is slower than the
main database.
This commit is contained in:
evazion
2019-10-22 12:15:46 -05:00
parent 8541974d19
commit 2c6567b5d2
6 changed files with 8 additions and 44 deletions

View File

@@ -24,27 +24,6 @@ production:
timeout: 5000
url: <%= ENV['DATABASE_URL'] %>
# read only databases, just point to local copies if you have no need
ro_development:
adapter: postgresql
database: danbooru2
url: <%= ENV['RO_DATABASE_URL'] %>
ro_test:
adapter: postgresql
database: danbooru2_test
url: <%= ENV['RO_DATABASE_URL'] %>
ro_production:
adapter: postgresql
database: danbooru2
url: <%= ENV['RO_DATABASE_URL'] %>
ro_staging:
adapter: postgresql
database: danbooru2
url: <%= ENV['RO_DATABASE_URL'] %>
archive_development:
adapter: postgresql
database: archive_development