About instance settings

This page provides information about the settings available for Cloud SQL instances.

Settings for Cloud SQL for PostgreSQL

Setting Modifiable after creation? Possible values
Instance ID N Composed of lowercase letters, numbers, and hyphens; must start with a letter. The total length must be 98 characters or less.
Region N asia-east1 — Taiwan
asia-east2 — Hong Kong
asia-northeast1 — Tokyo
asia-northeast2 — Osaka
asia-northeast3 — Seoul
asia-south1 — Mumbai
asia-south2 — Delhi
asia-southeast1 — Singapore
asia-southeast2 — Jakarta
australia-southeast1 — Sydney
australia-southeast2 — Melbourne
europe-north1 — Finland
europe-central2 - Warsaw
europe-west1 — Belgium
europe-west2 — London
europe-west3 — Frankfurt
europe-west4 — Netherlands
europe-west6 — Zürich
europe-west9 — Paris
europe-west12 — Turin
europe-southwest1 — Madrid
me-central1 - Doha
me-west1 — Tel Aviv
northamerica-northeast1 — Montréal
northamerica-northeast2 — Toronto
southamerica-east1 — São Paulo
southamerica-west1 — Santiago
us-central1 — Iowa
us-south1 — Dallas
us-east1 — South Carolina
us-east4 — Northern Virginia
us-east5 - Columbus
us-west1 — Oregon
us-west2 — Los Angeles
us-west3 — Salt Lake City
us-west4 — Las Vegas
Zone Y The possible values depend on the region.
Database version N
Console string          API enum string
PostgreSQL 14           POSTGRES_14
PostgreSQL 13 (default) POSTGRES_13
PostgreSQL 12 POSTGRES_12
PostgreSQL 11           POSTGRES_11
PostgreSQL 10           POSTGRES_10
PostgreSQL 9.6          POSTGRES_9_6
Set password policy Y Configured or not.
Private IP After it is enabled, it cannot be disabled. Enabled or disabled.
Public IP Y Enabled or disabled.
Authorized networks Y If Public IP is enabled, IP addresses authorized to connect to the instance. You can also specify this value as an IP address range, in CIDR notation.
Private path for Google Cloud services Y Enabled or disabled.
Machine type Y

Select from Shared core, Lightweight, Standard (Most common), or High memory. Each machine type is classified by the number of CPUs (cores) and amount of memory for your instance.

For the Lightweight, Standard, and High memory machine types, instead of selecting a predefined configuration, select the Custom radio button to create a custom machine type. Learn more

Cores Y 1 to 96 (must be either 1 or an even number)
Partial for shared vCPU
Memory Y 0.9 to 6.5 GB per vCPU (must be a multiple of 256 MB and at least 3.75 GB)
Storage type N SSD (default value)
Storage capacity Y
(Increase only)
Instances with at least one unshared vCPU can have up to 64 TB.
Instances with a shared vCPU can have up to 3054 GB.

Note that creating or increasing storage capacity to 64 TB might increase latency of common operations, such as backups, dependent on your workload.
Enable automatic storage increases Y On (default value)
Automatic storage increase limit Y In GBs. 0 (the default) means there is no limit.
Backups Y
On (default value)
Locations options Y Multi-region (default value)

There is also a drop-down menu with a list of multi-regions when you select Multi-region or regions when you select Region.

Instance deletion protection Y Enabled or disabled.
Enable point-in-time recovery Y
(see note)
On (default value)
Availability: Single zone Y
On (default value)
High availability (regional) Y
Off (default value)
Maintenance: Preferred window Y Any (default value)
Day of the week
Maintenance: Order of update Y Any (default value)
Database flags Y See Configuring Database Flags.
Instance ID

The instance ID is the name of the instance. It is used to uniquely identify your instance within the project. Choose an instance name that is aligned with the purpose of the instance when possible.

The total length of project-ID:instance-ID must be 98 characters or less.

