A few weeks ago I posted Peakd on Hacker News, and ~500 concurrent connections took the site down in under a minute.
The failure: a single Express instance, no HTTP cache, no connection pooling, sequential database queries everywhere. PostgreSQL’s connection pool maxed at 20, requests queued behind each other, timeouts cascaded, PM2 health checks failed, the frontend crash-looped. The site was unresponsive within 60 seconds of hitting the front page.
Looking back, the problems were pretty basic: there was no caching layer (every page hit the database), independent queries were being awaited sequentially, all routes shared a 20-connection pool, there was no rate limiting or graceful degradation, and everything ran through one PM2 instance. A few of these were embarrassingly obvious in hindsight.
I ended up rebuilding most of the request path:
- Varnish HTTP cache in front of both API and SSR pages (anonymous pages served in <5ms)
- PgBouncer for connection pooling
- Query parallelization across all hot endpoints (Promise.all for independent queries)
- 3 backend cluster instances + 2 frontend instances
- Separate database pool for admin queries (so my own browsing can’t starve user requests)
- Redis caching with write-invalidation (not just TTL expiry)
- Internal admin dashboard for request rates, latency, cache hit rates, database connections, and resource usage
- Indexes for the high-traffic query paths, based on the actual query plans
Where it’s at now: 200 concurrent requests to the origin complete in 41ms average with 0 errors on a warm cache. Through Cloudflare + Varnish, 50 concurrent requests see P95 of 520ms. Cold-cache first request is ~2.7s; cached responses are served for 30s. All on a single $24/mo Lightsail instance (4GB RAM).
The product is Peakd, a community ranking site where people rate things they’ve actually used on a few dimensions. Rankings are adjusted for vote count and contributor history. There are 661 users so far, but many categories still don’t have enough votes to be genuinely useful — that’s the cold-start problem I’m trying to solve. Companies can manage profiles and buy clearly marked promotion, but promotion has no effect on ranking. Solo dev, about 6 weeks of building.
I’d like feedback on:
- The ranking model (bayesian + trust-weighted + minimum vote thresholds) — does it feel fair?
- General UX — what feels off when you browse?
- The infrastructure approach — anything obviously wrong or missing?
I’m particularly interested in feedback from people who have dealt with similar Node/Postgres scaling problems. If you spot something obviously wrong with the architecture or benchmarking, I’d love to hear it.
I can share more detail on the query timings or load test setup if useful.
Peakd: https://peakd.io
