Quotas and limits

This page provides information about the Cloud SQL quotas and limits. Quotas are applied per-project; limits are applied to the instance or to the project, depending on the limit.

Checking your quotas

To check the current quotas for resources in your project, go to the Quotas page in the Google Cloud Console.

Increasing your quotas

As your use of Google Cloud expands over time, your quotas can increase accordingly. If you expect a notable upcoming increase in usage, make your request a few days in advance to ensure your quotas are adequately sized.

  1. In the Quotas page, select Cloud SQL API in the Services dropdown list.

    If you do not see Cloud SQL API, the Cloud SQL Admin API has not been enabled.

  2. Select the quotas you want to change.

  3. Click Edit quotas.

  4. Fill out your name, email, and phone number and click Next.

  5. Fill in your quota request and click Submit request.

You will receive a response from the Cloud SQL team within 48 hours of your request.

How resource quotas are replenished

Daily quotas are replenished daily at midnight Pacific time.

Quotas and resource availability

Resource quotas are the maximum amount of resources you can create for that resource type if those resources are available. Quotas do not guarantee that resources will be available at all times. If a resource is not physically available for your region, you will not be able to create new resources of that type, even if you still have remaining quota in your project.

Limits

There are restrictions on some Cloud SQL resources that are not replenished periodically and not shown on the Quotas page in the Google Cloud Console. Some limits can be increased while others cannot.

Configurable limits

Instances per project

By default, you can have up to 100 instances per project. If you need more, file a support case to request the increase.

Maximum concurrent connections

MySQL

You can use the max_connections flag to configure connections limits. The Cloud SQL team recommends using the default connection limits to ensure instance stability. You can find the connection limits for your instance by connecting to your database and running this command: SHOW VARIABLES LIKE "max_connections";

Cloud SQL for MySQL default connection limits

Machine type Default concurrent connections
db-f1-micro 250
db-g1-small 1,000
All other machine types 4,000

PostgreSQL

You can use the max_connections flag to configure connections limits. The Cloud SQL team recommends using the default connection limits to ensure instance stability.

When you create a Cloud SQL for PostgreSQL instance, the machine type configuration settings automatically adjust the range of memory sizes available, based on the number of cores you select. This also determines the initial default connection limits set for the instance.

You can find the connection limits for your instance by connecting to your database and running this command: SELECT * FROM pg_settings WHERE name = 'max_connections';

The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that is lower than the new value on the primary, or that have not been changed from the default value.

SQL Server

The actual number of user connections allowed depends on the version of SQL Server that you are using, and also the limits of your application or applications and hardware. SQL Server allows a maximum of 32,767 user connections.

For information about configuring user connections in SQL Server, see the reference documentation.

Fixed limits

Table limit

Cloud SQL for MySQL has a limit of 10,000 tables for an instance. Too many tables can significantly impact the performance of a Cloud SQL instance. Instances that exceed this limit are not covered by the SLA.

When a table size reaches 16 TB, the maximum size for Linux partitions, more data files cannot be added to it.

Operations limit

Micro and small tier machine types limit the number of concurrent operations. Exceeding these limits causes a Too many operations error.

The db-custom-1-3840 (single CPU) machine type limit is 50 concurrent operations.

Metrics collection limit

PostgreSQL metrics are collected for up to 500 databases.

Cloud SQL storage limits

MySQL instances PostgreSQL and SQL Server instances
Up to 64 TB, depending on the machine type. Up to 64 TB, depending on whether the instance has dedicated or shared vCPUs. See the Instance settings for PostgreSQL or SQL Server.

Cloud SQL storage options

To configure a storage option for best performance, it's important to understand your workload and choose the appropriate disk type and size. For more information on the available choices for Cloud SQL, see instance settings.

App Engine limits

Each App Engine instance running in a standard environment cannot have more than 100 concurrent connections to an instance. For PHP 5.5 apps, the limit is 60 concurrent connections.

App Engine applications are subject to request time limits depending on usage and environment. For more information, see how instances are managed in App Engine standard environment standard and flexible environments.

App Engine applications are also subject to additional App Engine quotas and limits as discussed on the App Engine Quotas page.

Cloud Run limits

Cloud Run services are limited to 100 connections to a Cloud SQL database. This limit applies per service instance. This means that each instance of the Cloud Run service can have 100 connections to the database, and as it scales the total number of connections per deployment can grow.

Cloud Function limits

Note: Cloud Functions limits concurrent executions to 1 per instance. You never have a situation where a single function instance is processing two requests at the same time. In most situations, only a single database connection is needed.