When connecting to Google Cloud SQL from Google App Engine, consider pricing and limits for both.
For instructions on how to connect to Cloud SQL, see Using Cloud SQL.
There are limits imposed from both Cloud SQL and App Engine.
Cloud SQL for MySQL Second Generation connection limits
|Machine type||Maximum concurrent connections|
|All other machine types||4,000|
Cloud SQL for PostgreSQL connection limits
|Memory size, in GiB||Maximum concurrent connections|
|3.75 up to 6||100|
|6 up to 7.5||150|
|7.5 up to 15||200|
|15 up to 30||250|
|30 up to 60||300|
|60 up to 120||400|
|120 and above||500|
Cloud SQL for MySQL First Generation connection limits
Incoming connection requests are briefly queued before the connection is established. The queue can accept only 100 incoming connection requests.
|Tier||Maximum concurrent connections|
|D0 - D2||250|
Cloud SQL storage limits
|MySQL First Generation instances||MySQL Second Generation instances||PostgreSQL instances||Notes|
|250 GB||Up to 10,230 GB, depending on machine type||Up to 10,230 GB, depending on whether the instance has dedicated or shared vCPUs.||It is possible to increase individual First Generation instance limits up to 500 GB for customers with a Silver or higher Google Cloud support package.|
For information on Cloud SQL billing plans and limits, see the Cloud SQL Pricing page.
Requests from Google App Engine applications to Google Cloud SQL are subject to the following time and connection limits:
- All database requests must finish within the HTTP request time limit, which is around 60 seconds.
- Offline requests such as cron tasks have a time limit of 10 minutes.
- Requests to Google Cloud SQL have limitations based on the scaling type of the App Engine module and how long an instance can remain in memory (residence).
- Each App Engine instance running in a standard environment cannot have more than 12 concurrent connections to a Google Cloud SQL instance.
App Engine applications are also subject to the App Engine quotas.