Re:Serverless DNS: Self-hosted DNS resolver at the edge
by goodpoint on Saturday July 30, 2022 @01:01PM
(#32288321)
> Fly.io simply boots a Linux kernel, and the Docker image you give it
There is nothing "simply" in a Rube Goldberg machine of such magnitude.
Re:Serverless DNS: Self-hosted DNS resolver at the edge
by ignoramous on Saturday July 30, 2022 @05:40PM
(#32290620)
The app specifically creates swap iff it detects it is running on Fly.io: https://github.com/serverless-dns/serverless-dns/blob/9cb3f4...
Fly.io simply boots a Linux kernel, and the Docker image you give it is then treated if it was full filesystem for that "instance". Whatever is in the container image is all you get. Many container environments aren't going to have init-like frameworks to initialize swap before booting the application; in fact the container only having say, node.js, a few .js files, and starting that immediately after kernel boot is actually a pretty good startup time optimization. So if you need swap space, because the runtime makes anonymous memory commitments larger than physical memory -- the only way to guarantee that is in the application path itself, like done here. You could also do a shell script I guess. You'd have to do this in any similar low-memory environment, really, if the init system didn't.
Seems reasonable; nothing too suspicious or odd in the long run. It's nothing you're going to need outside of these new-fangled container-like environments (besides, in this case, the shell commands are easily auditable and not in any way user-controllable through user input, vastly reducing defect surface area.) Took 10 minutes to audit and figure out if you've had some previous exposure to runtime tuning; comments to explain this would have been nice, though...