[ 
https://issues.apache.org/jira/browse/STORM-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14990162#comment-14990162
 ] 

ASF GitHub Bot commented on STORM-1165:
---------------------------------------

Github user redsanket commented on a diff in the pull request:

    https://github.com/apache/storm/pull/856#discussion_r43921298
  
    --- Diff: 
storm-core/src/jvm/backtype/storm/scheduler/resource/strategies/ResourceAwareStrategy.java
 ---
    @@ -209,18 +209,18 @@ private WorkerSlot getBestWorker(ExecutorDetails 
exec, TopologyDetails td, Strin
             for (RAS_Node n : nodes) {
                 if(n.getFreeSlots().size()>0) {
                     if (n.getAvailableMemoryResources() >= taskMem
    -                      && n.getAvailableCpuResources() >= taskCPU) {
    -                  double a = Math.pow((taskCPU - 
n.getAvailableCpuResources())
    -                          * this.CPU_WEIGHT, 2);
    -                  double b = Math.pow((taskMem - 
n.getAvailableMemoryResources())
    -                          * this.MEM_WEIGHT, 2);
    -                  double c = 0.0;
    -                  if(this.refNode != null) {
    -                      c = Math.pow(this.distToNode(this.refNode, n)
    -                              * this.NETWORK_WEIGHT, 2);
    -                  }
    -                  double distance = Math.sqrt(a + b + c);
    -                  nodeRankMap.put(distance, n);
    +                        && n.getAvailableCpuResources() >= taskCPU) {
    +                    double a = Math.pow(((taskCPU - 
n.getAvailableCpuResources())/(n.getAvailableCpuResources() + 1))
    +                            * this.CPU_WEIGHT, 2);
    +                    double b = Math.pow(((taskMem - 
n.getAvailableMemoryResources())/(n.getAvailableMemoryResources() + 1))
    +                            * this.MEM_WEIGHT, 2);
    +                    double c = 0.0;
    +                    if(this.refNode != null) {
    +                        c = Math.pow(this.distToNode(this.refNode, n)
    +                                * this.NETWORK_WEIGHT, 2);
    +                    }
    +                    double distance = Math.sqrt(a + b + c);
    +                    nodeRankMap.put(distance, n);
    --- End diff --
    
    sorry never mind +1 NB


> normalize the scales of CPU/Mem/Net when choosing the best node for Resource 
> Aware Scheduler
> --------------------------------------------------------------------------------------------
>
>                 Key: STORM-1165
>                 URL: https://issues.apache.org/jira/browse/STORM-1165
>             Project: Apache Storm
>          Issue Type: Improvement
>            Reporter: Boyang Jerry Peng
>            Assignee: Boyang Jerry Peng
>
> 1. Describe observed behavior.
> Memory has a default capacity of 2000.0, CPU has 400.0, network has a 
> distance value of either 1 or 2 (different rack); and the weights of them are 
> the same (1). 
> As a result, when choosing the best node for scheduling, the network plays a 
> minimal role in the calculation of the geometric square of the three 
> dimensions.
> 2. What is the expected behavior?
> Three resources place comparable roles in the node choosing algorithm.
> 3. Outline the steps to reproduce the problem.
> Need to assign appropriate or normalized scales to balance among the three 
> dimensions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to