Shiv Kumar
08/28/2026, 1:26 PMRocky
08/28/2026, 1:26 PMStarRocksCluster (SRC) custom resource. If an HPA modifies the replica count on the StatefulSet directly, the Operator will likely see this as a drift and attempt to scale it back to the value defined in your SRC YAML, leading to a "fight" between the HPA and the Operator.
* Lack of Native Support: Unlike Compute Nodes (CN), which have a built-in autoScalingPolicy in the StarRocks Operator, the FE component does not currently support native HPA or autoscaling through the Operator.
2. Is it safe to add/remove FE Observers dynamically?
While adding observers is a standard way to scale read performance and connection handling, doing it dynamically and frequently (e.g., every 2 hours) carries risks:
* Metadata Sync Overhead: Every time a new FE Observer starts, it must synchronize metadata from the Leader/Follower nodes (using BDB JE). For large clusters with significant metadata, this sync process consumes network bandwidth and CPU on your Leader FE, which is already under pressure during peak hours.
* Manual Cleanup Required: When the HPA scales the FE replicas down, the Operator will stop the pods, but it does not automatically run ALTER SYSTEM DROP OBSERVER.
* The dead IPs will remain in the StarRocks metadata.
* The Leader FE will continue to attempt heartbeats and metadata synchronization to these "dead" nodes, which adds unnecessary overhead to the Leader's CPU—exactly what you are trying to avoid.
* Connection Stability: If your Load Balancer or client application is connected to an Observer that gets terminated by the HPA, those active connections will fail.
Recommendations
Instead of dynamic FE scaling, consider these more stable approaches:
1. Vertical Scaling: Since you only have 3 FEs, increasing the CPU resources (e.g., from 8 to 16 cores) for those 3 replicas is the most stable fix. This avoids the metadata sync overhead of additional nodes.
2. Scheduled Scaling (Manual/Scripted): If your peak hours are predictable (e.g., 2 PM to 5 PM), you can use a cron job to patch the StarRocksCluster CRD to increase replicas to 7 before the peak starts and scale back down afterward. Crucially, your script must include a step to log into the Leader and run ALTER SYSTEM DROP OBSERVER for each removed node after scaling down.
3. Tuning Query Queuing: If the CPU is spiking specifically due to the queue, check your max_concurrency_ctrl_queries and concurrency_manager_type settings. Sometimes, lowering the concurrency limit slightly can prevent the FE from over-extending its CPU on planning/parsing too many queries at once.
4. Offload to CN: If the bottleneck is actually the compute cost of the queries and not just the FE's management overhead, consider using Compute Nodes (CN) for your workload. CNs do support native HPA and are designed to scale up and down dynamically without the metadata overhead that FEs have.
Summary: I would advise against using a standard HPA on FE pods. If you must scale, use a scheduled approach with a script that handles the ALTER SYSTEM DROP commands to keep your metadata clean.
References
• faq/operation_maintenance_faq.md
• deployment/deploy_manually.md
• deployment/sr_operator.mdShiv Kumar
08/28/2026, 1:41 PMRocky
08/28/2026, 1:42 PMenable_query_queue_v2 = true (default in v4.1+) and consider tuning query_queue_concurrency_limit to prevent the FE from even attempting to plan more queries than the system can handle.
References
• administration/management/resource_management/query_queues.md
• deployment/plan_cluster.md
• introduction/Architecture.md
• faq/Others.md
References
• administration/management/resource_management/query_queues.mdShiv Kumar
08/31/2026, 10:35 AMRocky
08/31/2026, 10:35 AMStarRocksCluster spec reflects replicas: 4 for the FE. The Operator will typically initialize the first 3 as Followers and any subsequent nodes as Observers.
References
• deployment/plan_cluster.md
• administration/management/Scale_up_down.md
• administration/Meta_recovery.md
References
• faq/operation_maintenance_faq.md
• deployment/deploy_manually.md
• sql-reference/sql-statements/cluster-management/nodes_processes/ALTER_SYSTEM.md
• administration/management/FE_configuration.md
• administration/Meta_recovery.md