Menu

Your Node API isn't slow. It's waiting for a database connection.
📰

Your Node API isn't slow. It's waiting for a database connection.

DEV Community: backend·ApiTraffic·13 days ago
#2pRF4ybI
#devtobackend#devto#dev#pool#request
Reading 0:00
15s threshold

It's fine in testing. Then 200 people open the same page at once and the endpoint takes ten seconds. CPU is flat. Postgres says every query is fast. Nothing looks slow, and yet everything is stuck.

That shape usually means requests are queuing for a database connection, not for compute. This post covers why it happens in Node, how to spot it, the fixes (with code), and how to prove the fix worked.

The pattern

One write-up on dev.to describes a NestJS admin dashboard on Postgres. A stress test fired 200 identical dashboard requests at a 250k-entry ledger through a pool of 5 connections. The first run came back with a p95 of 9.8 seconds.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.