pygelf icon indicating copy to clipboard operation
pygelf copied to clipboard

DNS lookup happening on every log message (UDP)

Open bmerry opened this issue 3 years ago • 2 comments

When using GelfUdpHandler with a hostname (rather than an IP address) as a destination, it gets resolved by DNS on every log message, which is a big performance concern. This is behaviour inherited from Python's DatagramHandler (see https://bugs.python.org/issue47149), but presumably pygelf could work around it by resolving the hostname itself on startup.

bmerry avatar Mar 29 '22 08:03 bmerry

Thanks, I'll look into this.

keeprocking avatar Mar 29 '22 20:03 keeprocking

There is some interesting discussion happening on the bpo bug mentioned above regarding handling DNS TTL.

bmerry avatar Mar 30 '22 07:03 bmerry