Bug 30259 - When proxy connects to backend, a DNS lookup is done every time. Investigate a DNS cache
Summary: When proxy connects to backend, a DNS lookup is done every time. Investigate ...
Status: ASSIGNED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.0-HEAD
Hardware: Other other
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-22 13:44 UTC by Graham Leggett
Modified: 2012-03-11 13:00 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.