As another commented pointed out the "solution" only uses a single IP, even if the resolver returned multiple.
I would not use this in production.
As another commented pointed out the "solution" only uses a single IP, even if the resolver returned multiple.
I would not use this in production.
The title of the entire story already had me confused, as it suggests you somehow need DNS for UDP. Everything that is presented here is a caching strategy.
In this case it is probably 'using the wrong tool, Node.js'. [0]
> The title of the entire story already had me confused
I needed to read the whole article two times to understand what exactly is going on.
It's really should be titled "Sending UDP Messages a bit faster in Node.js because Node.js by default sucks at invoking getaddrinfo()"
There is only 4 UV threadpool, and DNS resolution use it. When using service with low ttl or if for wahtever reason bug or something and if node has to resolve DNS every time under highload, it's very quickly consume all of thoese 4 UV thread pool.