See this: https://github.com/gliderlabs/docker-alpine/blob/master/docs...
edit - so far no results, must need some other change to turn it on...
Alpine uses musl instead of glibc. Maybe you can find a way to run nscd on it but it doesn't seem very idiomatic for a container platform.
That said, I believe Alpine does have a glibc package which only adds a few MB. So @brianwawok can at least still run Alpine for the image size benefits if musl is unimportant to them.
B) If DNS actually becomes a legitimate bottleneck, you can just manually resolve the domain name and cache it. If the db sits behind a load balancer or does DNS round robing you can keep the cache time low and re-resolve on connection failures.
b) I think dnsmasq is a better answer. My DNS is already load balanced in k8s, but that is getting hit pretty hard.
My apk list looks something like
gcc \
make \
libc-dev \
musl-dev \
linux-headers \
pcre-dev \
postgresql-dev \
zlib-dev \
jpeg-dev \
libxslt-dev \
libxml2-dev \
git \
so I see musl but glibc in there....I do not think I want to do the /etc/hosts thing, as the IP can change for some things.. I would rather just cache it locally for ? 1 minute or something
Musl libc's dns strategy should actually be faster than glibc when its used.
https://wiki.musl-libc.org/functional-differences-from-glibc...
That said a local cache would be ideal.
One question that perhaps someone on this thread will know... why does it cache DNS differently from Ubuntu, and is there a way to fix it?
My app has a domain name for the database sever that I pass to Psycopg2.. say foobar.something.google-cloud.internal. It resolves to the private IP of my PostgreSQL sever.
The problem, is EVERY SINGLE database query is querying the DNS. I can sometimes push 10,000 DNS queries per second. 9,990 of those are for the same stupid database server. Kubernetes runs it's own DNS server which takes the load, but sometimes they get overwhelmed a bit. I am obviously doing something wrong, but not sure the path to explore down.
If I can fix this, then alpine is working pretty amazing for me :)