dipti.d1
08/06/2026, 10:13 AMRocky
08/06/2026, 10:13 AMpipeline_dop = 1. This prevents a single query from "hogging" all CPU cores, allowing more queries to run in parallel.
* Row-Store Cache (v3.2.3+): If your use case involves high-concurrency point lookups (finding one row by ID), enable the Column-Row hybrid storage on Primary Key tables. This provides sub-millisecond point-lookup latency and drastically reduces CPU usage compared to pure columnar scans.
* Short-query optimization: Use Prepared Statements to reduce FE (Frontend) overhead for repetitive high-frequency queries.
Summary Recommendation
Goal | Recommended Approach
Lowest Storage Cost | Shared-Data (Object Storage)
Highest Concurrency | Shared-Data (for elastic scaling) + pipeline_dop=1
Lowest Latency | Shared-Data + Data Cache (on NVMe) OR Shared-Nothing
Best Balance | StarRocks 3.x Shared-Data with local SSD Cache
For most modern deployments aiming for low cost, Shared-Data is the superior choice as it provides the elasticity of the cloud without sacrificing the "ultra-fast" performance of the Shared-Nothing model.
References
• introduction/Architecture.md
• knowledge/usage/load/shared_data_batch_ingestion.md
• knowledge/usage/best-practice.md
• deployment/shared_data/feature-support-shared-data.mddipti.d1
08/06/2026, 11:25 AMdipti.d1
08/06/2026, 11:44 AMRocky
08/06/2026, 11:44 AMbrpc_connection_pool_size) to send fragments of the execution plan to BEs. If the FE is underpowered, it cannot dispatch these plans fast enough to keep the BEs busy.
* Tablet Reports: FEs constantly process "tablet reports" from BEs to maintain cluster health. On a capacity-constrained FE, this background task can compete with user queries for CPU cycles.
5. The "Query Queue" Effect
StarRocks has internal mechanisms (like Query Queues) to prevent the system from crashing under load. If the FE detects it is running low on resources (CPU/Mem), it may proactively queue queries. Reduced capacity triggers these limits much earlier, resulting in lower observed QPS as queries wait in line for a "slot."
Summary Recommendation
* For High QPS: Add Observer FEs. They add planning capacity and connection limits without increasing the overhead of the Raft metadata consensus.
* For Complex Metadata: Ensure FEs have at least 16GB-64GB of RAM (depending on tablet count) to avoid GC-related latency spikes.
* Infrastructure Balance: A common mistake is over-provisioning BEs while under-provisioning FEs. If your BEs have low CPU usage but QPS is low, the FE is likely your bottleneck.
References
• administration/management/resource_management/Load_balance.md
• introduction/Architecture.md
• administration/management/FE_configuration.md
• deployment/deploy_manually.mddipti.d1
08/06/2026, 1:52 PMRocky
08/06/2026, 1:52 PMdipti.d1
08/06/2026, 2:24 PMRocky
08/06/2026, 2:24 PMdatacache.partition_duration) to ensure hot partitions stay local as long as needed.
2. Reducing Write (PUT) Costs: Batching & Compaction
Write operations (PUT/POST) are typically more expensive than reads. StarRocks uses these strategies to minimize them:
* Batch Ingestion: Instead of many tiny INSERT statements, use larger batch loads (via Stream Load or Pipe). Fewer loads = fewer PUT calls.
* Compaction: StarRocks' FE schedules background compaction tasks that merge many small segment files into larger ones. This not only speeds up queries but also reduces the metadata overhead and the number of future GET requests.
* Batch Publish (v3.3.3+): StarRocks now enables lake_enable_batch_publish_version by default, which batches metadata updates to the object store, significantly reducing the number of small metadata file writes.
3. When the Math Favors Shared-Data (GCS)
While GCS API calls cost money, the total cost of ownership (TCO) is usually lower because:
* No Multi-Replica Storage Cost: In Shared-Nothing, you must store 3 copies of data on expensive persistent disks (e.g., GCP Extreme PD). In Shared-Data, you store one copy on GCS (which is ~1/10th the cost per GB) and let GCS handle the underlying 99.999999999% durability.
* Stateless Scaling: You can turn off Compute Nodes during off-peak hours. In Shared-Nothing, you must keep all nodes running just to keep the data available.
Best Practices for Low Cost on GCS
If you are worried about API costs, follow these tips:
1. Optimize Tablet Size: Aim for tablets between 1GB and 10GB. Larger tablets mean fewer files and fewer API calls for both metadata and data.
2. Use Partitioned Prefix (v3.2.4+): This distributes data into sub-paths in the bucket, which helps avoid GCS rate limits and improves throughput.
3. Avoid "Micro-batching": If you are ingesting data every second, you will generate high PUT costs. Try to batch your ingestion to every 10–30 seconds if your latency requirements allow.
4. Monitor via `information_schema`: Use be_cloud_native_compactions to ensure compaction is healthy and not leaving behind thousands of small "orphaned" files.
Summary: The Shared-Data architecture shifts your cost from "Static Disk/Compute" to "Variable Storage/API." For large datasets with a clear "hot/cold" divide, the savings on storage replicas far outweigh the GCS API costs.
References
• deployment/shared_data/gcs.md
• faq/shared_data_faq.md
• deployment/shared_data/feature-support-shared-data.md
• administration/management/compaction.md
References
• faq/shared_data_faq.mddipti.d1
08/06/2026, 2:27 PMRocky
08/06/2026, 2:28 PMn2d-standard-2 to n2d-standard-8 or 16 will likely result in a non-linear performance gain. You will see latencies drop from "sub-second" (e.g., 500ms) to "near-instant" (e.g., 20ms-50ms) because queries won't be waiting for a CPU time slice.
B. Scale Out the FE (The "Planning" Bottleneck)
With 100 concurrent users, your single n2d-standard-4 FE is likely busy parsing and optimizing SQL.
* Observation: Check the FE CPU usage. If it's over 50%, the FE is becoming a bottleneck for QPS.
* Improvement: Add 1-2 Observer FEs. In StarRocks, Observer FEs can handle query planning and client connections, allowing you to scale QPS horizontally even if the data volume stays the same.
C. Memory Constraints (The "8GB RAM" Bottleneck)
8GB is very tight for a StarRocks CN.
* The Risk: StarRocks uses memory for the Data Cache metadata, the Query Intermediate results, and the MemTable. On an 8GB node, you likely have a very small storage_page_cache_limit.
* Improvement: Increasing RAM to at least 16GB or 32GB will allow you to increase the query_mem_limit, preventing queries from spilling to disk or failing under high concurrency.
D. Software Tuning
If you stay on this hardware, ensure these are set:
* Enable Pipeline Engine: (Usually on by default in v3.x) Ensure enable_pipeline_engine = true.
* Short Query Optimization: If these are simple queries, ensure enable_short_circuit_query = true to bypass the full planning phase for primary key lookups.
* Adjust Concurrency: Tune pipeline_dop (Degree of Parallelism). For a 2-vCPU node, set this to 2. If you scale up, set it to 0 (auto-adjust).
Summary Recommendation
Your current metrics are a great "Green Signal" that your schema and MVs are optimized. To move from "good" to "high-performance production," upgrade your CNs to at least n2d-standard-8. You will likely see your QPS double or triple while maintaining much more stable latencies during peak bursts.
References
• deployment/plan_cluster.md
• administration/management/resource_management/Pipeline_execution_framework.mdRocky
08/06/2026, 2:28 PMdipti.d1
08/06/2026, 3:16 PMRocky
08/06/2026, 3:16 PMtop on the Leader FE during your load test. If CPU usage is near 180-200%, the FE is definitely your bottleneck.
3. Check Planning Latency: Run SHOW PROFILE FOR <query_id> for one of your slow queries. Look at the QueryPlan time. If it has increased significantly compared to your old setup, the FE is the culprit.
References
• deployment/plan_cluster.md
• administration/management/FE_configuration.md
• introduction/Architecture.md
• faq/Others.md
References
• deployment/plan_cluster.md
• introduction/Architecture.md
• administration/management/FE_configuration.mdRocky
08/06/2026, 3:16 PMdipti.d1
08/06/2026, 3:23 PMStarRocks documentation typically recommends a minimum of 16 vCPUs and 64GB RAM per CN/BE for production.
@Rocky but if i don't need qps and concurrency in even thousand. then I can keep it low?
Rocky
08/06/2026, 3:23 PMsql
SET GLOBAL query_mem_limit = 2147483648; -- Limit each query to 2GB per node
* Reduce Load Memory: If you are ingesting data, reduce the memory buffer to prevent the CN from crashing during a load:
conf
# In cn.conf
load_process_max_memory_limit_percent = 20
2. Throttling Background "Noise"
On a 2-vCPU machine, the default background thread counts are often too high, causing CPU thrashing.
* Reduce Compaction Threads: Compaction (merging files) is CPU-intensive. Limit it so it doesn't starve your queries:
sql
-- Run via MySQL client
UPDATE information_schema.be_configs SET value = "1" WHERE name = "compact_threads";
* Pipeline Degree of Parallelism (DOP): On a 2-vCPU node, the engine might try to run 2 or 4 parallel tasks per query. Force it to be conservative:
sql
SET GLOBAL pipeline_dop = 2;
3. Why it feels "Slower" even at Low QPS
Even if you only send 1 query per second, a low-spec node may have higher tail latency (P99) because:
* Context Switching: With only 2 cores, the CPU spends significant time switching between the FE's Java Garbage Collection, the CN's storage engine, and your SQL execution.
* FE Planning: As you saw, a 2-vCPU FE is significantly slower at generating a query plan than a 4-vCPU FE. No amount of "low QPS" changes the fact that each plan takes longer to compute on a weak core.
The "Stable Minimum" Recommendation
If you don't need 1000+ QPS but want a stable production environment that won't crash during a routine background merge:
* CN/BE: 4 vCPU / 16GB RAM. This provides enough "breathing room" for the OS, the data cache, and background compaction to run alongside your queries.
* FE: 4 vCPU / 16GB RAM. This ensures the Java Heap is large enough to handle metadata and planning without constant GC pauses.
Summary: You can go lower than the official "16-core/64GB" recommendation, but dropping to 2-vCPU puts you in the "experimental/dev" zone where stability is hard to guarantee. If you stay at 2-vCPU, ensure you apply the throttling mentioned above to prevent the node from over-extending itself.
References
• deployment/plan_cluster.md
• administration/management/resource_management/Memory_management.md
• faq/Others.md
• administration/management/BE_configuration.md
• knowledge/admin_and_operation/shared_data_compaction.md
References
• administration/management/resource_management/Memory_management.md
• loading/loading_introduction/loading_considerations.mddipti.d1
08/06/2026, 4:26 PMRocky
08/06/2026, 4:26 PMsql
SET GLOBAL enable_query_cache = true;
* Benefit: This caches the final result set. If many of your 100 concurrent users are running similar queries (e.g., a dashboard), the FE will return the result without even hitting the CN. This reduces the CPU pressure on both the FE and CN significantly.
5. Review "Idle" Costs
* Storage: Since you are on Shared Data, your storage cost is already minimized by using GCS instead of expensive local SSDs.
* Shutdown: If your workload is only active during business hours, you can shut down all CNs at night. The metadata remains safe on the FEs.
Summary Comparison
Component | Current Setup (High Cost) | Recommended Setup (Low Cost) | Savings
FE | 3 x n2d-standard-4 | 1 x n2d-standard-4 (or 3x Spot n2d4) | ~66%
CN | 2 x n2d-standard-4 | 1 x n2d-standard-2 (Spot VM) | ~80%+
Total | ~20 vCPUs | 6 vCPUs | ~70% reduction
Recommendation: Start by dropping to 1 x n2d4 FE and 1 x n2d2 CN (Spot). Monitor the latency for your 72 QPS. If it remains sub-second, you have found your "goldilocks" cost-performance zone.
References
• deployment/shared_data/feature-support-shared-data.md
• introduction/Architecture.md
• administration/query_cache.md
• deployment/plan_cluster.mdRocky
08/06/2026, 4:26 PMn2d-standard-4 CN should easily handle 72 QPS given that your previous tests showed a single n2d-standard-2 could handle ~160 QPS (cold).
* By having 4 vCPUs on the single FE, you avoid the planning bottleneck and Raft synchronization overhead you experienced with the 3x FE2 setup.
* Savings: This reduces your node count from 5 to 2 (~60% cost reduction).
2. Use Spot (Preemptible) Instances for CNs
In the Shared Data architecture, CN nodes are stateless. If a CN node disappears, no data is lost because everything is in GCS.
* Strategy: Keep your FE on a Standard VM (to protect metadata), but run your CN on a Spot/Preemptible VM.
* Savings: GCP Spot instances are typically 60-91% cheaper than standard instances. If the CN is preempted, StarRocks will simply wait for a new one to join, and it will reload the cache from GCS.
3. Vertical over Horizontal for FEs
If you must have High Availability (HA), you need 3 FEs. However, as you discovered, three weak FEs (2 vCPU) are slower than one strong FE (4 vCPU) due to the overhead of the Leader-Follower metadata synchronization (Raft).
* If HA is mandatory: Use 3 x n2d-standard-2 but only for the 72 QPS workload. It failed at 380 QPS, but it will likely handle 72 QPS just fine.
* If HA is not mandatory: Stick to 1 x n2d-standard-4. It is cheaper and more performant than three small nodes.
Summary Comparison Table
Setup | QPS Capacity (Est.) | HA? | Cost Level | Recommendation
3x FE4 + 2x CN4 | 380+ | Yes | $$$$$ | Overkill
3x FE2 + 1x CN4 | ~100-150 | Yes | $$$ | Use if you need HA
1x FE4 + 1x CN4 | ~180-200 | No | $$ | Best for 72 QPS
1x FE4 + 1x CN4 (Spot) | ~180-200 | No | $ | Cheapest Option
Critical Configuration Tuning
When moving to fewer nodes with 100 concurrent users, apply these settings to prevent memory errors:
1. Protect Memory: Since you have 100 users hitting one CN, limit the memory each query can take so they don't crash the node:
sql
SET GLOBAL query_mem_limit = 2147483648; -- 2GB per query
2. Enable Result Cache: If your 72 QPS includes repetitive queries, the FE Result Cache can serve those without even hitting the CN:
sql
SET GLOBAL enable_query_cache = true;
References
• deployment/plan_cluster.md
• introduction/Architecture.md
• deployment/shared_data/feature-support-shared-data.md
• administration/management/resource_management/Memory_management.md
• administration/query_cache.md
References
• introduction/Architecture.md
• deployment/shared_data/feature-support-shared-data.md
• quick_start/shared-data.mddipti.d1
08/06/2026, 6:20 PMRocky
08/06/2026, 6:20 PMautoScalingPolicy. Because you are using Shared Data, the Compute Nodes (CNs) are stateless—they don't store the primary data, they just pull it from your Object Storage (S3/GCS).
* Scale down to 1: You can set minReplicas: 1. During low-traffic periods, the Operator will automatically terminate all but one CN node.
* Scale up on demand: When your traffic spikes towards that 72 QPS, Kubernetes will instantly spin up additional CN pods to handle the load.
* Cost Impact: Instead of paying for 2 x CN nodes 24/7, you pay for 1 CN most of the time, and only scale to 2+ when necessary.
2. Utilizing Spot Instances for CNs
Since CN nodes in Shared Data mode are disposable (if one dies, the data is safe in S3/GCS), they are perfect candidates for Spot/Preemptible Instances.
* How to do it: In your StarRocksCluster YAML, you can add nodeSelector or tolerations to ensure CN pods only run on Spot nodes.
* Cost Impact: Spot instances are typically 60-90% cheaper than standard VMs. Even if a node is reclaimed by the cloud provider, the Operator will simply start a new one, and the cluster will keep running.
3. "Scale-to-Zero" (Advanced)
While the standard StarRocks Operator HPA defaults to a minimum of 1 node, you can use KEDA (Kubernetes Event-driven Autoscaling) alongside the Operator.
* KEDA can monitor your actual query traffic or a Prometheus metric and scale the CN deployment to 0 replicas if there have been no queries for a certain period.
* Cost Impact: You pay $0 for compute when no one is using the database.
4. Precise Resource Packing
In your current VM setup, if you have an n2d-standard-4 (4 vCPU), you pay for all 4 cores even if StarRocks is only using 0.5 cores.
* With the Operator, you can set requests and limits at a granular level (e.g., cpu: 2.5).
* Kubernetes can then "bin-pack" other small services onto the same physical hardware, ensuring you aren't paying for "dead air" in your VMs.
Recommended "Cost-Minimizer" YAML Snippet
If you move to the Operator, use a configuration similar to this for your CNs:
yaml
starRocksCnSpec:
replicas: 1 # Starts with 1
requests:
cpu: 2
memory: 8Gi
autoScalingPolicy:
minReplicas: 1
maxReplicas: 3
hpaPolicy:
metrics:
- type: Resource
resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
nodeSelector:
<http://cloud.google.com/gke-spot|cloud.google.com/gke-spot>: "true" # Forces CNs onto cheap Spot nodes
Summary for your 72 QPS Goal:
By using the Operator on Kubernetes, you can keep 1 On-Demand FE for stability and 1 Spot CN that autoscales. This will likely be the cheapest possible way to run StarRocks while still meeting your performance targets.
References
• deployment/sr_operator.md
• deployment/helm.md
• administration/management/resource_management/Resource_group.md
• administration/management/resource_management/Memory_management.md
References
• deployment/sr_operator.md
• deployment/helm.mddipti.d1
08/07/2026, 4:04 PMRocky
08/07/2026, 4:05 PMpd-ssd.
* Predictable Performance: At 200 concurrency, StarRocks performs thousands of small, random reads from the Block Cache. Standard SSDs have significantly lower access latency (sub-millisecond) compared to Balanced disks.
* Benefit: Your P99 response times will drop and become more stable. You will see fewer "outlier" queries that take 2–3x longer than the average.
2. Faster "Warm-up" and Loading
In Shared Data mode, if data isn't in the cache, StarRocks must fetch it from GCS, decompress it, and write it to the local disk cache.
* Faster Cache Population: A faster SSD allows the CN to write incoming data from GCS to the cache much faster.
* Ingestion Speed: During heavy data loads, StarRocks spills intermediate data to the local disk before committing to GCS. A faster SSD prevents the local disk from becoming a bottleneck during these "spills," increasing overall ingestion throughput.
3. Higher Concurrent Scanning Throughput
Your test showed 380 QPS at 200 concurrency. At this level of pressure, the "IO Wait" on Balanced disks often starts to climb.
* IOPS Ceiling: Balanced disks scale IOPS based on size (usually 6 IOPS per GB). If you have a small disk (e.g., 100GB), you are capped at 600–1,200 IOPS.
* SSD Advantage: pd-ssd or Local SSD provides much higher IOPS per GB. This allows more concurrent "scan" threads to read different data blocks simultaneously without waiting for the disk head (virtually) to keep up.
Comparison Table: Predicted Gains
Feature | Balanced PD | SSD (pd-ssd) | Local SSD (NVMe)
Random Read Latency | Moderate (~1-2ms) | Low (<1ms) | Ultra-Low (μs)
Max IOPS (per node) | Up to 60k | Up to 100k | Up to 800k+
QPS Impact | Baseline | +15% to 25% | +30% to 50%
Tail Latency (P99) | Higher jitter | Very stable | Rock solid
Is it worth it for 72 QPS?
Given your new requirement is only 72 QPS (down from your 380 QPS test):
* Balanced PD is actually "Enough": For 72 QPS, your disk is unlikely to be the primary bottleneck. You could save money by staying on Balanced disks.
* SSD is "Insurance": If your 72 QPS involves large scans (scanning millions of rows per query) or if you want to ensure users never experience a "slow" query due to disk contention, move to pd-ssd.
* The Best Performance Choice: If your VM type supports it, use Local SSD. In Shared Data mode, CNs are stateless, so if a node dies, losing the Local SSD cache doesn't matter (the data is safe in GCS). Local SSD provides the absolute best performance for StarRocks at a lower cost than pd-ssd.
Recommendation: For 72 QPS, stick with Balanced PD to save costs. If you notice your "IO Wait" (check top or StarRocks metrics) is high during peaks, upgrade to Local SSD for the best price-to-performance ratio.
References
• deployment/shared_data/feature-support-shared-data.md
• introduction/Architecture.md
• faq/Others.md
• knowledge/usage/load/shared_data_batch_ingestion.md
• administration/management/BE_configuration.md