how often will nginx query the dns when configured with ?

i'm expecting to configure nginx to load balance the load among a changing bunch of backend servers and do not want to loose reactivity ( nor send a dns query per http connection ).

do you know how often the hostname is resolved ?
is this configurable ?

<side optional question>
do you know if this setup prevents cookie-based stickiness ( which i do not strictly require but would like to have if possible nevertheless ) ?
... actually i'm not even sure stickiness is even supported for fastcgi backends

the doc suggests each IP will be used in round-robin fashion. i'm assuming nginx grabs all the IPs in one query and does not rely on the dns itself to perform the round-robin.

i'm also interested if you know whether this can be weighted by specifying the same ip multiple times ( assuming the dns handles it )

thanks a lot for your help

please do not elaborate on how dangerous this is/might be or better setups or whatever different subject unless you know the answer to my question or possess helpful experience. i'm aware of alternatives, pros, cons...

i might be interested in alternative software providing they provide the above feature AND are event-driven or equally efficient. apache does not even come close (please do not debate). lighttpd only provides such a feature in an abandoned branch AFAIK. other less common fast implementations i know of usually do not do fastcgi.
LVL 28
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dmitri FarafontovLinux Systems AdminCommented:
You can configure something like this:

resolver <DNS Server>;
set $upstream_endpoint1 https://FQDN;

      location /LocationMatch {
                proxy_pass $upstream_endpoint1;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skullnobrainsAuthor Commented:
my question is :

do you know how often the hostname is resolved ?
is this configurable ?

i'm not asking for a trivial google answer, and i need fastcgi, not proxypass
Dmitri FarafontovLinux Systems AdminCommented:
By default, nginx caches answers using the TTL value of a response. If you set a resolver parameter your Nginx would always resolve to a fresh IP every time.
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

skullnobrainsAuthor Commented:
wip. no force auto close
skullnobrainsAuthor Commented:
this is actually a bit more complex. resolver does not behave the way you describe.
i'm not working on that topic and won't be for a few more weeks
i'll post complete details when i'm done
... and most likely accept your comment anyway
Dmitri FarafontovLinux Systems AdminCommented:
skullnobrainsAuthor Commented:
why the hell would you force close the question ?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.