nginx performance using resolver

Nginx Lova lists at ruby-forum.com
Thu Feb 5 01:10:19 MSK 2009


Hello

I have nginx setup to create the upstream on the fly.


if ($request_uri ~* "^/(.*)/resource")
  {
    set $user $1;
    proxy_pass   http://$user.resource.domain.com:7600$request_uri;
                 break;
         }

so here if the url is

http://domain.com/nginx/resource

nginx will send that to nginx.resource.domain.com:7600

I have setup bind on the same machine (with zone files) and have the
resolver set to 127.0.0.1;

Local digs (dig @127.0.0.1 nginx.resource.domain.com +short) take ms.

When I include the upstream with the ip, the passing is instant, when I
don't have the upstream which forces the use of the resolver it take
over 30 seconds.

Has anyone seen this behavior ? I didn't find much info on the resolver
declaration.

Also how do I tell the resolver to use the systems resolver method ?
So I want nginx to use whatever the OS uses (dns entries in resolv.conf
or hardcoded ips in /etc/hosts.


Cheers
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list