Broker scaling operates on individual brokers. You specify the absolute number of brokers that the tenant must have after each action (
targetReplicas). This is different from Scheduled Server Scaling, which operates on server replica groups.Prerequisites
- Your cluster is on StarTree release 0.17.0 or later.
- Your cluster is on Vintner, the StarTree Kubernetes operator. If your cluster is not on Vintner, the StarTree Ops team can migrate it. The StarTree Ops team configures this feature for you — see Enabling it.
- All brokers of the tenant are in one broker instance group, and that group serves only this tenant. See Requirements for scaling for the exact conditions that the operator checks.
- The metric gate is optional. The StarTree Ops team enables it when you ask for it.
Enabling it
Scheduled broker scaling is not available in the Data Portal or in a self-serve UI at this time. To enable it for your cluster, contact the StarTree Ops team. Give StarTree Ops the following information for each tenant that you want to schedule:
To change, pause or remove the schedules of a tenant, contact StarTree Ops with the updated details. When scheduled scaling is paused or removed for a tenant, the operator returns the tenant’s brokers to the normal broker count of the cluster.
Configuration reference
Each schedule has these settings:scaleDown:
metricsGate:
The operator does not drain a broker itself. When the operator deletes a broker, the broker gets a shutdown signal and drains its in-flight queries during its termination grace period. Then the broker stops. There is no separate drain timeout for brokers.
Rules for a schedule set
The operator checks the schedules of a tenant as a set. It does not run any schedule of the tenant if the set breaks one of these rules:- The set has at least one scale-down and at least one scale-up. A set with only one direction can remove brokers with nothing to bring them back.
- At least one valid scale-up has a
targetReplicasthat is greater than the lowesttargetReplicasof the scale-down schedules. Otherwise no scale-up can undo the scale-down.
Cron format
Schedules use standard 5-field Unix cron (minute hour day-of-month month day-of-week). The operator evaluates all times in UTC. Convert your local schedule to UTC before you give it to StarTree Ops.
Gradual scale-down and the metric gate
By default, a scale-down removes one broker at a time and waits 3 minutes between brokers. UsestepSize and stepInterval to change this. For example, a scale-down from 6 to 2 brokers with stepSize: 2 and stepInterval: 5m removes two brokers, waits 5 minutes, and then removes two more.
The metric gate stops a scale-down from removing capacity while the tenant’s brokers are busy. Before each step, the operator reads the CPU and memory usage of each tenant broker. It divides the usage by the broker’s request. The step continues only when every broker of the tenant is below threshold - buffer for each configured threshold. Brokers that serve other tenants do not affect the result.
When the gate blocks a step, the result depends on the cause:
The operator does not use the gate on a step that it already started. If the operator restarts in the middle of a step, it completes the deletion of the brokers that it selected for that step.
A stopped scale-down does not retry. The tenant stays at the broker count that it reached until the next scheduled occurrence.
Typical pattern: nightly scale-down, morning scale-up
Pair a scale-down with a scale-up to reduce capacity during off-hours and restore it before peak load:- Scale down at night to a low
targetReplicas(for example,2). - Scale up in the morning back to your full
targetReplicas(for example,4).
DefaultTenant:
Checking status
Use the Vintner Operator dashboard in Grafana to see the scaling state of each tenant. Go to the Broker scheduled scaling row. It has these panels:
If a schedule does not run as expected, open a ticket with StarTree.
Notes and limitations
targetReplicasmust be 1 or more. A schedule cannot remove all brokers of a tenant.- If the tenant already has
targetReplicasbrokers, the action does nothing. - The operator does not set a maximum for
targetReplicas. A scale-up needs node capacity for the brokers that it creates. - Cron times are evaluated in UTC. Convert your local time before you give a cron to StarTree Ops.
- A deleted broker stays registered in Pinot as an offline instance, with its tenant tag. This is expected. A later scale-up starts a broker with the same name, and it comes back online in the same tenant.
- While a scale-down or scale-up is in progress, the operator does not start other updates of the cluster, for example a version upgrade or a configuration change. These updates start when the scale operation completes. Because of this, the operator uses a maximum
stepIntervalof 1 hour and a maximummaxDeferralsof 120. - If the operator restarts during an operation, it completes that operation, even after the
missedExecutionWindowcloses. A scale-down resumes with the same brokers that it selected before the restart. - If a scale-up does not reach its target within 1 hour after its
missedExecutionWindowcloses, the operator stops it. - Scheduled broker scaling only affects the brokers of the named tenant. It does not change Zookeeper, Controller, Server or Minion components, or the brokers of other tenants.
Requirements for scaling
Before each scale-up and each scale-down, the operator checks the following conditions. If a condition is not met, the operator does not add or remove any broker. Cluster state- No cluster update is in progress.
- Every online broker of the tenant is ready.
missedExecutionWindow closes.
Tenant topology
- All brokers of the tenant are in one broker instance group.
- The broker instance group serves only this tenant. No broker of the group, online or offline, has a tag for another tenant.
How it works
- The StarTree Ops team enables scheduled scaling for each tenant that you ask for, with the schedules that you give — see Enabling it.
- At each schedule’s cron time, the operator first checks that no cluster update is in progress and that every current broker of the tenant is ready. If a check fails, the operator tries again every 5 minutes until the
missedExecutionWindowcloses. - Then the operator reads the tenant’s brokers from the Pinot controller and does the action:
- Scale up. The operator creates the missing brokers in the tenant’s broker instance group. Each new broker joins the tenant when it starts. The operation is complete when the tenant has
targetReplicasonline brokers. - Scale down. The operator deletes
stepSizebrokers at a time. Each broker drains its in-flight queries during its graceful shutdown. Between steps, the operator waits forstepIntervalso that the load moves to the remaining brokers. If the metric gate is enabled, the operator checks it again before each step.
- Scale up. The operator creates the missing brokers in the tenant’s broker instance group. Each new broker joins the tenant when it starts. The operation is complete when the tenant has
- If the operator was down when a schedule fired, it still runs the missed occurrence if it restarts within the
missedExecutionWindow. After that window closes, the operator skips the occurrence.
Related
- Scheduled Server Scaling — the equivalent feature for Pinot server replica groups.

