Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server hostname is cached for the duration of the process requiring restarts to refresh #70

Open
nkvoll opened this issue Mar 26, 2014 · 3 comments

Comments

@nkvoll
Copy link

nkvoll commented Mar 26, 2014

It looks like both GelfUDPSender and GelfTCPSender caches the hostnames of the graylog server for the duration of the process, which makes it unnecessary hard to fail-over / replace the server without restarting all the clients so they can resolve the hostname again.

Please correct me if I've read the source code wrong.

Is there any reason why this cannot be done upon every reconnect on the GelfTCPSender and periodically (i.e default every 10 min, configurable via a new setting) for the GelfUDPSender?

@t0xa
Copy link
Owner

t0xa commented Mar 26, 2014

You are right. Appender only resolves hostname during instantiation. Resolving hostname every send might be very time consuming.

I think configurable cache should be best option.

@hackmann
Copy link

Unless system property networkaddress.cache.ttl is set, it will not make a difference as the JDK will cache DNS lookups forever anyway

@danielAparicio
Copy link

danielAparicio commented Oct 27, 2016

Hi

@t0xa "Resolving hostname every send might be very time consuming." why? most of the time is going to be fetched from cache (depends on the ttl value) and if you don't set the networkaddress.cache.ttl in the java.security file is always going to be fetched from cache (default setting in the JVM)

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants