You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by AJoshua <al...@gmail.com> on 2016/04/20 21:04:40 UTC

I have problems with balancing cache partitioning among nodes

so here goes to the senario, we can assume from the examples of gridgain
tutorial.
We have a person cache and I want to have only 8 partitions and all persons
should be distributed among these partitions. we can imagine, I have 8
companies in which each person belongs to one of those but I have no company
cache, only a key ’compKey' of type long. I have assigned @AffinityKeyMapped
to compKey.

The problem is if I have two node so the data is partitioned unbalanced i.e.
Node 1 keeps all compKey {2.4} and its people while Node 2 keeps compKey
{1,3,5,6,7,8} in most case in this form.
so if we write 1,000 people, exactly the same number of each org Key i.e.
125 of each, so people are balanced between node1 and 2 {250 respectively
750}



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-have-problems-with-balancing-cache-partitioning-among-nodes-tp4387.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I have problems with balancing cache partitioning among nodes

Posted by vkulichenko <va...@gmail.com>.
If you increase the number of companies, you should get much better
distribution. I would try this out and see how it changes the results.

If you have a very specific use case where the number of companies is very
limited, but you still want to use partitioned cache, you can implement the
affinity function. Let me know if you have additional questions about this.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-have-problems-with-balancing-cache-partitioning-among-nodes-tp4387p4405.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I have problems with balancing cache partitioning among nodes

Posted by AJoshua <al...@gmail.com>.
my goal is to test the performance between gigaspaces and gridgain in
gigaspaces i have implemented partitioning in the same way as the gridgain.
On gigaspaces grid service container that corresponds to the Node on
griddgain and each GSC is assigned with a number of partitions. the goal is
that the test should be between 200 thousand to 500 thousand data and
perhaps still too little data to test on ??.should I increase the number
companykey?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-have-problems-with-balancing-cache-partitioning-among-nodes-tp4387p4393.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I have problems with balancing cache partitioning among nodes

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

This is possible with this little number of affinity keys, because built-in
affinity functions give better results on the growing data. Affinity
function is pluggable, so you can implement AffinityFunction interface and
provide it in the CacheConfiguration.

But at first I would make sure that you really need a partitioned cache.
Generally, it's needed for large data sets or growing data sets that you
want to scale out when needed. Sounds like both are not your cases, so
probably you can just use replicated cache?

See this page for more information about different cache modes:
https://apacheignite.readme.io/docs/cache-modes

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-have-problems-with-balancing-cache-partitioning-among-nodes-tp4387p4389.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.