> For the complete documentation index, see [llms.txt](https://docs.rhinofcp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rhinofcp.com/creating-and-running-code-objects/autoscaling-and-compute-resources.md).

# Autoscaling and Compute Resources

## Autoscaling

**Autoscaling** allows Rhino to run Code Runs on additional compute resources when the default Rhino Client capacity is not sufficient. This capability is designed to support resource‑intensive, "bursty"(processing tasks occur in short, intense or irregular spurts), or GPU‑based workloads while improving isolation, reliability, and cost efficiency.&#x20;

With autoscaling enabled, Rhino provisions temporary cloud VMs on demand, executes workloads on those VMs, and automatically terminates them when execution completes. This can help you make more efficient use of your computing resources and save on costs.

{% hint style="info" %}
**NOTE**: This feature is only available if you are running on the Google Cloud Platform (GCP).&#x20;

*For NVFlare code objects and code runs, you can adjust autoscaling methods for both the NVFlare Server and the NVFlare Client. For the NVFlare Server, you can only specify the CPU and RAM.*
{% endhint %}

***

## Compute Options

There are **3 ways** to specify compute for a code object run:&#x20;

<figure><img src="https://2949362692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FydySyCBmy6F7NnGn4bPa%2Fuploads%2F9EXC49vWSrdWSbfNgfRC%2Fimage.png?alt=media&amp;token=e6594ee2-35db-4511-9ffd-7065611c5353" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Use Client Resources

Uses the available client settings and resources.

**How To**:

1. Select the Use Client Resources button. It should be selected by default.
2. When complete, select Create New Code Object or start a Code Run.
   {% endstep %}

{% step %}

### Set Minimum

Allows you to set the minimum number of resources that must be available. If you choose the Set Minimum option, you can indicate the minimum number of CPUs, amount of RAM, the disk size (VRAM), as well as the type and number of GPUs. You can adjust these settings when you create a code object and also when you run your code.&#x20;

{% hint style="info" %}
Adjustments do not persist and will need to be reset with each run.
{% endhint %}

**How To**:

1. In the Required Compute Resources section, select Set Minimum.
2. Next, make changes to the settings as needed. The settings are explained below.

| Setting       | Description                                                                                         | Usage Note                                                                                                                                                                                                                |
| ------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CPU MIN       | The minimum number of CPU cores on which your code will be run.                                     | If the CPU MIN is too low, you might see slow code execution or throttling.                                                                                                                                               |
| RAM MIN       | The minimum amount of RAM (main memory) that you want to allocate to running your code.             | If this is too low, you might see an out-of-memory crash or slowness in execution due to disk swapping.                                                                                                                   |
| DISK SIZE     | Amount of storage allocated to the instance.                                                        | Increasing this setting increases capacity (not necessarily speed)                                                                                                                                                        |
| GPU TYPE      | The model of GPU hardware. The number of GPUs indicate the number of GPUs attached to the instance. | If your code isn’t written to use multiple GPUs, extra GPUs might not be used. Note that GPU availability depends on the selected cloud region, Project‑level GPU quotas, and the current capacity at the cloud provider. |
| {% endstep %} |                                                                                                     |                                                                                                                                                                                                                           |

{% step %}

### Use VM Pool

Allows you to select a Pre-allocated Virtual Machine (VM) Pool. Pre-allocated VM Pools allow you to indicate which dedicated compute resource you want to use for your code run, ensuring guaranteed availability for high-demand workloads such as GPU-intensive AI training and inference. This feature provides availability of critical compute resources and offers predictable costs through fixed capacity reservations.

{% hint style="info" %}
A *VM Pool* selection is part of the code object's configuration.
{% endhint %}

**How To**:&#x20;

See [Using VM Pools](/creating-and-running-code-objects/autoscaling-and-compute-resources/using-vm-pools.md)
{% endstep %}
{% endstepper %}

***

## **Table Summary**

**In the table below**, we review the tradeoffs of each option.

<table data-header-hidden="false" data-header-sticky><thead><tr><th>Option</th><th>Capacity Comes From</th><th>Startup</th><th>Cost Shape</th><th>Best For</th></tr></thead><tbody><tr><td><strong>Use Client Resources</strong></td><td>The Rhino Client's own default capacity</td><td>Immediate</td><td>Included</td><td>Routine work that fits existing client capacity</td></tr><tr><td><strong>Set Minimum</strong></td><td>A temporary cloud VM provisioned on demand, then terminated</td><td>Waits for provisioning</td><td>Varies per run</td><td>Bursty or irregular workloads; experimentation where shape changes run to run</td></tr><tr><td><strong>Use VM Pool</strong></td><td>A reservation of VMs held ready in advance</td><td>Faster — the VM already exists</td><td>Fixed, from the reservation</td><td>Recurring, high-demand, or GPU-intensive workloads where availability matters</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rhinofcp.com/creating-and-running-code-objects/autoscaling-and-compute-resources.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
