> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/sql-commands/clusters/create-cluster.md).

# CREATE CLUSTER

## Cluster Types

### **Compute Cluster**

A compute cluster is a group of servers that is used to process and maintain the data that is held in tables and transformed or loaded in jobs.&#x20;

Jobs are executed on compute clusters. You can create multiple compute clusters with different settings to separate different use cases and workloads.&#x20;

### **Query Cluster**

A query cluster is used for querying materialized views in real time. Query clusters host the materialized views in memory for millisecond response times.

## Syntax

```sql
CREATE { COMPUTE | QUERY } CLUSTER <cluster_name>
  MIN_INSTANCES = <min_instance_count>
  MAX_INSTANCES = <max_instance_count>
  [ ALLOW_MAINTENANCE_ACCESS = { TRUE | FALSE } ]
  [ COMMENT = '<comment' ]
  [ INSTANCE_TYPE_FAMILY = '<instance_type_family>' ]
  [ ON_DEMAND_INSTANCES = <on_demand_instance_count> ]
  [ MAX_REPLAY_INSTANCES = <max_replay_instance_count> ]
  [ SCALING_STRATEGY = { 
      LOW_COST | LOW_LATENCY | CONSISTENT_LOW_LATENCY | NO_SCALING } ]
  [ STATIC_PUBLIC_IPS = <number_of_static_ips> ]
  [ VPC_CONNECTION = <connection_name> ]
```

## Cluster Options

* [`MIN_INSTANCES`](#min_instances-editable)
* [`MAX_INSTANCES`](#max_instances-editable)
* [`ALLOW_MAINTENANCE_ACCESS`](#allow_maintenance_access-editable)
* [`COMMENT`](#comment-editable)
* [`INSTANT_TYPE_FAMILY`](#instance_type_family-editable)
* [`MAX_REPLAY_INSTANCES`](#max_replay_instances-editable)
* [`ON_DEMAND_INSTANCES`](#on_demand_instances-editable)
* [`SCALING_STRATEGY`](#scaling_strategy-editable)
* [`STATIC_PUBLIC_IPS`](#static_public_ips-editable)
* [`VPC_CONNECTION`](#vpc_connection)

#### MIN\_INSTANCES — editable

Type: `int`

The lower limit for the number of instances to use when autoscaling the cluster.&#x20;

#### MAX\_INSTANCES — editable

Type: `int`

The upper limit for the number of instances to use when autoscaling the cluster.&#x20;

#### ALLOW\_MAINTENANCE\_ACCESS — editable

Type: `Boolean`

(Optional) When enabled it will allow Upsolver Support access to the instances for debugging purposes. This only enables SSH access. Network access is still controlled by the network settings of the VPC in which the cluster is running.&#x20;

Defaults to **FALSE**.

#### `COMMENT` — editable

Type: `text`

(Optional) Adds a comment or description to the cluster for documentation or clarification purposes.

#### `INSTANCE_TYPE_FAMILY` — editable

Type: `int`

(Optional) The instance type family to use. Upsolver uses similar instance types from the same family and size to achieve better spot instance availability and server uptime. For example, if r5.xlarge is configured then both r5.xlarge and r5d.xlarge will be used.

Defaults to 'r5.xlarge'&#x20;

#### `MAX_REPLAY_INSTANCES` — editable

Type: `int`

(Optional) Replay Instances are instances that are started automatically when new jobs are added to the cluster. They are used to process the backlog of data without interfering with the latency of production workloads already running on the cluster. After the new jobs are up-to-date, the replay instances will automatically be shut down and the job moved back to the main instances.&#x20;

{% hint style="info" %}
Replay cluster instances operate independently and have different IP addresses than the main cluster. Usually, tasks that write to external resources such as databases are executed on the main cluster to maintain IP whitelisting. If you run into access issues, consider either turning off the replay cluster or using a separate, dedicated cluster.
{% endhint %}

#### `ON_DEMAND_INSTANCES` — editable

Type: `int`

(Optional) Specifies the minimum number of guaranteed on-demand instances allocated to the cluster. While this sets a floor, there may sometimes be more on-demand instances if there's low spot availability.

By default, Upsolver uses ephemeral Spot Instances for data processing. Setting this value allows you to configure how many on-demand Instances are within the cluster.&#x20;

#### `SCALING_STRATEGY` — editable

Type: `Enum`

(Optional) Determines the scaling strategy of the cluster. Options are:

* `LOW_COST`: Prioritize cost savings.
* `LOW_LATENCY`: Prioritize reducing latency.
* `CONSISTENT_LOW_LATENCY`: Maintain consistently low latency.
* `NO_SCALING`: No scaling, static number of instances.

Defaults to `LOW_LATENCY`.

#### `STATIC_PUBLIC_IPS` — editable

Type: `int`

(Optional) The number of static IPs to create and associate with the cluster's instances. This parameter is useful when the cluster needs to connect to external systems that are behind a firewall. Configuring static IPs will allow the opening of those IPs in the target system's firewall.

The value is the number of static IPs to use and can be lower than the total number of instances in the cluster. If configured this way, the instances that get the static IP will be used to make requests to external resources.&#x20;

#### `VPC_CONNECTION`

Type: `identifier`

(Optional) Use the `VPC_CONNECTION` option when you have multiple VPC connections for the same organization, otherwise running this command results in an error.&#x20;


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/sql-commands/clusters/create-cluster.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
