Issue #3462456 by o'briat, japerry: docs: DNS lookups are not bounded by OPT_CONNECT_TIMEOUT

Follow-up from comment #12: with the documented recipe a stopped memcached container still cost ~6 s per request. The connect timeout was never the problem: stopping a container removes its name from Docker's DNS, and libmemcached-awesome maps the resolver's temporary failure (EAI_AGAIN) to MEMCACHED_TIMEOUT after however long the system resolver takes, which OPT_CONNECT_TIMEOUT does not limit. Each connection (bootstrap container and main container) pays that once per request. A production server that is down normally still resolves and takes the connect-timeout path.

  • README explains the DNS cost, how to measure it (getent hosts from the web container) and how to test the connect-timeout path instead (IPs, or pausing the container).
  • The advice against combining OPT_REMOVE_FAILED_SERVERS with persistent connections was wrong: with OPT_DEAD_TIMEOUT set the pool remembers the dead server for the worker's lifetime and re-probes it every OPT_DEAD_TIMEOUT seconds, at the cost of one failed operation per probe. That is the configuration that removes the per-request cost entirely, so the README now recommends it and gives the recipe.
  • Kernel test covering the persistent pool: no rediscovery on the next request, a re-probe after the dead timeout, and re-ejection.

Closes #3462456

Merge request reports

Loading
Loading