[squid-users] carp doc bug : parse_peer: token='carp-load-factor=0.5' SQUID2.6

From: Sylvain Viart <sylvain.viart@dont-contact.us>
Date: Tue, 06 Nov 2007 17:18:04 +0100

Hi,

I'm trying to test the CARP load balancing.

squid-2.6.16/src

But the documentation seems to be bugged.

Form the source :
"cache_cf.c"

#if USE_CARP
        } else if (!strcasecmp(token, "carp")) {
            if (p->type != PEER_PARENT)
                fatalf("parse_peer: non-parent carp peer %s/%d\n",
p->host, p->http_port);
            p->options.carp = 1;
#endif

The only supported parametter in the cache_peer parsing directive seems
to be 'carp' not 'carp-load-factor'.

Also from the source: void carpInit(void)
"carp.c" 193 lines --49%--
        /* and load factor */
        p->carp.load_factor = ((double) p->weight) / (double) W;

it seems to me, that the load_factor is in fact, calculated from peer
weight?

this works:
cache_peer php-01 parent 80 0 carp no-query no-digest originserver
login=PASS weight=1
cache_peer php-03 parent 80 0 carp no-query no-digest originserver
login=PASS weight=1
cache_peer php-04 parent 80 0 carp no-query no-digest originserver
login=PASS weight=1
cache_peer php-05 parent 80 0 carp no-query no-digest originserver
login=PASS weight=1
cache_peer php-06 parent 80 0 carp no-query no-digest originserver
login=PASS weight=1
cache_peer php-07 parent 80 0 carp no-query no-digest originserver
login=PASS weight=2
cache_peer php-08 parent 80 0 carp no-query no-digest originserver
login=PASS weight=1
cache_peer php-09 parent 80 0 carp no-query no-digest originserver
login=PASS weight=7

this one fails:

cache_peer php-01 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.062500
cache_peer php-03 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.062500
cache_peer php-04 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.062500
cache_peer php-05 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.062500
cache_peer php-06 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.062500
cache_peer php-07 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.187500
cache_peer php-08 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.062500
cache_peer php-09 parent 80 0 no-query no-digest originserver login=PASS
carp-load-factor=0.437500

Regards,
Sylvain.
Received on Tue Nov 06 2007 - 09:18:04 MST

This archive was generated by hypermail pre-2.1.9 : Sat Dec 01 2007 - 12:00:01 MST