Build autoscaling policies with threshold-based and scheduled scaling rules.
Last verified: May 2026
Build autoscaling policies with threshold-based and scheduled scaling rules for instance pools.
Required Fields
compartmentIddisplayNameresourcepoliciesOutput will appear here...OCI autoscaling automatically adjusts the number of compute instances in an instance pool based on performance metrics or schedules. Autoscaling configurations consist of policies that define scaling triggers, cooldown periods, capacity limits, and scaling increments. There are three policy types: metric-based (scale on CPU, memory, or custom metrics), schedule-based (scale at specific times), and threshold-based. This builder helps you create autoscaling configurations with correct policy parameters, instance pool references, and performance thresholds that balance responsiveness with cost.
OCI autoscaling supports CPU utilization and memory utilization as built-in metrics. For custom metrics, you can integrate with OCI Monitoring and create alarms that trigger scaling actions via OCI Functions or the Notifications service. The built-in metrics are sampled at 1-minute intervals and evaluated against your threshold over a configurable window, typically 5 or 10 minutes, to avoid scaling on momentary spikes.
Cooldown periods define a waiting time after a scaling action during which no additional scaling occurs. This prevents a cycle where adding instances drops CPU utilization, which triggers a scale-in, which raises CPU, which triggers a scale-out. OCI recommends setting cooldown periods long enough for new instances to start handling traffic and for metrics to stabilize — typically 300 seconds (5 minutes) for scale-out and 300 seconds for scale-in. You can set different cooldown values for each direction.
Yes, you can attach multiple autoscaling policies to an instance pool. Schedule-based policies set predictable capacity floors (e.g., minimum 10 instances during business hours), while metric-based policies handle unexpected demand spikes above that floor. When both types are active, OCI uses the higher capacity requirement. This combination is ideal for workloads with known daily patterns and occasional unpredictable bursts.
Your team's 10-instance pool serving an e-commerce API has been running 24/7 at $1,200/month. Traffic analysis shows: 9am-6pm M-F = 80% of daily traffic. The builder generates a hybrid policy: schedule-based sets min=10 during business hours, min=3 otherwise (still HA via 3-AD spread), plus a metric-based policy adds 2 instances when CPU>70% sustained 5min. New cost: ~$650/month with same headroom. Annual savings: $6,600.
The builder constructs OCI autoscaling configurations with: target instance pool OCID, policy type (THRESHOLD, SCHEDULED), capacity (initial, min, max), policy rules (metric type + threshold + scaling delta for threshold policies; cron expression + execution time for scheduled), and cooldown periods. Output is generated as oci CLI commands and Terraform oci_autoscaling_auto_scaling_configuration resources.
Schedule-based policies are dramatically more cost-effective than metric-based for predictable workloads. If your traffic peaks every weekday 9am-6pm, a schedule-based policy that sets minimum capacity to 10 during those hours and 2 otherwise saves more money AND reacts faster than waiting for CPU metrics to trigger.
Default cooldown of 300s (5 minutes) is sometimes too short for instances with slow startup. If your instances take 3+ minutes to boot and join the load balancer, set scale-out cooldown to 600s+ — otherwise the autoscaler keeps adding instances while still-booting ones haven't started serving traffic.
Always set sane minimum AND maximum bounds, not just maximum. A minimum of 0 means autoscaler can scale to zero — which is fine for batch but disastrous for user-facing services that need warm capacity. A common pattern: min=2 (HA across 2 ADs), max=20 (cost cap).
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.