cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaakko <rosvopaalli...@gmail.com>
Subject Re: loadbalance and different strategies
Date Wed, 10 Feb 2010 00:12:04 GMT
> (2) is where we get into trouble here no matter which DC we add to.
>  (a) if we add to G's DC, X will get all the replicas G has, remaining
> unbalanced
>  (b) if we add to the other DC, G will still be hit from all the
> replicas from the other DC

2b: yes
2a: not necessarily. Let's return once more to the original ring:

A: H-A, F-G
B: A-B, H-A
C: B-C, H-A, A-B
D: C-D, B-C
E: D-E, C-D
F: E-F, D-E
G: F-G, A-B, B-C, C-D, D-E, E-F
H: G-H, E-F, F-G

Let us suppose that all ranges are equal in size. In this case G's
range is A-G. If X boots in G's DC, it should take a token in the
middle of this range, which would be somewhere around D. If X boots
behind D, the ring would be:

A: H-A, F-G
B: A-B, H-A
C: B-C, H-A, A-B
D: C-D, B-C
X: D-X, A-B, B-C, C-D
E: X-E, C-D, D-X
F: E-F, X-E
G: F-G, D-X, E-F
H: G-H, E-F, F-G

In this case X takes approximately half of G's load, since it takes
approximately half of replicas G was responsible for.

IMHO a new node should take half of the most loaded node *in the same
DC*. If it only considers most loaded node, things go wrong, as
booting in the middle of that range in another DC will not balance the
load in any way.

> So ISTM that the only real solution is to do what we say in the
> Operations page, and make sure that nodes on the ring alternate DCs.

Yes, alternating the nodes is certainly the best. However, two DCs
don't always have the same number of nodes. Also, currently
loadbalance is unusable in such environment.

-Jaakko

Mime
View raw message