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

Define carbon servers by hostname #186

Closed
dctrwatson opened this issue Mar 19, 2013 · 6 comments · Fixed by #188
Closed

Define carbon servers by hostname #186

dctrwatson opened this issue Mar 19, 2013 · 6 comments · Fixed by #188

Comments

@dctrwatson
Copy link

Currently can only use ip:port

This will allow the use of round-robin DNS as primitive load-balancing many carbon-relay/caches
Or makes it easier to move carbon-cache/relay to another node

Definitely wouldn't recommend this without a local recursive dns caching daemon (unbound, tinydns, dnsmasq)

@unbit
Copy link
Owner

unbit commented Mar 20, 2013

Note for the patch maker: the new behaviour should be triggered by an option (like --carbon-name-resolve/--carbon-resolve-names/...).

Generally uWSGI does not resolve names, so we need to continue such default behaviour.

The uWSGi function for resolving names is:

char *uwsgi_resolve_ip(char *domain);

the returned string is overwritten everytime the function is called (it is a static buffer) so there is no need to free it

@prymitive
Copy link
Contributor

Should we retry if hostname can't be resolved? Currently retries are done only on connect errors to minimize gaps.
I think that dns issues should not cause fast retry like connect errors, those issues are rare, global and unlikely to be solved in just few seconds, so we should not care.

@prymitive
Copy link
Contributor

I mean we will try again to resolve hostname and send metrics, but in next cycle, not after just few seconds like with connect errors.

@dctrwatson
Copy link
Author

I agree with that behavior (retrying resolve on next cycle)

@prymitive
Copy link
Contributor

Side note: uwsgi_resolve_ip() return always the first IP from hostname, so to have working round robin DNS server needs to return records in random or cyclic order

@unbit unbit closed this as completed in 4ec78ed Mar 21, 2013
@unbit
Copy link
Owner

unbit commented Mar 21, 2013

i think i can write an uwsgi_resolve_ip2(char *ip, uint8_t *attempt);

basically attempt is a suggestion to the function to use a specific item. When a resolve fails, attempt is incremented (forcing the function to try the next one at the next iteration). I will work on that tomorrow.

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

Successfully merging a pull request may close this issue.

3 participants