Skip to content

Commit

Permalink
Add docs for slow postgres queries
Browse files Browse the repository at this point in the history
  • Loading branch information
KevSlashNull committed Dec 3, 2024
1 parent 1e6e96a commit ae0f8e0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@ For now, we’re back to manual deployments:
1. Celebrate! 🎉
1. If feeds were changed or added since the last deployment, run the **Deploy Feeds** CI job.

## Incident runbook
## Incident runbooks

Sign in to <https://furrylist.grafana.net> and head to the **Overview**
dashboard. Look at the colorful metrics and hope for improvement!

### Slow generation due to Postgres query planner misbehaving

If the **CPU usage** and **Feed Generation Avg Duration** are unusually
high, this can be due to Postgres misbehaving and incorrectly planning
queries. This can usually be fixed by running the following command in
psql on production:

```sh
bff=# analyze verbose candidate_posts;
INFO: analyzing "public.candidate_posts"
INFO: "candidate_posts": scanned 197354 of 197354 pages, containing 2024025 live rows and 2666 dead rows; 300000 rows in sample, 2024025 estimated total rows
ANALYZE
Time: 14113.331 ms (00:14.113)
```

0 comments on commit ae0f8e0

Please sign in to comment.