From 64559c565f099dc15a6e4c21051861e42514a0ab Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 7 Apr 2012 09:08:45 +0200 Subject: [PATCH] CLEANUP: lb_first: add reference to a paper describing the original idea The original idea behind this implementation has been published in the paper below : http://reports-archive.adm.cs.cmu.edu/anon/2012/CMU-CS-12-109.pdf --- doc/configuration.txt | 9 +++++++-- src/lb_fas.c | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 46f3653a7..782bda9e8 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -1280,13 +1280,18 @@ balance url_param [check_post []] connection. The servers are choosen from the lowest numeric identifier to the highest (see server parameter "id"), which defaults to the server's position in the farm. Once a server - reaaches its maxconn value, the next server is used. It does + reaches its maxconn value, the next server is used. It does not make sense to use this algorithm without setting maxconn. The purpose of this algorithm is to always use the smallest number of servers so that extra servers can be powered off during non-intensive hours. This algorithm ignores the server weight, and brings more benefit to long session such as RDP - or IMAP than HTTP, though it can be useful there too. + or IMAP than HTTP, though it can be useful there too. In + order to use this algorithm efficiently, it is recommended + that a cloud controller regularly checks server usage to turn + them off when unused, and regularly checks backend queue to + turn new servers on when the queue inflates. Alternatively, + using "http-check send-state" may inform servers on the load. source The source IP address is hashed and divided by the total weight of the running servers to designate which server will diff --git a/src/lb_fas.c b/src/lb_fas.c index 07baf5d21..daff66629 100644 --- a/src/lb_fas.c +++ b/src/lb_fas.c @@ -1,6 +1,12 @@ /* * First Available Server load balancing algorithm. * + * This file implements an algorithm which emerged during a discussion with + * Steen Larsen, initially inspired from Anshul Gandhi et.al.'s work now + * described as "packing" in section 3.5: + * + * http://reports-archive.adm.cs.cmu.edu/anon/2012/CMU-CS-12-109.pdf + * * Copyright 2000-2012 Willy Tarreau * * This program is free software; you can redistribute it and/or