How servers handle many requests.
WHAT THE MODELS ARE
A process or thread per request An event loop handling many connections in one thread Lightweight concurrency managed by the runtime
WHAT PROCESS PER REQUEST SUITS
Straightforward reasoning, with isolation between requests.
WHAT IT COSTS
Memory per request, limiting how many are handled simultaneously.
WHAT AN EVENT LOOP SUITS
Many connections mostly waiting on input and output.
WHAT IT REQUIRES
Never blocking the loop.
WHAT BLOCKING LOOKS LIKE
Heavy computation Synchronous file or network operations
WHAT THAT CAUSES
Every request stalling, not only the one doing the work.
WHAT LIGHTWEIGHT CONCURRENCY PROVIDES
Many concurrent operations without a thread each.
WHAT TO ESTABLISH FOR YOUR STACK
Which model it uses, and what that forbids.
WHY
Most severe performance faults are a violation of the model.
WHAT TO MOVE OUT OF REQUESTS REGARDLESS
Anything slow.
WHERE
A background queue.
WHAT TO MEASURE
Response time under concurrent load, not in isolation.