You do not need to include the project ID in the instance name. This is done automatically where appropriate (for example, in the log files).
The Google Cloud region where your instance is located. You can only set the region during instance creation. To improve performance, keep your data close to the services that need it. For more information, see Instance Locations.
The Google Cloud zone where your instance is located. If you are connecting from a Compute Engine instance, select the zone where the Compute Engine instance is located. Otherwise, accept the default zone. You can edit the instance later to change the zone, if needed. For more information, see Instance Locations.
Machine Type

Determines memory and virtual cores available to your Cloud SQL instance.

For performance-sensitive workloads, such as online transaction processing (OLTP), make sure that your instance has enough memory to contain the entire working set. However, there are other factors that can impact memory requirements, such as number of active connections, and internal overhead processes. Perform load testing to avoid performance issues in production.

When you configure your instance, select enough memory and vCPUs to handle your workload, and upgrade as your workload increases. A machine configuration with insufficient vCPUs could lose its SLA coverage. Learn more.

You can also create custom instance configurations using the gcloud sql instances create command. Custom instance configurations let you select the amount of memory and CPUs that your instance needs. This flexibility lets you choose the appropriate VM shape for your workload.

Machine type names use the following format: db-custom-#-#

Replace the first # placeholder with the number of CPUs in the machine, and the second # placeholder with the amount of memory in the machine.

For example, if your machine name is db-custom, and your machine has 1 CPU and 3840 MB of RAM, then the format for the machine would be db-custom-1-3840.

When selecting the number of CPUs and amount of memory, there are some restrictions on the configuration you choose:

  • vCPUs must be either 1 or an even number between 2 and 96.
  • Memory must be:
    • 0.9 to 6.5 GB per vCPU
    • A multiple of 256 MB
    • At least 3.75 GB (3840 MB)

The following table lists the names of each legacy machine type, the number of CPUs and RAM for each machine type, and the resultant string for the machine type.

You can create the equivalent machine type by specifying the equivalent CPU and RAM in the Google Cloud console, by using the gcloud CLI, or by specifying db-custom-#-# in the API.

Legacy machine type vCPUs Memory (MBs) db-custom-CPU-RAM string (API tier string)
db-n1-standard-1 1 3840 db-custom-1-3840
db-n1-standard-2 2 7680 db-custom-2-7680
db-n1-standard-4 4 15360 db-custom-4-15360
db-n1-standard-8 8 30720 db-custom-8-30720
db-n1-standard-16 16 61440 db-custom-16-61440
db-n1-standard-32 32 122880 db-custom-32-122880
db-n1-standard-64 64 245760 db-custom-64-245760
db-n1-standard-96 96 368640 db-custom-96-368640
db-n1-highmem-2 2 13312 db-custom-2-13312
db-n1-highmem-4 4 26624 db-custom-4-26624
db-n1-highmem-8 8 53248 db-custom-8-53248
db-n1-highmem-16 16 106496 db-custom-16-106496
db-n1-highmem-32 32 212992 db-custom-32-212992
db-n1-highmem-64 64 425984 db-custom-64-425984
db-n1-highmem-96 96 638976 db-custom-96-638976

Your machine type affects the cost of your instance. For more information, see Instance Pricing. You can also see pricing for various scenarios with the Pricing Calculator.

Set password policy

The password policy for the instance. It includes the following options:

  • Minimum length: Specifies the minimum number of characters that the password must have.
  • Password complexity: Checks if the password is a combination of lowercase, uppercase, numeric, and non-alphanumeric characters.
  • Restrict password reuse: Specifies the number of previous passwords that you cannot reuse.
  • Disallow username: Prevents the use of the username in the password.
  • Set password change interval: Specifies the minimum duration after which you can change the password.

The number of CPUs for your instance. You can also choose to create an instance with less than one CPU (a shared code instance, or shared vCPU).


The amount of memory available for your instance. For performance-sensitive workloads such as online transaction processing (OLTP), make sure that your instance has enough memory to contain the entire working set. However, there are other factors that can impact memory requirements, such as number of active connections. Perform load testing to avoid performance issues in production.

