You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should support a flag per jdomain instance indicating if we explicitly want nginx to do the DNS lookup or not on startup.
This has implications on memory management of course, but this could be a very important improvement.
Currently, the way nginx is forced to do a DNS lookup for each jdomain occurrence on startup, the startup time can become very very excessively long if the nginx config includes many jdomain directives (as is the case in my own production config now...).
If we were to allow nginx to start without doing the initial lookup, then nginx could start up very snappy as it usually does, and defer the lookups to later. This is effectively taking the fallback (backup server, as of jdomain 1.0) mechanism to the next step, so I think it shouldn't be that difficult to implement.
The text was updated successfully, but these errors were encountered:
I think easiest way would be to create a new status state INIT and assign that to jdomains that have variable defer set.
Skip ngx_parse_url part on those during configuration load and set them as up with dummy values.
When we hit ngx_http_upstream_init_jdomain_peer, original init_peer will sometime send as deferred ones since it thinks they are up. We can do the usual and start DNS resolution for all instances like we do now and return NGX_ERROR at very end if the peer sent to us had INIT set.
One of the these might happen after that (I think these are all?)
If we have an upstream with backup variable, that might get called if there is nothing else or all others are down as well.
Nothing is found and client gets server or upstream error.
We ran into this. Worked around it with a local dns cache.
Doesnt help on first server start, but subsequent reloads (which were the problem) are significantly improved. Doesnt help however in the case of low ttl (i.e 1s) or some DNS failure codes.
An init state makes sense to me as long as configuration complete can continue to block on DNS lookup. This could allow for parallel lookup and the continuation of configuration parsing and loading. Not sure however if this is possible as the nginx event loop isnt available AFAIK during configuration startup.
We should support a flag per jdomain instance indicating if we explicitly want nginx to do the DNS lookup or not on startup.
This has implications on memory management of course, but this could be a very important improvement.
Currently, the way nginx is forced to do a DNS lookup for each jdomain occurrence on startup, the startup time can become very very excessively long if the nginx config includes many jdomain directives (as is the case in my own production config now...).
If we were to allow nginx to start without doing the initial lookup, then nginx could start up very snappy as it usually does, and defer the lookups to later. This is effectively taking the fallback (backup server, as of jdomain 1.0) mechanism to the next step, so I think it shouldn't be that difficult to implement.
The text was updated successfully, but these errors were encountered: