<div>Hi,</div><div>I&#39;m testing performance of nginx as reverse proxy where it selects the upstream server by composing a dns name based on the incoming request&#39;s host header. For example if the request is for <a href="http://username.domain.com/images">username.domain.com/images</a>, the upstream server is username-images.internal. This username-images.internal is looked up in a internal dns server which is configured using the resolver directive.</div>

<div><br></div><div>When I hit nginx with requests that use about 30000 different hostnames using http_load tool with 1600 parallel requests, I see this error:   </div><div><br></div>2010/03/24 15:12:50 [error] 11650#0: *2260409 <a href="http://user12-images.nginxtest.com">user12-images.nginxtest.com</a> could not be resolved (110: Operation timed out), client: 10.10.65.221, server: *.<a href="http://nginxtest.com">nginxtest.com</a>, request: &quot;GET /10kb HTTP/1.0&quot;, host: &quot;<a href="http://user12.nginxtest.com">user12.nginxtest.com</a>&quot;<div>

<br></div><div>I&#39;ve tried with resolver_timeout from 1 second to 10 seconds. This error doesn&#39;t happen with lesser number of dns record set (like 100 different usernames). But happens consistently with 30k users. I&#39;m sure there is no issues with the dns server itself because I&#39;ve run dnsperf on the dns server and it can do 20000 queries/second with max time being less than a second.</div>

<div><br></div><div>Also, isn&#39;t nginx supposed to cache the dns records for 300 seconds?</div><div><br></div><div>Any help in resolving this issue is greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Vinay</div>