tanishq-chugh commented on code in PR #6723:
URL: https://github.com/apache/hive/pull/6723#discussion_r3880530870
##########
packaging/src/kubernetes/src/java/org/apache/hive/kubernetes/operator/autoscaling/LlapScalingStrategy.java:
##########
@@ -83,36 +85,57 @@ public int computeDesiredReplicas(List<PodMetrics>
podMetrics,
return minReplica;
}
- // Compute average busy slots across all LLAP pods
- double totalBusy = 0;
- int podCount = 0;
+ List<PodMetrics> tezAmMetrics =
orchestrator.getTezAmMetricsFromCache(cluster, llapName);
+ double totalPending = 0;
+ for (PodMetrics pm : tezAmMetrics) {
+ totalPending += pm.metrics().getOrDefault(METRIC_TEZ_PENDING_TASKS, 0.0);
+ }
+
+ double totalLLAPCapacity = 0;
+ double totalLLAPLoad = 0;
for (PodMetrics pm : podMetrics) {
double queued = pm.metrics().getOrDefault(METRIC_QUEUED, 0.0);
double configured = pm.metrics().getOrDefault(METRIC_CONFIGURED, 0.0);
double available = pm.metrics().getOrDefault(METRIC_AVAILABLE, 0.0);
- double busy = queued + configured - available;
- totalBusy += busy;
- podCount++;
+ totalLLAPCapacity +=
pm.metrics().getOrDefault(METRIC_MAX_FREE_SLOTS_CONFIGURED, 0.0);
+ totalLLAPLoad += queued + configured - available;
Review Comment:
Addressed in commit
[9056cc8](https://github.com/apache/hive/pull/6723/commits/9056cc84c06bd9958c165b29a74822378f7a9132)
##########
packaging/src/kubernetes/src/java/org/apache/hive/kubernetes/operator/autoscaling/LlapScalingStrategy.java:
##########
@@ -28,11 +28,11 @@
/**
* Scaling strategy for LLAP daemons.
- * Formula: avg(QueuedRequests + Configured - Available) across all pods.
- * This represents average "busy slots + queued" per daemon.
- * desired = ceil(avg_busy / scaleUpThreshold)
+ * For Scale-Up: Pending Load across all TezAM pods should be above the
threshold.
+ * For Scale-Down: Running Load across all LLAP pods should be below the
threshold.
+ * desired = ceil(totalClusterLoad / capacityPerDaemon)
* <p>
- * Activation gate: only scale if HS2 has open sessions (prevents zombie
scaling).
+ * Activation gate: only scale if HS2 has open sessions & TezAMs are running
DAGs (prevents zombie scaling).
Review Comment:
Addressed in commit
[9056cc8](https://github.com/apache/hive/pull/6723/commits/9056cc84c06bd9958c165b29a74822378f7a9132)
--
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]