Fly-Style commented on code in PR #19378:
URL: https://github.com/apache/druid/pull/19378#discussion_r3149076801


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/WeightedCostFunction.java:
##########
@@ -24,17 +24,23 @@
 
 /**
  * Weighted cost function using compute time as the core metric.
- * Costs represent actual time in seconds, making them intuitive and 
debuggable.
- * Uses linear scaling without mode inversions for predictable behavior.
+ * Lag cost is based on recovery time in seconds; idle cost is a penalty 
derived from
+ * the predicted idle ratio.
+ *
+ * <p>Idle cost uses a U-shaped penalty with minimum at {@link 
#IDEAL_IDLE_RATIO}.
+ * This penalizes both under-provisioning (low idle, no safety margin, lag 
risk) and
+ * over-provisioning (high idle, wasted capacity), with asymmetric severity 
controlled by
+ * {@link #UNDER_PROVISIONING_PENALTY} and {@link #OVER_PROVISIONING_PENALTY}.
  */
 public class WeightedCostFunction
 {
   private static final Logger log = new Logger(WeightedCostFunction.class);
+
   /**
    * Multiplier for a lag amplification factor; it was carefully chosen
    * during extensive testing as the most balanced multiplier for high-lag 
recovery.
    */
-  static final double LAG_AMPLIFICATION_MULTIPLIER = 0.05;
+  static final double LAG_AMPLIFICATION_MULTIPLIER = 0.4;

Review Comment:
   I will note it in the patch notes. Generally, the intention was to find a 
point where scale-up/scale-down decisions are 'normal' in terms of normal 
distribution near `0.5/0.5` weights. `0.4` is a good amplification multiplier.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to