Instance Settings

This page provides information about all of the settings available for Cloud SQL instances, for both First Generation and Second Generation instances.

Settings for Second Generation instances

Setting Modifiable after creation? Possible values
Instance ID N Composed of lowercase letters, numbers, and hyphens; must start with a letter.
Database version N MySQL 5.7
MySQL 5.6
Region N asia-east1 — Taiwan
asia-northeast1 — Tokyo
asia-south1 — Mumbai
asia-southeast1 — Singapore
australia-southeast1 — Sydney
europe-north1 — Finland
europe-west1 — Belgium
europe-west2 — London
europe-west3 — Frankfurt
europe-west4 — Netherlands
northamerica-northeast1 — Montréal
southamerica-east1 — São Paulo
us-central1 — Iowa
us-east1 — South Carolina
us-east4 — Northern Virginia
us-west1 — Oregon
us-west2 — Los Angeles
Zone Y The possible values depend on the region.
Machine type (Tier) Y db-f1-micro
db-g1-small
db-n1-standard-1
db-n1-standard-2
db-n1-standard-4
db-n1-standard-8
db-n1-standard-16
db-n1-standard-32
db-n1-standard-64
db-n1-highmem-2
db-n1-highmem-4
db-n1-highmem-8
db-n1-highmem-16
db-n1-highmem-32
db-n1-highmem-64
Storage type N SSD (default value)
HDD
Storage capacity Y
(Increase only)
Standard and high memory machine types: up to 10230 GB.
Shared-core machine types (db-f1-micro and db-g1-small): up to 3062 GB.
Automatic storage increase Y On (default value)
Off
Automatic storage increase limit Y In GiBs. 0 (the default) means there is no limit.
Backups and binary logging Y
(see note)
On (default value)
Off
Maintenance window Y Day of the week, and hour.
Maintenance timing Y Any (default value)
Later
Earlier
Authorized networks Y IP addresses or ranges of addresses, in CIDR notation.
Activation policy Y ALWAYS
NEVER
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).
Region
The Google Cloud Platform region where your instance is located. To improve performance, keep your data close to the services that need it. For more information, see Instance Locations.
Zone
The Google Cloud Platform 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, you should accept the default zone. For more information, see Instance Locations.
Machine Type (Tier)

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

For performance-sensitive workloads such as online transaction processing (OLTP), a general rule of thumb is to 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. You should perform load testing to avoid performance issues in production.

Be sure to select a machine type that is sufficiently large for your workload, and upgrade as your workload increases. A machine type with insufficient CPUs could lose its SLA coverage. Learn more.

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.

Database version
Unless you need a capability provided only by a specific version, you should accept the default database version.
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 increase your storage capacity, but you cannot decrease it. The amount of storage capacity allocated for your instance affects the cost of your instance. For more information, see Storage and Networking Pricing.
Automatic storage increase

If this setting is enabled, your available storage is checked every 30 seconds. If available storage falls below a threshold size, additional storage capacity is automatically added to your instance.

Threshold

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 -> maximum value of 25 MB

Amount of storage added

The amount of storage added to the instance is equal to the threshold size.

Automatic storage increase limit

If the automatic storage increase setting is enabled, this setting optionally imposes a limit on how large the storage for your instance can automatically grow. Because storage size cannot be decreased, this limit can prevent your instance from growing its storage size to an unnecessarily large size due to a temporary increase in traffic. Keep in mind, however, that when an instance stops being able to add storage that it needs, it is likely to stop 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).

Backups and binary logging
These settings determine whether automated backups are performed and whether binary logging is enabled or not. Both options add a small performance cost, but are required for the creation of replicas and clones, and for point-in-time recovery.

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.

Maintenance window

The day and hour when disruptive updates (updates that require an instance restart) to this Cloud SQL instance can be made. If the maintenance window is set for an instance, Cloud SQL does not initiate a disruptive update to that instance outside of the window. The update is not guaranteed to complete before the end of the maintenance window, but restarts typically complete within a couple of minutes.

If you do not specify a maintenance window, disruptive updates can happen at any time, although they generally only occur every few months.

Replicas do not support the maintenance window setting; they can experience a disruptive upgrade at any time.

Maintenance timing

This setting lets you provide a preference about the relative timing of instance updates that require a restart. Receiving updates earlier lets you test your application with an update before your instances that get the update later.

The relative timing of updates is not observed between projects; if you have instances with an earlier timing setting in a different project than your instances with a later timing setting, Cloud SQL makes no attempt to update the instances with the earlier timing setting first.

