You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Ajay <aj...@6dtech.co.in> on 2017/07/19 14:28:36 UTC

Ignite2.0 Affinity Key Distribution

Hi,

I want to know scenarios,
1)I have 10 affinity keys like 1-10 suppose when i load this keys between
two servers(2 nodes) it will equally distribute or randomly distribute?

2)I have 10 normal keys like 1-10 suppose when i load this keys between two
servers(2 nodes) it will equally distribute or randomly distribute?

Thanks,
Ajay.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by mcherkasov <mc...@gridgain.com>.
I don't about recommendations about this, you can use default value, which
works well for a lot of users.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123p15191.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by vkulichenko <va...@gmail.com>.
Ajay,

To get better distribution you should have more partitions. Ideally, number
of partitions should be at least order of magnitude bigger than number of
nodes. I also recommend to use power of 2 as number of partitions (128, 256,
512, ...).

Default value is 1024 and it works fine in majority of cases. Why do you
change it in the first place?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123p15194.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by Ajay <aj...@6dtech.co.in>.
Hi,

How much size(threshold limit) recommended for a partition.

Thanks,
Ajay.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123p15178.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by mcherkasov <mc...@gridgain.com>.
>I configured 10 partitions, when i started the cluster with two nodes i saw
8 partitions in one server and two partitions in other server, can we make
partitions equally?

Play a little bit with partition number, try to set it to 128 or 256.

>If not then 8 partitions servers having more load compare to other right? 
right.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123p15173.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by Ajay <aj...@6dtech.co.in>.
Hi,

I configured 10 partitions, when i started the cluster with two nodes i saw
8 partitions in one server and two partitions in other server, can we make
partitions equally?If not then 8 partitions servers having more load compare
to other right?

Thanks,
Ajay.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123p15167.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by mcherkasov <mc...@gridgain.com>.
Hi Ajay,

you question isn't fully correct,in both questions we should talk about
affinity key,
if you don't define affinity key, normal key is affinity key.

for simplicity I can say yes: all key/object pairs will be distributed
equally, at least for big amount of data with 
good key's hashcode.
see default implementation for affinity function RendezvousAffinityFunction
for details.

Thanks,
Mikhail.





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123p15132.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite2.0 Affinity Key Distribution

Posted by Andrey Mashenkov <am...@gridgain.com>.
Hi,

Keys are distributed among partitions according to affinity function.
Partitions are distributed among nodes according to affinity function.
This chain "key->partition->node" is designed to simplify data exchange
between nodes on topology changing and due to performance reasons.

RendezvousAffinityFunction is used by default. It tries to distribute keys
among partitions in equal manner using key hashcode.
Partition distribution among nodes is quite complex as here we have an
optimizations to reduce number of partition transfers on unstable topology
and save distribution as closer to equal as possible.

AffinityKey is intended for data collocation purposes. Actually,
AffinityKey is passed in affinity functions for affinity calculations if it
is configured.
If no affinity key is configured for key type, then entry key itself will
be passed to affinity function where it will be used for affinity
calculations.

On Wed, Jul 19, 2017 at 5:28 PM, Ajay <aj...@6dtech.co.in> wrote:

> Hi,
>
> I want to know scenarios,
> 1)I have 10 affinity keys like 1-10 suppose when i load this keys between
> two servers(2 nodes) it will equally distribute or randomly distribute?
>
> 2)I have 10 normal keys like 1-10 suppose when i load this keys between two
> servers(2 nodes) it will equally distribute or randomly distribute?
>
> Thanks,
> Ajay.
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Ignite2-0-Affinity-Key-Distribution-tp15123.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>