Skip to content

Add a load test and PostgreSQL support, and fix pool stalls under load - #10

Merged
vishnuatgit merged 1 commit into
mainfrom
feat/perf-and-postgres
Nov 7, 2026
Merged

vishnuatgit merged 1 commit into
mainfrom
feat/perf-and-postgres

Conversation

@vishnuatgit

Copy link
Copy Markdown
Owner

A Locust load test against seeded reports (no GitHub calls), with measured numbers in the README: 20 users p50 21 ms / p95 79 ms; 50 users p50 120 ms / p95 510 ms; 0 failures. DATABASE_URL works with PostgreSQL (psycopg 3, optional extra), a test-postgres CI job and a local docker-compose.yml. Fixes two bugs the load test and Postgres found: 30 s stalls at 50 users (pool exhaustion from blocking DB calls in async handlers), and a 500 for ids above 2^31 on Postgres.

Study first: docs/walkthroughs/03-performance-and-postgres.md.

Tests: 316 to 328 (also 328 on PostgreSQL 16). Stacked on the Action PR.

…load

- Locust load test over stored-report pages, API, history and badges (no GitHub
  calls), with measured latency published in the README
- DATABASE_URL accepts postgresql:// and postgres:// (psycopg 3, optional extra);
  CI job test-postgres runs migrations (up, down, up) and the suite on PostgreSQL 16;
  docker-compose.yml for a local database; TEST_DATABASE_URL for the tests
- Fix: SQLite connection pool ran dry at 50 concurrent visitors (30 s stalls);
  SQLite now uses a connection per session, PostgreSQL a sized pool, and read-only
  handlers are plain def so they run in the thread pool
- Fix: ids above 2^31 returned a server error on PostgreSQL instead of not found
@vishnuatgit
vishnuatgit changed the base branch from feat/github-action to main November 7, 2026 06:17
@vishnuatgit vishnuatgit closed this Nov 7, 2026
@vishnuatgit vishnuatgit reopened this Nov 7, 2026
@vishnuatgit
vishnuatgit merged commit 993a881 into main Nov 7, 2026
5 checks passed
@vishnuatgit
vishnuatgit deleted the feat/perf-and-postgres branch November 7, 2026 06:19
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