Bug 30259

Summary: When proxy connects to backend, a DNS lookup is done every time. Investigate a DNS cache
Product: Apache httpd-2 Reporter: Graham Leggett <minfrin>
Component: mod_proxyAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: ASSIGNED ---    
Severity: enhancement CC: jfclere
Priority: P3    
Version: 2.0-HEAD   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Graham Leggett 2004-07-22 13:44:13 UTC
When proxy_http (and I assume the other proxy modules) make a connection to the
backend, a DNS lookup is potentially performed for each request.

A simple DNS cache, flushed on server graceful restart, should improve
performance here.

To make this configurable, a timeout should be set as to the age of the entires
in the cache, 0 meaning "don't cache". A typical value might be 1 minute or so -
short enough so that admins who change the IP in DNS and then don't see the
change in their httpd installation won't be sent on a wild goose chase, but long
enough to make a significant difference to performance.
Comment 1 Joe Orton 2004-07-22 13:55:21 UTC
Why implement in httpd?  Why not use existing solutions e.g. nscd works well.
Comment 2 Graham Leggett 2004-07-22 13:59:03 UTC
It would have to be investigated whether something like nscd would give enough
of a performance enhancement, or in environments where this is not possible
(win32?) whether a cache would improve things.

This is why this bug is marked as "enhancement" :)
Comment 3 Tim B 2012-03-11 13:00:46 UTC
Windows Server has its own DNS implementation, and recursive DNS servers such as Unbound are available cross-platform, so the Windows case is covered.

Of course there's no httpd code to benchmark against, but external cacheing resolvers offer good performance without adding complexity.