Blog

Posts tagged “Performance”

Header: 'Count the requests your interceptor never sees.' beside real /metrics output from a NestJS test app: middleware-recorded series for /api/users/:id with statuses 200, 403 (guard) and 400 (pipe) plus an unmatched 404, and a global interceptor that counted the same five requests as three 200s.
Monitoring

NestJS monitoring: metrics, APM and tracing that see guards and interceptors

NestJS monitoring that counts every request: per-route Prometheus metrics from middleware, OpenTelemetry tracing on NestJS 11 and 12, and what interceptors miss.

Jason Fill November 13, 2026 11 min read
ApiTraffic header: Express monitoring by route, not by URL, with a /metrics output panel listing route-labelled request counts for 200, 201, 404 and 500 responses
Monitoring

Express monitoring: route-level metrics, APM and alerts for Express 4 and 5

Most Express metrics are labelled by raw URL and miss async errors. Build route-level metrics with prom-client, add OpenTelemetry in the right load order, and set alerts, with code we ran on Express 4.22.3 and 5.3.0.

Jason Fill November 12, 2026 11 min read
Header: 'Node.js API monitoring: What to measure, how to set it up, and which tools fit a small team', with a metrics panel from the guide's example: /orders/:id p95 250ms and 2.0% 5xx, /report p95 250ms, unmatched 404, event loop delay p50 120.8ms against an idle 20.2ms.
Monitoring

Node.js API monitoring: what to measure, how to set it up, and which tools fit a small team

Uptime checks miss most of what breaks a Node API. What to measure per route and per process, a tested Express middleware for RED metrics and event loop delay, where OpenTelemetry fits, a fair tool comparison and the alerts worth paging on.

Jason Fill November 12, 2026 16 min read
Bar chart: ALB idle timeout 60 s, old Node keepAliveTimeout 5 s causing a 502 when the ALB reuses a closed socket, and a fixed keepAliveTimeout of 65 s, with the code server.keepAliveTimeout = 65_000; server.headersTimeout = 66_000;
Monitoring

Node.js server timeouts: requestTimeout, headersTimeout and keepAliveTimeout

Random 502s behind a load balancer often come down to one setting: keepAliveTimeout. What each Node.js server timeout controls, safe values behind an AWS ALB, and how to confirm the fix.

Jason Fill November 11, 2026 5 min read
Header: 'Your API isn't slow. It's waiting for a connection.' beside an illustrative terminal showing a pg pool with 10 total, 0 idle and waiting climbing from 47 to 240, and GET /v1/dashboard at p95 9.8s with 80 ms of database time.
Debugging

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

Fine in testing, then 200 people open the same page and the endpoint takes ten seconds. CPU is flat and Postgres says every query is fast. That's pool starvation. Here's why it happens in Node, how to spot it, the fixes with code, and how to prove they worked.

Jason Fill November 3, 2026 6 min read
UV_THREADPOOL_SIZE in Node.js: terminal output where dns.lookup(localhost) takes 544 ms behind eight scrypt hashes with the default pool and 30 ms with UV_THREADPOOL_SIZE=16, measured on Node 22.23
Monitoring

UV_THREADPOOL_SIZE in Node.js: when DNS lookups, crypto and fs wait in the same line

Outbound calls slow down under load while CPU stays low? DNS lookups, crypto and fs share libuv's 4-thread pool in Node. How to reproduce the queue, measure it per upstream, and set UV_THREADPOOL_SIZE.

Jason Fill October 22, 2026 5 min read
Deploy markers name the guilty release: p95 per endpoint before and after a deploy, with /v1/search flagged as a regression
Monitoring

Deploy markers: tying a latency regression to the release that caused it

p95 doubled, and there were three deploys and a flag flip since yesterday. Deploy markers and a version field on every log line turn "which release did this" into a five-minute query. Here is how to set both up for a Node API.

Jason Fill October 13, 2026 6 min read
Cursor vs offset pagination at page 4000. Cover graphic for a guide to keyset pagination in Node.js and Postgres APIs.
Coding

Cursor vs offset pagination: an API design that survives big tables and scrapers

Offset pagination was fast at launch; now deep pages hammer the database and one API key is walking every page. Here is when to switch to cursors and how.

Jason Fill August 21, 2026 6 min read
Node.js event loop lag, explained. Cover graphic for a guide to measuring Node.js event loop delay and finding the code that blocks it.
Monitoring

Node.js event loop lag: the metric that explains "random" slowness

Every endpoint slow at once, database fine, CPU looks idle: that is event loop lag. Here is how to measure it in Node with built-in tools and find the code that blocks.

Jason Fill June 22, 2026 6 min read
Node.js memory leak? Take three snapshots. Cover graphic for a guide to finding Node.js memory leaks with heap snapshots in Chrome DevTools.
Monitoring

Node.js memory leak debugging with heap snapshots

The container keeps getting OOM-killed and restarts hide why. Here is the three-snapshot method that finds a Node.js memory leak, and how to do it safely in production.

Jason Fill May 25, 2026 6 min read
Header: 'Log it. Measure it. Block it.' beside an illustrative NestJS request log: a 200 on /api/users/:id, a 403 from a guard, an unmatched 404, a 429 on login, a SQL injection attempt blocked by the WAF, and a slow report route at p95 1.8 s.
Coding

The NestJS production checklist: what to log, measure and block

NestJS adds guards, interceptors, pipes and request-scoped providers to every request, and each one shows up in your latency and your logs. A practical checklist for what to log, what to measure and what to block before you ship.

Jason Fill May 7, 2026 9 min read
Find N+1 queries before users do. Cover graphic for a guide to detecting and fixing N+1 database queries in a Node.js API.
Monitoring

How to find N+1 queries in a Node.js API before your users do

An endpoint that's fast in development takes 900 ms for your biggest customer because it runs 201 queries. Find N+1 queries in a Node API with a per-request query counter and a test, then fix them with one batched query.

Jason Fill April 3, 2026 6 min read