miércoles, marzo 07, 2007

Squid accelerator tips to serving content when a backend server is down

We can have squid to serve stale objects although the backend server is down.

  • Make sure negative_ttl is set to 0 seconds to disable the caching of errors.
  • If the web server become unreachable, set the connect timeout sufficiently short. There are three different connect timeouts depending on your config and requirements:
- config_timeout: for requests going DIRECT
- peer_config_timeout: for requests going to a cache_peer
- cache_peer ... timeout=XXX: specific timeout for this cache_peer, this one override peer_config timeout.

Default values are 1 minute for requests going direct and 30 seconds for requests sent to a cache_peer.

As a general statement in accelerator setups, you want the backend connect timeout quite short, a few seconds.

2 comentarios:

Anónimo dijo...

AFAIK, when all cache peers are down (or slow) squid detects that all peers are down and stop serve pages. I'm geting it wrong, or is there a way to keep serving the old copies of that pages from cache when it happens? Please, I got curious... :-)

Emilio dijo...

look for connect-timeout option in cache_peer directive.
what does cache.log o access.log say?