Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for slow postgres queries #294

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
```
Loading