what is pure rust,rust needs its own libraries which is a few MB as I recall
Re:Musl 1.2.4 adds TCP DNS fallback
by galangalalgol on Sunday July 30, 2023 @05:20PM
(#36936102)
By pure, I just meant no dependencies on c or c++ bindings other than libc. If that is the case you can do a musl build that has no dynamic dependencies, as all rust dependencies are static. So then your only dependency is the kernel, which is provided via podman/docker. A decent sized rust program with hundreds of dependencies I can get to compile down to 1.5MB. But that is depending on gnu. So if you had 4 or 5 of those on a node, it might be less data to use one gnu base image that is really small like rhel micro, and build rust for gnu. But if you have cpu hungry services like I do, then you usually have only a couple per node, so from scratch musl can be a bit smaller.
> cpu hungry services
Have you benchmarked musl vs glibc in any way? Data I've seen is all over the place and in curious about your experience.
Re:Musl 1.2.4 adds TCP DNS fallback
by galangalalgol on Sunday July 30, 2023 @09:35PM
(#36937919)
Very few system calls in the main loop. Not even close to being io bound, and as I said memory is all preallocated, so allocator efficiency isn't a factor.
That means duplication of musl in lots of containers, but when they are all less than 10MB its less of an issue. Linking against gnu libraries might get the same executable down to less than 2MB but you'll add that back and more for even the tiniest gnu nase images.