micro kernel: a bit like microservices; eth process talks to ip process, ip process talks to tcp process, tcp process talks to web server; multiple IPCs per packet/PDU, rather slow, single crashing process can still take out everything.
exo kernel: web server asks kernel to get packets matching some filter, kernel passes packets matching the filter to web server, web server uses a eth/ip/tcp library to process the packets;
My favourite one-sentence explanation of an exokernel was from the explanation of a web server called Cheetah running on a kernel called XOK: to save time, the web server stores preformatted TCP packets on disk.
This one sentence is such a profound layering violation that it changes your perspective on the possible ways to write programs.
> The goal is to run 15 million web servers on one VM with 10GB of RAM and 1 CPU core.
The title is underselling the story. I thought the webserver would've been some extremely beefy server, but no. It's 10GB of RAM. That's a basic M4 mac mini territory (and even that one is much more beefier than OP's server)
Cutting through abstraction and getting to the heart of what you actually want the computer to do is evidently the key to high performance programming.
You can go much lower. The goal was set at "15 million web servers" which is dependent on the definition of "a web server" to include some implementation details. From the client perspective it actually means 15 million IP/port combinations that respond to HTTP - which you can do all in one go with an appropriate wildcard selector (such as with iptables transparent proxy)
An excellent resource optimization article, i.e., given a limited or deeply constrained amount of X, can I get a specific amount of Y, given that the traditional relationship between X and Y is constrained by some set of criteria previously thought to be fixed in nature -- well, let's see if we can re-evaluate those criteria and somehow unconstrain it...
In this case, the constraint is "one VM with 10GB of RAM and 1 CPU core", which would definitely be able to run a single web server fairly well, and probably could run tens of them fairly well, as well.
But, when we get up to hundreds of them simultaneously, thousands of them, tens of thousands of them, well, the associated resource constraint problems just seem to compound at every level...
But let's not let that stop us, let's "go for broke" -- and attempt 15 Million!
It's an excellent thought and engineering exercise...
Anyway, the article is a great read. Worth reading by anyone into optimization of computing resources, and definitely worth re-reading in the future.
Great article from the technical aspect, but I also enjoyed the humour a lot. I chuckled with the GB joke, and including the Wolfram screenshot reminded me of the blogs from the ~2005 era, that allowed themselves to include this type of humor.
It was like in the 2000s, blogs wanted to share informatin but also be funny, something similar to a talk in a event? Later they only focused on SEO, so they optimized every word and paragraph, removing jokes, etc. I remember noticing this with the Digital Ocean docs, that ranked 1 for every tutorial in how to install stuff on servers.
> But hey, embarrassment is a cost of entry - let’s dive into networking in the kernel.
Putting uncomfortable and sad motivational speak into funny speak! You are not logically supposed to feel good when you fail, but your brain's language parts make you feel good chemically! Great idea!
This smells of someone with superficial knowledge vibe-coding. Smoltcp has such low concurrent connection limits by default there's no way it would be used in any meaningful way to serve web content on the internet. Fine for its intended target, embedded devices, but as a general purpose web server - no chance.
Whilst enjoyable reading style I feel like it’s a bit shallow in the concepts. Also the statement: “hft firms saturate 400 gbps and that is x ns” is way to simplified. It really depends on the PPS, the bigger your packets are the lower pps. Also there is rss load balancing to multiple cores and obviously a form of buffering.
One of the best (and most humorous) posts I've read on the internals of Linux servers + networking.
If you enjoyed this post, you might also like the "Lord of the io_uring" series which walks through how epoll/kqueue work and then onto async services with io_uring:
com | 14 hours ago
Love the humour and simplicity!
LetMeLogin | 13 hours ago
nojvek | 3 hours ago
Fun to see LLM respond with "yes! literally electricity and shit"
Life is much better using AI as a verb, not a noun.
pi-rat | 13 hours ago
Finding something today that makes you go “i want to subscribe to more of this”, is rare.
Nux | 11 hours ago
ZiiS | 13 hours ago
ozozozd | 12 hours ago
eptcyka | 9 hours ago
pocksuppet | 25 minutes ago
edumucelli | 13 hours ago
kvirani | 13 hours ago
elendilm | 13 hours ago
I was thinking for the last couple of days to have 10M+ app connections on one laptop as an extreme cost optimization excercise. Great timing.
athrowaway3z | 12 hours ago
Seeing 'web', together with its first few sections, made me initially think about http parsing/switching and almost made me stop reading.
mrheosuper | 12 hours ago
bewo001 | 10 hours ago
micro kernel: a bit like microservices; eth process talks to ip process, ip process talks to tcp process, tcp process talks to web server; multiple IPCs per packet/PDU, rather slow, single crashing process can still take out everything.
exo kernel: web server asks kernel to get packets matching some filter, kernel passes packets matching the filter to web server, web server uses a eth/ip/tcp library to process the packets;
cowlevel | 9 hours ago
This one sentence is such a profound layering violation that it changes your perspective on the possible ways to write programs.
3abiton | 12 hours ago
The title is underselling the story. I thought the webserver would've been some extremely beefy server, but no. It's 10GB of RAM. That's a basic M4 mac mini territory (and even that one is much more beefier than OP's server)
magahugu | 12 hours ago
ptejax | 11 hours ago
publlus_enigma | 10 hours ago
gonzus | 10 hours ago
cowlevel | 10 hours ago
You can go much lower. The goal was set at "15 million web servers" which is dependent on the definition of "a web server" to include some implementation details. From the client perspective it actually means 15 million IP/port combinations that respond to HTTP - which you can do all in one go with an appropriate wildcard selector (such as with iptables transparent proxy)
peter_d_sherman | 10 hours ago
In this case, the constraint is "one VM with 10GB of RAM and 1 CPU core", which would definitely be able to run a single web server fairly well, and probably could run tens of them fairly well, as well.
But, when we get up to hundreds of them simultaneously, thousands of them, tens of thousands of them, well, the associated resource constraint problems just seem to compound at every level...
But let's not let that stop us, let's "go for broke" -- and attempt 15 Million!
It's an excellent thought and engineering exercise...
Anyway, the article is a great read. Worth reading by anyone into optimization of computing resources, and definitely worth re-reading in the future.
Related:
The C10K Problem (1999):
https://en.wikipedia.org/wiki/C10k_problem
https://www.kegel.com/c10k.html
tempfile | 10 hours ago
I audibly exhaled from my nose, thank you.
vpmadd52huq | 29 minutes ago
Hilarious.
ac2u | 9 hours ago
101008 | 9 hours ago
It was like in the 2000s, blogs wanted to share informatin but also be funny, something similar to a talk in a event? Later they only focused on SEO, so they optimized every word and paragraph, removing jokes, etc. I remember noticing this with the Digital Ocean docs, that ranked 1 for every tutorial in how to install stuff on servers.
Anyway, good times! I miss them.
herodoturtle | 3 hours ago
Loved his “About” page too:
> I am Artem, living in sunny Finland, writing code at Rivet and running ultramarathons to save money on gas.
igleria | 9 hours ago
bmacho | 8 hours ago
Putting uncomfortable and sad motivational speak into funny speak! You are not logically supposed to feel good when you fail, but your brain's language parts make you feel good chemically! Great idea!
pomatic | 7 hours ago
Panzerschrek | 7 hours ago
iercan | 6 hours ago
anonymousDan | 6 hours ago
JSR_FDED | 5 hours ago
postbase | 5 hours ago
silentprog | 3 hours ago
spwa4 | 2 hours ago
jakintosh | an hour ago
gavinray | 34 minutes ago
If you enjoyed this post, you might also like the "Lord of the io_uring" series which walks through how epoll/kqueue work and then onto async services with io_uring:
https://unixism.net/loti/async_intro.html#async-intro