You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/17 15:36:33 UTC

[GitHub] [pulsar] frankjkelly commented on issue #15905: [Doc] Threshold Shedder documentation - need to add documentation on the individual weights

frankjkelly commented on issue #15905:
URL: https://github.com/apache/pulsar/issues/15905#issuecomment-1158999729

   @Demogorgon314 thanks the example is super helpful and perhaps could be added to the documentation?
   
   As regards the weights - isn't the purpose of the documentation so that I don't have to read the code / configuration files? 
   Also what are the range of values to set to weights? 0 to 1.0, 1.0 to 100.0?
   
   I also realized another question - when I read the code I was surprised to see when the resource weighting is employed here
   https://github.com/apache/pulsar/blob/a812f29bab93a5e841a9b3c3190fca343fab6e71/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java#L160-L164
   
   The the `max` of the `resource * resourceWeight` is used to determine  overload
   https://github.com/apache/pulsar/blob/a2559923877b005e4eec797214d1bcd9fb378df7/pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/LocalBrokerData.java#L253-L255
   
   Usually when I see a "weight" it is not a winner-take-all approach but some scoring that takes each resource & weight into account. In addition the calculation results are not normalized on a scale of 0 to 1 or 0 to 100 - the problem without normalizing 
   
   For example I could set loadBalancerCPUResourceWeight to 1000.0 and then the threshold would have to be scaled appropriately. 
   I see a divide by `100` here https://github.com/apache/pulsar/blob/a2559923877b005e4eec797214d1bcd9fb378df7/pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/LocalBrokerData.java#L253-L255
   but without bounds on the weights that's not going to normalize things.
   
   So even when I look at the config files I still need to read the code to figure out how those weights will be used.
   
   Anyway I am excited to use this feature and appreciate your insight and help.
   
   Thanks!
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org