> ## Documentation Index
> Fetch the complete documentation index at: https://repocloud.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Elastic Autoscaling

> A Container App with autoscaling is billed each hour at the tier its memory and CPU use called for

## Elastic Hourly Autoscaling

With autoscaling switched on, a Container App is billed each hour at the tier its memory and CPU use called for. RepoCloud reads the app's memory and CPU once an hour and bills the matching tier. The app itself is never resized.

Autoscaling is for Container Apps. [VPS Apps](https://repocloud.io/docs/deployment/vps-apps.md) use fixed tiers only.

## How Autoscaling Works

A fixed plan costs the same hourly price 24/7, whatever the app is doing. With autoscaling:

**1. One Reading an Hour**

Once an hour, the billing run reads the app's memory and CPU.

**2. Higher Use, Higher Tier**

When the app uses more, the next hourly reading maps to a higher tier.

**3. Lower Use, Lower Tier**

When use drops, the next reading maps to a lower tier and the hour costs less.

**4. Hourly Billing**

Each hour is billed at the hourly price of the tier that hour's reading maps to.

## The Autoscaling Advantage

> **Cost Efficiency**
>
> Each hour is billed at the tier the app used, so a quiet hour costs less than a busy one

> **Room for Spikes**
>
> The app can use up to 16 GB of RAM and 4 cores at any time, so a spike inside that size needs no action

> **A Low Floor**
>
> An idle hour costs the Tier 1 rate, never less

> **Simplified Management**
>
> You do not choose a size: the limit is 16 GB of RAM and 4 cores. An app that needs more must use a fixed tier

## What Decides the Tier

Two readings decide the tier: memory and CPU. Each one maps to a tier of its own, and the larger of the two is billed. Storage is not read and not billed by autoscaling.

Memory is read in binary gigabytes (GiB):

| Memory reading | Tier it calls for |
|----------------|-------------------|
| Under 1 GiB | Tier 1 |
| 1 GiB to under 2 GiB | Tier 2 |
| 2 GiB to under 4 GiB | Tier 4 |
| 4 GiB to under 8 GiB | Tier 5 |
| 8 GiB to under 16 GiB | Tier 6 |

CPU is read as a percent of one core:

| CPU reading | Tier it calls for |
|-------------|-------------------|
| Under 55% | Tier 1 |
| 55% to under 110% | Tier 3 |
| 110% to under 220% | Tier 5 |
| 220% and above | Tier 6 |

An autoscaling app is created with a limit of 16,000 MB of memory and 4 cores (400% of one core), so the highest tier a reading can produce is Tier 6. Tier 7 is available only as a fixed tier. The price of each tier is on the [Resource Tiers](https://repocloud.io/docs/pricing/tiers.md) page.

> **How the CPU Reading Works**
>
> - The reading is the app's CPU use as a percent of one core, taken once an hour
> - The bill follows it: a reading from 55% to under 110% of a core calls for Tier 3, and so on up the table
> - The app can use up to 4 cores whenever it needs them; the reading only decides what the hour costs
> - Nothing is resized, so nothing is interrupted

> **How the Memory Reading Works**
>
> - The reading is the app's memory use, taken once an hour
> - The larger of the memory tier and the CPU tier decides the bill
> - The memory limit is 16,000 MB, so an app that needs more than that cannot run under autoscaling and needs a fixed tier

> **What About Storage?**
>
> Autoscaling reads and bills no storage. Only memory and CPU decide the tier.

## Worked Examples

The examples assume a usage pattern and show how the bill follows the hourly tier; they are not predictions. Monthly figures use the nominal 720-hour month.

### Example 1: Blog with Variable Traffic

A blog gets most of its traffic during business hours and very little overnight. Sized for its busiest hour, a fixed plan would be Tier 4 (4 GB RAM, 2 vCPU) at $12.00 a month.

- **Nights (12 hours a day)**: memory under 1 GiB and CPU under 55% of a core, so Tier 1 at $3.00 a month
- **Days (12 hours a day)**: memory from 1 GiB to under 2 GiB and CPU under 55% of a core, so Tier 2 at $6.00 a month
- **Resulting billing**: half the hours at $3.00 and half at $6.00 average $4.50 a month, which is 62.5% less than the fixed plan

### Example 2: Business Application with Weekend Drop-offs

An internal business application is used Monday to Friday. A fixed plan would be Tier 5 (8 GB RAM, 4 vCPU) at $24.00 a month.

- **Weekdays (5 of 7 days)**: memory from 4 GiB to under 8 GiB, so Tier 5 at $24.00 a month
- **Weekends (2 of 7 days)**: memory under 1 GiB and CPU under 55% of a core, so Tier 1 at $3.00 a month
- **Resulting billing**: 5/7 of $24.00 plus 2/7 of $3.00 is $18.00 a month, which is 25% less than the fixed plan

### Example 3: E-commerce with Seasonal Peaks

An e-commerce store has heavy traffic during the holiday seasons. A fixed plan sized for the peak would be Tier 6 (16 GB RAM, 8 vCPU) at $48.00 a month all year.

- **10 regular months**: memory from 2 GiB to under 4 GiB and CPU under 110% of a core, so Tier 4 at $12.00 a month
- **2 peak months**: memory from 8 GiB to under 16 GiB, so Tier 6 at $48.00 a month
- **Resulting billing**: (10 × $12.00 + 2 × $48.00) / 12 is $18.00 a month averaged across the year, which is 62.5% less than the fixed plan

> [!TIP]
>
> An autoscaled app bills between the Tier 1 rate (about $3.00 a month) and the Tier 6 rate (about $48.00 a month), whatever it does. The most it can save against a fixed Tier 6 is 93.75%, for an app that is idle all month.

## Setting Up Autoscaling

Autoscaling is a switch on the deploy page, and it is off by default. A Docker Compose app always uses it.

**1. Choose Your Application**

Select an application from the marketplace and click "Deploy Now"

**2. Turn Autoscaling On**

For Container App deployments, switch on **Autoscale compute and storage resources**; the label mentions storage, but autoscaling reads and bills memory and CPU only. VPS Apps use fixed tiers only — select a tier that meets the requirements of the application you plan to install.

**3. Deploy**

Click "Deploy App". From then on your instance is billed by its hourly tier, with no further configuration required. The first hour is charged at the Tier 1 rate when the deployment starts.

> [!NOTE]
>
> Once deployed, an autoscaling instance shows an "Autoscaling" badge as its Server Size on the management page, and it has no Scale Server button. There are no scaling knobs to tune.

## Monitoring Autoscaling

RepoCloud shows you how your instance has been billed:

> **Usage Chart**
>
> Click "View Usage Chart" on your instance's management page to see the tier your application used in each of the last 12 hours. An hour that has not been billed yet shows as an empty bar

> **Usage History**
>
> The Usage History in the Billing tab lists every hourly charge, and you can download it as a CSV file

## Billing with Autoscaling

With autoscaling enabled, your billing works differently from fixed-tier pricing:

1. **Hourly Reading**: One reading of memory and CPU is taken each hour
2. **Hourly Rate**: Each hour is billed at the rate of the resource tier that reading maps to
3. **Credit Deduction**: Hourly charges are deducted from your prepaid account credit
4. **Baseline Cost**: An instance that runs continuously all month costs at least the Tier 1 rate (about $3.00 per month); pausing an instance reduces billing to 25% of the normal rate

> [!NOTE]
>
> The Usage History lists every hourly charge, and the usage chart shows the tier of each of the last 12 hours.

## Autoscaling Limitations

While autoscaling is powerful, there are some limitations to be aware of:

- **VPS Apps**: Autoscaling is not available for [VPS Apps](https://repocloud.io/docs/deployment/vps-apps.md). VPS instances use fixed resource tiers with a dedicated IPv4 address included at no extra charge
- **Resource Limit**: An app that needs more than 16 GB of RAM or 4 cores needs a fixed tier
- **One Reading an Hour**: The tier is read once an hour. A spike between two readings is not billed, and a reading that lands on a spike bills the whole hour at that tier

## When to Choose Fixed Resources

While autoscaling works well for most applications, fixed resources might be better in some scenarios:

> **Predictable Workloads**
>
> If your application has very consistent resource needs with minimal variation, a fixed tier might provide more predictable billing.

> **Budget Certainty**
>
> When you need a hard limit on your monthly costs, a fixed tier never bills above its own hourly price. Add-ons are billed separately.

> **Capping Use and Spend**
>
> A fixed tier is a cap on what the app can use and spend. Choose it to limit both, or when the app needs Tier 7.

> **Resource-Intensive Applications**
>
> Applications that consistently use near-maximum resources won't benefit as much from autoscaling, which also stops at Tier 6.

## Optimizing for Autoscaling

To get the most from autoscaling, consider these best practices:

1. **Monitor Usage Patterns**: Review your instance's usage chart to understand its typical resource footprint
2. **Design for Variability**: Structure your application to use less memory and CPU when it is idle, because the bill follows the hourly reading
3. **Pause Idle Instances**: Pause Container App instances you aren't using to reduce their billing to 25% of the normal rate
4. **Check the Limits**: Verify that your application stays inside 16 GB of RAM and 4 cores

## Frequently Asked Questions

> **How quickly does autoscaling respond to traffic spikes?**
>
> There is nothing to wait for: the app can use up to 16,000 MB of memory and 4 cores at any time. What changes is the billed tier, which changes with the next hourly reading.

> **Will my application experience downtime during scaling?**
>
> No. Nothing is resized, so autoscaling causes no downtime.

> **How is billing calculated with autoscaling?**
>
> One reading of memory and CPU is taken each hour, and that hour is billed at the rate of the tier the reading maps to. Charges are deducted from your prepaid account credit.

> **Can I cap my spending?**
>
> The most an autoscaled instance can bill is the Tier 6 rate ($48.00/month equivalent). For strict cost control, deploy with a fixed server size instead of autoscaling — your instance then never bills above that tier's rate, and add-ons are billed separately. Because billing draws from prepaid credit an hour at a time, spending also can't exceed the credit you've purchased unless Auto Recharge is enabled.

> **What happens if my credit balance runs out?**
>
> Billing is prepaid, so you'll need to keep your balance topped up for instances to keep running. Enable Auto Recharge in the Billing tab to automatically purchase credit whenever your balance drops below a threshold you set. If the balance reaches zero, RepoCloud pauses your Container Apps; see [Billing](https://repocloud.io/docs/manage/billing.md#when-your-balance-reaches-zero) for what follows.

## Next Steps

> **[Resource Tiers](https://repocloud.io/docs/pricing/tiers.md)**
>
> Explore our fixed resource tier options

> **[Price Comparison](https://repocloud.io/docs/pricing/comparison.md)**
>
> Compare RepoCloud pricing with other cloud providers
