Bug 61791 - make mod_proxy 'honor DNS ttl' with enablereuse on (dnsttl, addressTTL ?)
Summary: make mod_proxy 'honor DNS ttl' with enablereuse on (dnsttl, addressTTL ?)
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 enhancement with 2 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2017-11-20 16:36 UTC by Alexandre Schaff
Modified: 2017-12-10 18:52 UTC (History)
1 user (show)

diff to add dnsttl parameter to ProxyPass (3.64 KB, patch)
2017-11-20 16:36 UTC, Alexandre Schaff
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Schaff 2017-11-20 16:36:29 UTC
Created attachment 35541 [details]
diff to add dnsttl parameter to ProxyPass

When ProxyPass backend is a hostname and enablereuse is On, the DNS resolution is done at child startup only.

It may be an issue in environments with auto-scaling, e.g. AWS : 
   * 'disablereuse on' is not a good solution for perfs.
   * MaxConnectionsPerChild is not precise enough to make child restart

Idea is to have parameter 'dnsttl' added to ProxyPass.
If an IP change is detected after a dnsttl : update worker->cp->addr with new value.
New connections are made to new addr, old stay unchanged ( e.g. for AWS grace period )

Attached is a very simple patch [*] to summ-up the idea.
[*] patch done on httpd-2.4.29 for very simple testing only (not prod ready!)

Similar has been discussed in mailing lists several times.  
Latest seen : https://lists.apache.org/thread.html/cf2aa9351063ceb90228ef66ce604c85e23124567bb174c92dcc677f@1464388317@%3Cusers.httpd.apache.org%3E

@Yann, maybe your 'addressTTL' patch does answer the need.