Every servers & event loops visualization on this site on one map. The branches are the main ideas. Each leaf is a page; the grey line under it is the one thing to remember about it. Click a branch to focus on it, click a page to open it.
Recall mode hides the page names. Read the hint, say the name, then click the "?" to check.
1. How the map is organized
The map at a glance: 5 branches, 22 pages.
Ask at what level the page looks at a server:
The kernel and one socket? How a thread waits for data is the I/O models branch.
One process serving requests? A thread pool (Tomcat) or worker processes (nginx) is web servers; a single thread with a loop (Node.js, Redis) is event loops; the browser has its own loop.
Many servers? Spreading load and shipping new versions is scaling and releases.
2. The branches side by side
Branch
Unit of work
Who waits
Main risk
I/O models
a read or write on a socket
a thread, or the kernel for it
too many threads or syscalls
Web servers
an HTTP request
a poller, then a worker thread
pool exhausted
Event loops
a callback or command
one loop thread
one slow task blocks all
In the browser
a task or frame
the main thread
long tasks freeze the page
Scaling and releases
a server or version
the load balancer
bad release, single point of failure
3. Five facts to remember
epoll tells you a socket is ready; io_uring tells you the I/O is done.
One event loop thread can serve thousands of idle connections, but one slow callback stalls them all.
In Node.js and the browser, all microtasks (promises) run before the next task or phase.
Tomcat uses a few threads to watch sockets and a pool of worker threads to run servlets.
Scaling out needs stateless servers: keep sessions in a shared store, not in one server's memory.