Database version
Unless you need a capability provided only by a specific version, accept the default database version (PostgreSQL 12). For gcloud command and REST API usage, see the reference documentation.
Storage type
Choosing SSD, the default value, provides your instance with SSD storage. SSDs provide lower latency and higher data throughput. If you do not need high-performance access to your data, for example for long-term storage or rarely accessed data, you can reduce your costs by choosing HDD.
Storage capacity

Choose a capacity to fit your database size. After you have created your instance, you can manually increase the storage capacity by editing your instance configuration, but you cannot decrease it. Increasing the storage capacity does not cause downtime.

The amount of storage capacity allocated for your instance affects the cost of your instance. For more information, see Storage and Networking Pricing.

For read replicas, the storage capacity must always be at least as high as the storage capacity of the primary instance. When a primary instance is resized, all read replicas are resized, if needed, so that they have at least as much storage capacity as the updated primary instance.

Enable automatic storage increases

If you enable this setting, Cloud SQL checks your available storage every 30 seconds. If the available storage falls below a threshold size, Cloud SQL automatically adds additional storage capacity. If the available storage repeatedly falls below the threshold size, Cloud SQL continues to add storage until it reaches the maximum of 64 TB.

The automatic storage increase setting of a primary instance automatically applies to any read replicas of that instance. The automatic storage increase setting cannot be independently set for read replicas.


The threshold size depends on the amount of storage currently provisioned for your instance; it cannot be larger than 25 GB.

For instances provisioned with 500 GB of storage (or more), the threshold is always 25 GB.

For instances provisioned with less than 500 GB of storage, this formula is used to calculate the threshold:

  5 + (provisioned storage)/25

The result of the division is rounded down to the nearest whole number.

Threshold calculation for an instance with 66 GB storage capacity:

5 + (1/25th of 66 GB) = 5 + (66/25) = 5 + 2.6 -> 5 + 2 = 7 GB
Threshold calculation for an instance with 1000 GB storage capacity:
5 + (1/25th of 1000 GB) = 5 + (1000/25) = 5 + 40 = 45 -> rounded down to the
maximum value of 25 GB

Amount of storage added

The amount of storage added to the instance is equal to the threshold size, which cannot be larger than 25 GB.

Considerations for large disks

For instances provisioned with storage of 500 GB or more, the threshold size is always 25 GB and the amount of storage added is always 25 GB. As a result, the maximum possible empty space is 50 GB. If you do not manually resize the instance with disk greater than 5 TB, the disk can remain at 99% capacity all the time even though the instance has empty space.

Before an operation that rapidly grows disk space usage, such as a large import or a query that requires a large temp table, manually resize the disk, rather than depend on autogrow to keep up.

Automatic storage increase limit

If you enable the automatic storage increase setting, you can provide a specific limit on how large the storage for your instance can automatically grow. Keep in mind that the bigger the size of the instance, the greater the operational latency.

You can't decrease storage size, so this limit can prevent your instance size from growing too large (due to a temporary increase in traffic). Keep in mind that when an instance becomes unable to add storage that it needs, the instance likely stops accepting incoming connections and could go offline.

Setting this limit to zero, the default value, means that there is no limit (other than the maximum available storage for the instance tier).

To set the limit when you create the instance, use the --storage-auto-increase-limit=INTEGER_VALUE_OF_GB parameter, as described on the create instance page. To set the limit on an existing instance, use the same parameter with the gcloud beta sql instances patch command.

The automatic storage increase limit setting of a primary instance automatically applies to any read replicas of that instance. The automatic storage increase limit setting cannot be independently set for read replicas.

Automated backups and point-in-time recovery

These options determine if automated backups are performed and if write-ahead logging is enabled. Both options add a small performance cost and use additional storage, but are required for the creation of replicas and clones, and for point-in-time recovery. When you select this option, you can also select a timeframe when automated backups occur.

Automated backups happen daily, during the time window you choose. At the end of seven days, the oldest backup is deleted.

For information about point-in-time recovery, see Overview of point-in-time recovery.

For information about replication, see Replication Options. For information about cloning instances, see Cloning Instances.

Retention settings for automated backups

The default value for the number of retained backups is 7 but you can change it to any value in the range of 1 to 365.

See Automated backup and transaction log retention for more information.

Location options

You can choose to store backups in multiple or single regions. Multi-region is the default, and the recommended choice because it provides protection against downtime when a region becomes unavailable. Backups are stored in regions that are closest to the instance.

You also have the option of selecting a custom location for your backup. Only use this option if required by regulation or if an organization policy requires your backups to be in specific multiple or single regions. See Custom locations for more information.

Instance deletion protection

Protects an instance against accidental deletion. If this setting is enabled, you must disable it before deleting the instance. See Prevent deletion of an instance.

Enable point-in-time recovery

Point-in-time recovery lets you recover from a backup, starting from a specific point in time.

For information about point-in-time recovery, see Overview of point-in-time recovery.

Availability: Zonal

Puts your instance and backups in a single zone. When you select this option, there is no failover in the event of an outage. Recommended only for test and development purposes.

High availability (regional)

When you select High availability (regional), if there is an outage, your instance fails over to another zone in the region where your instance is located, as long as the failover zone is not having an outage. It is recommended that you select High availability (regional) for instances in your production environment.

See the Overview of the high availability configuration.

Maintenance window

The day and hour when maintenance events for the Cloud SQL instance can be scheduled. Maintenance downtime is typically a minute or less.

Read replicas do not support maintenance window settings at this time.

For more information about maintenance, see About maintenance on Cloud SQL instances.

Maintenance timing

Your preference about the relative order and timing of maintenance updates. Receiving updates earlier lets you test maintenance updates on a test environment before your production instances get the update. The maintenance timing setting doesn't affect the maintenance version that Cloud SQL applies to your instance.

If you don't set the maintenance timing setting, Cloud SQL chooses the timing of updates to your instance (within its maintenance window, if applicable).

For more information about maintenance, see About maintenance on Cloud SQL instances.

Private IP
Configures your instance to use private IP. Learn more.
Public IP
If enabled, your instance is allocated a public IPv4 address. When you disable Public IP, that address is released; you can reenable Public IP later, but you receive a different IPv4 address. By default, the public IP address is blocked for all addresses. Use Authorized networks to enable access.
Authorized networks
You can add specific IP addresses or ranges of addresses to open your instance to those addresses.

For information about configuring IP addresses, see Configuring IP connectivity.

Private path for Google Cloud services

By selecting this check box, you allow other Google Cloud services, such as BigQuery, to access data in Cloud SQL and make queries against this data over a private connection.

This check box is enabled only if you select the Private IP check box, and you add or select an authorized network to create a private connection.

Activation policy
You change the activation policy by starting and stopping the instance. Stopping the instance prevents further instance charges.
Database flags

You can set specific database flags on the Cloud SQL instance.

For a complete list of the database flags you can set, see Configure Database Flags.

Impact of changing instance settings

For most instance settings, Cloud SQL applies the change immediately and connectivity to the instance is unaffected.

Changing the number of CPUs or the memory size results in the instance going offline for less than 60 seconds. The total time for the changes to take effect can take several minutes.

Changing an instance's zone, configuring the private IP, changing its network, and enabling high availability results in the instance going offline for several minutes.

Cloud SQL automatically manages the value of the max_connections flag based on the amount of memory on the instance (for more information, see supported flags). PostgreSQL requires that the value of max_connections is always at least as large on a read replica as it is on its primary. Therefore, if the read replicas have less memory than the primary, changing the amount of memory on the primary might result in its read replicas going offline for less than 60 seconds. This happens because the read replicas might need to receive a new value of max_connections to remain consistent with the change on the primary, and updating the value of max_connections requires restarting PostgreSQL. To prevent this from happening, set the max_connections flag on the primary to a value of your choice.

Plan to make these kinds of changes when your service can handle an outage of this duration.

What's next