5 ms·
If your app is opening a new connection for every query, that might be your problem. I would look into having a pool of connections. Alpine uses musl instead o
by gtirloni 9y ago
If your app is opening a new connection for every query, that might be your problem. I would look into having a pool of connections.
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.
- paulfurtado 9y agoThis and a couple of other comments mention nscd, however, unless it's different on other distributions, nscd works via a unix socket. To make it work in containers, you need to explicitly mount it in from the host or run the nscd daemon inside the container. I'd be surprised if @brianwawok was doing that with their non-alpine containers and didn't realize it since it's so explicit 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.
- brianwawok 9y agoThese are persistent connections, it's not that.
- gtirloni 9y agoThat's weird. I would fire up strace and check what's really happening. musl/glibc shouldn't have visibility into the queries you're making. My suspicion is that something at the app level is doing something that it shouldn't, not musl.
- ifbizo 9y agoThanks @gtirloni! I'm new to SQL and was working on a small internal tool. This change, an obvious one in hindsight, sped up my tool by ~2-3x. So for anyone else, check this!
- deleted 9y ago[deleted]