If you do not set the Maintenance timing setting, Cloud SQL chooses the timing of updates to your instance (within its Maintenance window, if applicable).

The Maintenance timing setting does not affect the software version Cloud SQL applies to your instance.

Authorized networks
You can add specific IP addresses or ranges of addresses to open your instance to those addresses. This is required to connect to your instance if you do not use the Cloud SQL Proxy.

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

For information about configuring the Cloud SQL Proxy, see Using the Proxy.

Activation policy
For Second Generation instances, the activation policy is used only to start or stop the instance. 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 Configuring Database Flags.

Settings for First Generation instances

Setting Modifiable after creation? Possible values
Instance ID N Composed of lowercase letters, numbers, and hyphens; must start with a letter.
Region N asia-east1 — Taiwan
europe-west1 — Belgium
us-central — Iowa
us-east1 — South Carolina
Tier Y D0
D1
D2
D4
D8
D16
D32
Database version N MySQL 5.5
MySQL 5.6 (default value)
Billing plan Y Per Use (default value)
Packages
Preferred location Y Follow App Engine app (default value)
Compute Engine zone
No preference
Backups and binary logging Y
(see note)
On or Off
Activation policy Y On Demand (default value)
Always On
Off
File system replication Y Synchronous (default value)
Asynchronous
IPv4 address Y Checkbox
Authorized networks Y IP addresses or ranges of addresses, in CIDR notation.
Authorized App Engine applications Y Application IDs
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. Instance names must have 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).
Region
The GCP region where your instance is located. To improve performance, keep your data close to the services that need it. For more information, see Instance Locations.
Tier
Determines memory, virtual cores, and other resources available to your Cloud SQL instance. If possible, your largest table size should fit in memory. Your machine type affects the cost of your instance. For more information, see First Generation Pricing.
Billing plan
Determines how charges are calculated for your instance. Instances with the Per Use plan are charged only while the instance is running, whereas instances with the Packages plan are charged per hour. For more information, see First Generation Pricing. You can also see pricing for various scenarios with the Pricing Calculator.
Database version
Unless you need a capability provided only by a specific version, you should accept the default database version.
Preferred location
If you are using your Cloud SQL instance to provide data to an application running in App Engine or in a Compute Engine instance, you can use this field to tell Cloud SQL about the connection. If there is a zonal outage and your instance is failed over to another zone, Cloud SQL attempts to keep the instance close to its application. For more information about building applications to meet your latency, availability and durability requirements, see Geography and Regions.
Backups and binary logging
These settings determine whether backups are performed and whether binary logging is enabled or not. Both options add a small performance cost, but are required for the creation of replicas and clones, and for point-in-time recovery. For information about backups and 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.
Activation policy
For First Generation instances with the Per Use billing plan, setting the activation policy to On Demand can reduce instance charges, depending on usage patterns. For more information about the activation policy, see the FAQ.
File system replication
You can choose the file system replication type for your instance. In most cases, the default value, Synchronous, is best. Asynchronous provides a slight performance gain, but if an outage occurs with this option set to Asynchronous, you can lose up to a few seconds of updates to your data.
File system replication is not the replication type used for data replication (read replicas or failover replicas).
IPv4 address
You can request an IPv4 address for your instance. IPv4 instances incur a small charge when the instance is not activated. If you can use IPv6, you can avoid the IPv4 charges. For information about configuring an IP address, see Configuring access for IP connections.
Authorized networks
You add specific IP addresses or ranges of addresses to enable applications or tools at those addresses to access the instance. For information about configuring IP addresses, see Configuring IP Access.
Authorized App Engine applications
You can authorize App Engine applications running in the standard environment to connect to the instance. By default, the App Engine application associated with the project is authorized to connect. For information about connecting from App Engine applications, see Connecting from App Engine Standard environment to First Generation.
Database flags
You can set specific database flags on the Cloud SQL instance. For a complete list of the flags you can set, see Configuring Database Flags.

Impact of changing instance settings

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

For First Generation instances, changing the instance size (tier) causes Cloud SQL to automatically restart the instance. This means that connections to the instance are dropped, and new connections cannot be made for the few moments that the instance is restarting. This is typically not a problem for applications designed to deal with temporary disruptions to database connectivity.

For Second Generation instances, changing either the machine type or the zone of the instance results in the instance going offline for several minutes. You should plan to make these kind of changes when your application can handle an outage of this length.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud SQL for MySQL