Skip to content

fix: upgrade longtermwiki DB to 2-vCPU/4GB and increase pool size#53

Open
OAGr wants to merge 1 commit intomasterfrom
fix/upgrade-longtermwiki-db
Open

fix: upgrade longtermwiki DB to 2-vCPU/4GB and increase pool size#53
OAGr wants to merge 1 commit intomasterfrom
fix/upgrade-longtermwiki-db

Conversation

@OAGr
Copy link
Contributor

@OAGr OAGr commented Mar 4, 2026

Summary

  • Upgrade Postgres instance from db-s-1vcpu-2gb to db-s-2vcpu-4gb to handle concurrent materialized view refreshes without starving other queries
  • Increase PgBouncer connection pool from 10 to 22 to reduce impact of long-running queries occupying pool slots

Context

The 1-vCPU instance was being saturated by REFRESH MATERIALIZED VIEW operations, causing 30-60s latency on all other queries including health checks. See investigation comment.

The app-level fix (debouncing the refresh) is in longterm-wiki#1639. This PR addresses the infra side.

Test plan

  • terraform plan shows only the DB resize and pool size change
  • After apply, verify health endpoint responds in <1s consistently
  • Monitor for any connection errors during the resize (DigitalOcean managed DB resizes involve brief downtime)

Related: #52

🤖 Generated with Claude Code

The 1-vCPU/2GB Postgres instance was being starved by materialized view
refreshes, causing 30-60s query latency on all other connections.
Upgrading to 2-vCPU/4GB gives headroom for concurrent operations.

Also increase PgBouncer connection pool from 10 to 22 to reduce the
impact of long-running queries occupying pool slots.

Related: #52

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant