[squid-users] Load balancing redirector problem with virtual hosts

From: Todd Harris <harris@dont-contact.us>
Date: Mon, 25 Jul 2005 15:07:57 -0600

Hi all -

Okay, I've poked around a bunch looking for possible solutions to this
problem but can't seem to make any headway.

I'm implementing a simple load balancing solution between two origin servers
one of which is running squid and must also handle a number of
non-accelerated virtual hosts.

The set up looks like this:

Primary server:
    Squid in surrogate mode listening on 80, with redirector for all URIs
    Apache, bound to 127.0.0.1 listening on 80
        Serving a number of name-based virtual hosts

Secondary server:
    Apache bound to IP listening on 80
    
I have squid running successfully for all virtual hosts using the single
primary origin server with the following directives:

  httpd_accel_host 127.0.0.1
  httpd_accel_port 80
  httpd_accel_single_host on
  httpd_accel_uses_host_header on

If I try to add support for my simple redirector (listed below) using the
following directives, I can no longer connect to any of the virtual hosts.
Client connections end up timing out (WARNING: Closing client 24.10.x.x
connection due to lifetime timeout).

  redirect_program /path/to/load_balancer.pl
  redirect_rewrites_host_header off
  httpd_accel_host 127.0.0.1
  httpd_accel_port 80
  httpd_accel_single_host off
  httpd_accel_uses_host_header on

The redirector (pared down for simplicity; eventually will direct to
secondary server too):

    #!/usr/bin/perl -w
    $|++;
    while (<>) {
       print "http://127.0.0.1";
    }

I'm sure this is a matter of balancing the different confg directives but I
haven't seen an config exactly like this before.

Any insight would be greatly appreciated!

Todd
Received on Mon Jul 25 2005 - 15:08:00 MDT

This archive was generated by hypermail pre-2.1.9 : Mon Aug 01 2005 - 12:00:03 MDT