Re: LFM calculates with error in CARP

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 24 Feb 2002 19:15:18 +0100

Hi. Thanks for your report.

However, The CARP implementation in Squid has been cleaned up a lot
lately. See http://devel.squid-cache.org/carp/ for the improved
implementation. It addresses the concerns raised I think (not 100%
sure about 2, was a while since..), plus makes CARP interoperate more
friendly with the other peer selection algorithms.

You are most welcome to review the new code if you like, to ensure
that it has got the calculations correct.

Also needs help with implementing the rest of CARP.
  - CARP client, reading the membership table
  - CARP manager, generating the memebership table from the peerings
in squid.conf and current known status.
  - Intra-array request routing

Regards
Henrik Nordström
Squid Developer

On Sunday 24 February 2002 06:48, Alexey Makarenko wrote:
> Hi!
>
> -------------------------------------------------------------------
>---------- platforms: All
> version: squid-2.3.STABLE4 (all squid-2.3* and squid-2.4*)
> synopsys: The Load Factor Multiplier & Resultant_value (score)
> calculates with error in CARP because unsigned int
> is used instead of float.
> configuration: --enable-carp
> patch: squid-2.3.stable4-carp-lfm.patch
> NOTE: only after squid-2.3.stable4-carp-assertion.patch
> -------------------------------------------------------------------
>---------- Details:
>
> 1.The Load Factor Multiplier (LFM) calculation uses pow() with
> small arguments (<1). It makes huge presition error in calculations
> with int and all calculations have to be done with float.
> For example, LFM wich was calculated for the first (in squid.conf
> order) parent proxy by the next formula:
> p->carp.load_multiplier = pow(K * p->carp.load_factor, 1 / K);
> is always equal to "1" ( 1/K = 0 when calculated with int).
> ([1] says that LFM has to be float 32bit)
>
> 2. The Resultant_value (score) calculation is done by
> multiplitation unsigned long (32 bit) and LFM
> (carp.load_multiplier) wich may have value > 1, that may results in
> overflow.
> Therefore caltulation should use float or unsigned long long
> (u_int64) with LFM multiplied to big factor, what may be more
> optimal when calculated without math coprocessor.
>
> 3. One more feature is that The Load Factor Multiplier must be
> calculated from the smallest load_factor to the largest
> load_factor.
> That is parent proxy declaration has to be in accending order by
> carp-load-factor in squid.conf. The management of this condition
> does not exist for today..
>
> References:
> 1. Vinod Valloppillil & Keith W. Ross, "Cache Array Routing
> Protocol v1.0" <draft-vinod-carp-v1-03.txt>
> http://ircache.nlanr.net/Cache/ICP/carp.txt, 26 Feb, 1998.
> -------------------------------------------------------------------
>----------
>
> Best regards. Alexey Makarenko.
Received on Sun Feb 24 2002 - 13:44:06 MST

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