Re: Varnish as load balancer

2009-05-18 Thread Tollef Fog Heen
]] "Carlos Oliva G." 

| In the current setup I'm skipping Lighttpd altogether and began using  
| Varnish as a load balancer altogether as well, with the 'directors'  
| feature. However I'm still missing the last bit of the requested  
| functionality that is to evenly balance all the requests from  
| 'anonymous' users that aren't registered/logged into the system (which  
| I am already identifying in the sub_rcvd function of my VCL), but for  
| registered users to preserve their session by redirecting them always  
| to the same backend server. I know I can create a 'hash' using some  
| relatively unique values, as the originating IP address + the User  
| Agent and a session-dependent cookie value, but what I don't know is  
| (if possible), how to use this hash to determinate to what backend  
| server to direct the request to.

We currently don't have a hashing load balancer (which is what you seem
to want).  (Patches accepted, or Redpill Linpro can get you a quote on
how much work it is to develop it.)

What you could do is have the backend set a cookie with its name when
the user logs in, and then choose backend depending on cookie value.

Another alternative is to use nginx or similar as Varnish' backend and
let that do the hashing and load balancing.  I have been told it's quite
good, but I don't have experience with it myself.

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Newbie question

2009-05-18 Thread Tollef Fog Heen
]] Monah Baki 

| Here is part of the logs, how can I tell it's working?

It doesn't seem to be caching, most likely because the backend sets a
cookie (which means we, by default, don't cache).

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: varnish experience on high request rates

2009-05-18 Thread Tollef Fog Heen
]] Václav Bílek 

| Is there anyone using varnish on such request rates? If yes, what HW do
| you use.

I've had Varnish serve about 20k requests/sec on a single node.  I've
also had it fill a 1Gbit pipe on a single node.  Hardware in both cases
was some reasonably new Xeon system with enough memory to fit your
working set.

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Varnish as load balancer

2009-05-18 Thread Christoph Handel
On Mon, May 18, 2009 at 11:13:24AM +0200, Tollef Fog Heen wrote:
> ]] "Carlos Oliva G." 
> 
> | In the current setup I'm skipping Lighttpd altogether and began using  
> | Varnish as a load balancer altogether as well, with the 'directors'  
> | feature. However I'm still missing the last bit of the requested  
> | functionality that is to evenly balance all the requests from  
> | 'anonymous' users that aren't registered/logged into the system (which  
> | I am already identifying in the sub_rcvd function of my VCL), but for  
> | registered users to preserve their session by redirecting them always  
> | to the same backend server. I know I can create a 'hash' using some  
> | relatively unique values, as the originating IP address + the User  
> | Agent and a session-dependent cookie value, but what I don't know is  
> | (if possible), how to use this hash to determinate to what backend  
> | server to direct the request to.
> 
> We currently don't have a hashing load balancer (which is what you seem
> to want).  (Patches accepted, or Redpill Linpro can get you a quote on
> how much work it is to develop it.)
> 
> What you could do is have the backend set a cookie with its name when
> the user logs in, and then choose backend depending on cookie value.
> 
> Another alternative is to use nginx or similar as Varnish' backend and
> let that do the hashing and load balancing.  I have been told it's quite
> good, but I don't have experience with it myself.

you could take a look at haproxy (http://haproxy.1wt.eu/)

copes with pretty high loads and allows you to inject cookies for
sticky sessions.

Greetings
  Christoph
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc