Ignore:
Timestamp:
2007-08-31 13:14:06 (7 years ago)
Author:
Cecilie Fritzvold <cecilihf@…>
Branches:
master, 1.2, 3.0, 4.0, experimental-ims
Children:
71f797
Parents:
86a6b9
git-author:
Cecilie Fritzvold <cecilihf@…> (2007-08-31 13:14:06)
git-committer:
Cecilie Fritzvold <cecilihf@…> (2007-08-31 13:14:06)
Message:

Added support for load balancing among backends in varnish. It is still experimental
and very basic, but it should be ready for testing. Two strategies for load balancing
are implemented: a simple round robin, and a simple weighted random. The following
is an example configuration in vcl. The weight parameter for random is optional. Default
is equal weight.

backend foo {

set backend.host = "foo.bar.com";
set backend.port = "http";

}

backend_round_robin rr {

set backend.set = {

{ "foo1.bar.com", "http" }
{ "foo2.bar.com", "http" }
{ "foo3.bar.com", "http" }

};

}

backend_random rrr {

set backend.set = {

{ "foo1.bar.com", "http", 0.3 }
{ "foo2.bar.com", "http", 0.6 }
{ "foo3.bar.com", "http", 0.1 }

};

}

sub vcl_recv {

if {req.http.host ~ "foo"} {

req.backend = foo;

} elseif {req.http.host ~ "bar"} {

req.backend = rr;

} else {

req.backend = rrr;

}

}

git-svn-id:  http://www.varnish-cache.org/svn/trunk/varnish-cache@1931 d4fa192b-c00b-0410-8231-f00ffab90ce4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libvcl/vcc_gen_fixed_token.tcl

    r261945 r0b0c12  
    7474 
    7575        backend 
     76         
     77        backend_round_robin 
     78 
     79        backend_random 
    7680} 
    7781 
     
    138142        unsigned        nref; 
    139143        unsigned        busy; 
    140  
     144         
    141145        unsigned        nsrc; 
    142146        const char      **srcname; 
Note: See TracChangeset for help on using the changeset viewer.