C
Catern
catern.com · Personal blog · on HN since 2014
Catern writes about Unix internals, processes, terminals, Docker and distributed system design.
What HN saysCommenters cite the Unix process API post and the Docker essay, one saying the essay is on point despite nitpicks, another disagreeing with its conclusions.
35HN people shared it
12linked it in comments
48stories submitted
2.4Kstory points
1 year agolast shared
2014people per year2026
Most-shared posts
- 1Inheritance was invented as a performance hack8 people · 441 points · first shared 2021 · 252 comments on HN
- 2Docker Considered Harmful (2016)7 people · 277 points · first shared 2016 · 181 comments on HN
- 3Prefer to change the code rather than write a workaround4 people · 24 points · first shared 2022 · 4 comments on HN
- 4The Unix process API is unreliable and unsafe4 people · 2 points · first shared 2023 · discussion on HN
- 5You need to be able to run your system3 people · 294 points · first shared 2021 · 162 comments on HN
- 6Terminals Are Weird3 people · 146 points · first shared 2014 · 46 comments on HN
- 7No more DSLs: Implement and deploy a distributed system with a single program3 people · 66 points · first shared 2021 · 15 comments on HN
- 8Simple, Fast, Easy Parallelism in Shell Pipelines (2016)3 people · 55 points · first shared 2016 · 3 comments on HN
- 9An introduction to “introduction”: a common but rarely-named systems concept3 people · 8 points · first shared 2021 · discussion on HN
- 10Write libraries instead of services, where possible2 people · 637 points · first shared 2021 · 322 comments on HN
- 11Public/protected/private is an unnecessary feature2 people · 89 points · first shared 2025 · 108 comments on HN
- 12We need a free software license for distributed systems2 people · 20 points · first shared 2021 · 2 comments on HN
- 13No more DSLs: Implement and deploy a distributed system with a single program2 people · 10 points · first shared 2021 · 1 comments on HN
- 14Don't write configuration, write code2 people · 5 points · first shared 2021 · discussion on HN
- 15Deps2 people · first shared 2017
What HN people wrote when they linked it
catern · 2023-10-12
It requires a bit of annoying machinery since you have to dedicate a process to being a subreaper. Still it's probably the best option, I made https://github.com/catern/supervise with it, see also https://catern.com/process.html
bsenftner · 2018-06-25
One can nit pick some of his points, but the general essay is right on point. Developers need to understand what they are building on top of to be able to navigate non-trivial problems.
I found this article from Saturday worth the read, as it explains what Docker actually is, and why no one needs it: http://catern.com/posts/docker.html.
The same goes for everyone working in the cloud; I've build my own clusters to compare the effort and expense (rather than just accept the marketing line) and running one's own servers, from one to hundreds, is exponentially more cost effective than any cloud service.
People are not doing their homework, and the herd mentality owns the entire tech industry.
cs02rm0 · 2018-06-25
I found this article from Saturday worth the read, as it explains what Docker actually is, and why no one needs it: http://catern.com/posts/docker.html.*
Not sure I agree with the conclusions. A bunch of OS-specific alternatives don't compare as I see it, but regardless, for me the value of Docker isn't the filesystem trees alone but the tools that then leverage them; compose, swarm, etc.
Joker_vD · 2025-04-14
It's not unusual at all, it's just... should it be exposed? I personally prefer having "Node struct with next pointer + inlined generic data" design when it can be encapsulated away since, well, it can be encapsulated away, and the result data layout is the same. And when you expose this design, well, you end with all sorts of disasters, including OOP inheritance (no, really: [0]).
[0] https://catern.com/inheritance.html
gpderetta · 2023-10-11
Also relevant: "The Unix process API is unreliable and unsafe" (https://catern.com/process.html)
bitwize · 2023-03-26
> Which is why hoarding state management in PID 0 is a dumb idea.
Because the Unix process API is unreliable and unsafe ( http://catern.com/process.html ), managing processes is difficult to impossible in a general way under Unix systems including Linux. Linux gained some features to help with this, but for the longest time, PID 1 was the only process that could manage its child processes in a way that wasn't fraught with race conditions -- meaning systemd or something like it was the only way to have safe, effective process management because it tracked all that state in PID 1.
Blame Unix being broken, not systemd, for the problems systemd solves.
Ericson2314 · 2022-03-01
This stuff is still all confused
Read http://catern.com/rsys21.pdf
What you want is:
1. create "embryonic" unscheduled process
2. Set it up from the parent process, it just lies on the operating table passively.
3. Submit it to the scheduler.
This is just....obviously correct. Totally flexible. Totally efficient. Hell, if you really want to fork anything, fork those embryonic process which have no active threads! Much safer and easier to understand!
I did not write the paper above, but I did write
https://lore.kernel.org/lkml/f8457e20-c3cc-6e56-96a4-3090d7da0cb6@John…
https://lists.freebsd.org/archives/freebsd-arch/2022-January/000139.ht…
I hope I or someone else will have time to make it happen!
mcny · 2021-04-19
> To be honest though, I never had a full production system in my dev machine in my 5yrs career.
http://catern.com/run.html
I can understand it might not have been possible thirty or even twenty years ago but with modern systems such as the EPYC 7003[1] you can have a 64 core / 128 thread beast with 4 TB memory. Granted the processor alone costs $7890 but I can't imagine any system that won't run on a single top end modern computer, especially with dummy data.
Why don't we run the full production system on a development machine?
[1] https://www.anandtech.com/print/16529/amd-epyc-milan-review https://news.ycombinator.com/item?id=26466933
StreamBright · 2019-03-10
> What’s wrong with Docker? Why would I want to switch to something else?
Security, performance, reliability and following best engineering practices. Everything else is fine.
https://arxiv.org/pdf/1804.05039.pdf
https://hackernoon.com/another-reason-why-your-docker-containers-may-b…
https://www.scylladb.com/2018/08/09/cost-containerization-scylla/
https://thehftguy.com/2017/02/23/docker-in-production-an-update/
http://catern.com/posts/docker.html
mmagin · 2018-06-25
I don't know if it was true when the article was written, but at least today some of what the author writes in http://catern.com/posts/docker.html#sec-4 is untrue.
https://docs.docker.com/engine/security/security/#linux-kernel-capabil…
peter_d_sherman · 2024-01-29
Interesting article!
My takeaways:
>"The current solutions involve packaging entire alternate runtimes in containerized environments. Flatpak, Snap, AppImage, Docker, and Steam: these all provide an app packaging mechanism that replaces most or all of the system’s runtime libraries, and they now all use containerization to accomplish this."
[...]
>"All of these technologies are essentially building
an entire OS on top of another OS
just to avoid the challenges of backwards compatibility."
This is basically using containers to replace all system libraries -- to insure that a downloaded binary app always works.
From this point forward, we'll use the term "API" to represent not just Linux kernel syscalls, but the totality of all library calls (system and otherwise!) used by a given downloaded binary application!
Observation: API (in-)consistency (AKA "Stability") one Linux version to another, one Linux distro to another -- is the real problem!
That's the real cause!
Because everything else, everything else, is effect, not cause!
The containerization, the bloated "everything but the kitchen sink" downloads, are the effect of the problem of API (in-)consistency!
Phrased a simpler way -- there is absolutely NO guarantee of consistency between the libraries, system and otherwise, of any two Linux distros!
So if a binary app is to run on all Linux distros -- then it had better damn well better make sure that the exact specific version of all of the libraries that it…
edumucelli · 2021-05-24
Inheritance was invented for performance reasons [1]. It was not conceived for pure code organization, so in way it is arbitrary as any other solution that could have brought performance gains for the original garbage collector. Inheritance is an "intellectual accomplishment" as other accomplishments, that will incur into issues if applied blindly, so not having it is not an issue per se. On the contrary, today's widely accepted view of inheritance is to rather use composition instead of it [2].
R does have inheritance by the way, not as you will see frequently on "general purpose" programming languages, thing R is not.
[1] http://catern.com/inheritance.html
[2] https://books.google.pt/books?id=ka2VUBqHiWkC&pg=PA81&lpg=PA81…