You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by MDmitry_ <vp...@mail.ru> on 2019/03/05 05:55:58 UTC

WeightedRandomLoadBalancingSpi. How to make so that on a node with a big weight the bigger quantity of tasks left?

I try to use as loadBalancingSpi WeightedRandomLoadBalancingSpi. At one node
I set the weight 10, at another - 100. At a node weighing 10 weaker
configuration. The log show that the quantity of tasks leaves on both nodes
identical.

How to make so that on a node with a big weight the bigger quantity of tasks
left?

Config 1

    <property name="loadBalancingSpi">
        <bean
class="org.apache.ignite.spi.loadbalancing.weightedrandom.WeightedRandomLoadBalancingSpi">
          <property name="useWeights" value="true"/>
          <property name="nodeWeight" value="10"/>
        </bean>
    </property>

Config 2

    <property name="loadBalancingSpi">
        <bean
class="org.apache.ignite.spi.loadbalancing.weightedrandom.WeightedRandomLoadBalancingSpi">
          <property name="useWeights" value="true"/>
          <property name="nodeWeight" value="100"/>
        </bean>
    </property>



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: WeightedRandomLoadBalancingSpi. How to make so that on a node with a big weight the bigger quantity of tasks left?

Posted by "Maxim.Pudov" <pu...@gmail.com>.
Did you use ComputeTaskSplitAdapter [1] for your tasks? It works just fine on
2.7.0.

[1] 
https://ignite.apache.org/releases/2.7.0/javadoc/org/apache/ignite/compute/ComputeTaskSplitAdapter.html
<https://ignite.apache.org/releases/2.7.0/javadoc/org/apache/ignite/compute/ComputeTaskSplitAdapter.html>  



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: WeightedRandomLoadBalancingSpi. How to make so that on a node with a big weight the bigger quantity of tasks left?

Posted by MDmitry_ <vp...@mail.ru>.
All config 2

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">
		
    <bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="gridName" value="testGrid-server"/>
        <property name="clientMode" value="false"/>

        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">			
		
                <property name="ipFinder">
                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
								<value>some server</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
		

		
		<property name="peerClassLoadingEnabled" value="true"/>
		
		<property name="loadBalancingSpi">
			<bean
class="org.apache.ignite.spi.loadbalancing.weightedrandom.WeightedRandomLoadBalancingSpi">
			  <property name="useWeights" value="true"/>
			  <property name="nodeWeight" value="100"/>
			</bean>
		</property>
		
		
        <property name="includeEventTypes">
            <list>
                <util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
				<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
				<util:constant
static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/>
            </list>
        </property>

	</bean>
</beans>



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: WeightedRandomLoadBalancingSpi. How to make so that on a node with a big weight the bigger quantity of tasks left?

Posted by MDmitry_ <vp...@mail.ru>.
I use Apache Ignite 2.7.0



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: WeightedRandomLoadBalancingSpi. How to make so that on a node with a big weight the bigger quantity of tasks left?

Posted by MDmitry_ <vp...@mail.ru>.
I use Apache Ignite 2.7.0



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: WeightedRandomLoadBalancingSpi. How to make so that on a node with a big weight the bigger quantity of tasks left?

Posted by "Maxim.Pudov" <pu...@gmail.com>.
Hi Dmitry,
There is a test for WeightedRandomLoadBalancingSpi [1]. It passes on master.
Which version of Ignite do you use? Could you share a reproducer of the
issue so I can have a look?
[1]
https://github.com/apache/ignite/blob/master/modules/core/src/test/java/org/apache/ignite/spi/loadbalancing/weightedrandom/GridWeightedRandomLoadBalancingSpiWeightedSelfTest.java



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/