Performance and Deploy

Performance, Caching and Deployment

An Express 24,430 app is fast until it meets traffic. The route that answers in two milliseconds in Postman 3,379 answers in two hundred when fifty clients ask at once, and reading the handler will not tell you which line is responsible. This section covers the only honest way to find out — load the server, read the numbers, change one thing, load it again — and the four changes that most often move them: not doing the work twice, not sending bytes the client already has, sending fewer bytes, and running more than one process.

Everything below was measured on the machine used for this book: an Intel Core i9-7980XE (18 cores, 36 threads) running Windows 11 and Node.js 25.8.0 2,131 , with Express 5.2.1, compression 1.8.2 and autocannon 8.0.0 8,524 . The absolute numbers belong to that machine; the ratios are what to carry away, and they are why every measurement is printed as the tool produced it.

The layers a request crosses, and the subsection that covers each one
The layers a request crosses, and the subsection that covers each one

Two neighbors overlap this ground and are not repeated. Performance in Production covers production performance from the Node side: node:bench microbenchmarks, heap and event-loop diagnostics, cron jobs and BullMQ 9,449 queues. Processes and Clustering covers processes, threads and the node:cluster API itself. Here the subject is the Express layer — what the router, res.json, the ETag hook and the middleware stack cost, and what you put in front of them.

Subsections