minimal-supervisor.dev · v0.1.0 · supervisor status: running
minimal supervisor
Three microservices each say one word. This page watches them and puts the words together.
foo baz
That line is static: the expected output, written by hand. With JavaScript on and the services reachable, it is replaced by the words actually fetched from each service.
Supervision tree
minimal-supervisor strategy: rest_for_one intensity: 3 restarts / 10 s ├── foo https://micro-service-foo.dev/ permanent start order 1 ├── bar https://micro-service-bar.dev/ permanent start order 2 └── baz https://micro-service-baz.dev/ permanent start order 3
Machine-readable: /supervisor.json.
Children
| Child | Health | As of deploy (by hand) | Live |
|---|---|---|---|
| foo | health.json | up, v0.1.0, 2026-10-13 | not checked |
| bar | health.json | up, v0.1.0, 2026-10-13 | not checked |
| baz | health.json | up, v0.1.0, 2026-10-13 | not checked |
“As of deploy” is written by a person at deploy time and is the source of truth for anyone reading
raw HTML. “Live” is filled in by an optional script that fetches each health.json from your
browser. It only works if the service’s host sends CORS headers. If it says unreachable from this browser,
the service may still be fine. Follow the link and look.
Why rest_for_one
The Erlang/OTP supervisor documentation defines four
restart strategies. Under rest_for_one, when a child fails, the children started after it are
terminated, then the failed child and those later children are restarted.
That matches this system. The output is ordered: bar baz without a foo in front is not
foo bar baz. If foo goes away, everything that came after it is suspect. If baz goes away, foo and bar have
no reason to care.
What restarts when
| Child that fails | one_for_one | one_for_all | rest_for_one (used here) |
|---|---|---|---|
| foo | foo | foo, bar, baz | foo, bar, baz |
| bar | bar | foo, bar, baz | bar, baz |
| baz | baz | foo, bar, baz | baz |
The fourth strategy, simple_one_for_one, is for many dynamically added children of the same type,
none of them started automatically (Erlang docs).
foo, bar and baz are three different things, so it doesn’t apply.
Restart intensity
A supervisor that restarts forever just hides a crash loop. The Erlang docs put it this way: “If more than
MaxR number of restarts occur in the last MaxT seconds, the supervisor terminates all the
child processes and then itself”. Erlang’s defaults are 1 restart in 5 seconds
(source). This supervisor declares 3 in 10 seconds,
which is looser than the default so the simulator below is fun to break.
Crash a child (simulation)
Nothing real happens here. This runs only in your browser and touches no service.
What “minimal” means here
A real supervisor starts, stops and restarts processes. This one is a set of static files, so it can do none of that. It does the one part of supervising a static file can do: it remembers. The supervision tree, the strategy and the log are written by hand and kept across rounds. The log is append-only.
Lineage
Supervisor. “A supervisor is responsible for starting, stopping, and monitoring its child processes. The basic idea of a supervisor is that it is to keep its child processes alive by restarting them when necessary.” (Erlang/OTP design principles). The idea is set out in Joe Armstrong’s 2003 KTH thesis, Making reliable distributed systems in the presence of software errors, whose abstract states: “We assume that such programs do contain errors, and investigate methods for building reliable systems despite such errors.”
Microservice. James Lewis and Martin Fowler, 25 March 2014: “an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API”. Their first footnote dates the term to “a workshop of software architects near Venice in May, 2011”, with the name settled in May 2012 (martinfowler.com). Three domains to print three words is that definition taken entirely literally.
Not this. minimal-supervisor.dev is unrelated to Supervisor (supervisord), “a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems” (supervisord.org), or to any other product. It shares a common noun, nothing more.