Re: Accelerator mode: connect retry possible?

From: Andreas J. Koenig <andreas.koenig@dont-contact.us>
Date: 14 Apr 1999 04:29:17 +0200

>>>>> On Mon, 12 Apr 1999 22:12:32 +0200, Henrik Nordstrom <hno@hem.passagen.se> said:

> Andreas J. Koenig wrote:
>> I'm using squid in accelerator mode only and I haven't yet found a way
>> to let squid retry to connect to the backend apache if a connect
>> fails. Squid aborts immediately with an error message.

> It does, but very fast. If your OS has the IP interface enabled any
> instance when Apache is not listening then Squid will quickly give up.

> What you can do is to set up the backend server on an virtual IP
> interface which is brought up after Apache is started, and brought down
> before Apache is shut down. This way Squid will properly retry
> connections until the backend server is online again.

Thanks Henrik!

Sounds like a clever workaround. But is it portable? I took a day ill
to try it out on Linux (2.2.5) but so far I haven't got it working.
I'm stuck because taking down the interface with "ifconfig eth0:0
down" also cleans the routing table. That causes Squid to fail with
"No route to host" too quickly. It's better than before but not
predictible enough. Any suggestion how to improve what I have tried?

  case "$1" in
    start)
          echo -n "Configuring virtual IPs: "
          ifconfig eth0:0 192.168.3.10
          route add -host 192.168.3.10 dev eth0:0
          echo Done
          ;;
    stop)
          echo -n "Unconfiguring virtual IPs: "
          ifconfig eth0:0 down
          # implicitly done by ifconfig down: route del 192.168.3.10
          echo Done
          ;;
    *)
          echo "Usage: virt-ip {start|stop}"
          exit 1
  esac

-- 
andreas
Received on Tue Apr 13 1999 - 20:14:06 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:45:50 MST