Courseiva

PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions

An e-commerce platform uses Cloud SQL for PostgreSQL with max_connections set to 500. They plan to increase the number of application instances requiring connections. The instance has 8 vCPUs and 32 GB RAM. What is the maximum number of connections Cloud SQL can support based on the default formula?

⚠ Common exam trap

Google Cloud often tests the distinction between Cloud SQL for PostgreSQL and MySQL caps; the trap here is that candidates assume the formula output is the final answer, or they confuse the PostgreSQL cap (2048) with MySQL's cap (4096).

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

2048

Cloud SQL for PostgreSQL uses a default formula to calculate max_connections: max_connections = min(4 * vCPUs + 100, 2048) for PostgreSQL instances. With 8 vCPUs, the raw calculation gives 132, but the cap of 2048 governs the maximum allowed. Since the question asks for the maximum based on the default formula, the correct answer is the cap value of 2048. Candidates often mistakenly use the raw formula output (132) or confuse with MySQL's cap (4096).

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • 2048

    Why this is correct

    The default formula for Cloud SQL for PostgreSQL is max_connections = min(4 * vCPUs + 100, 2048). With 8 vCPUs, the raw value is 132, but the cap of 2048 sets the maximum possible connections. Thus, the answer is 2048.

  • 4096

    Why it's wrong here

    4096 is the cap for Cloud SQL for MySQL, not PostgreSQL. For PostgreSQL, the cap is 2048, so this option is incorrect.

  • 1024

    Why it's wrong here

    1024 is not the cap for either PostgreSQL or MySQL in Cloud SQL. The PostgreSQL cap is 2048, and the MySQL cap is 4096.

  • 500

    Why it's wrong here

    500 is the current setting, but the question asks for the maximum supported by the default formula, which is 2048.

About these practice questions

Courseiva writes every PCDE question from scratch — 1,446 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

4 more ways this is tested on PCDE

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company is migrating an on-premise PostgreSQL database to Cloud SQL. The current database has a connection pool with 200 connections and uses 64 GB RAM. According to Cloud SQL best practices, what is the maximum recommended max_connections setting?

hard
  • A.200
  • B.64
  • C.4096
  • D.1024

Why C: The formula for max_connections on Cloud SQL is RAM_MB / 16. 64 GB = 65536 MB. 65536 / 16 = 4096. However, the question asks for the maximum recommended setting based on RAM. Note: This formula is for Cloud SQL; the actual max_connections default may vary, but the formula is a best practice guide.

Variation 2. An e-commerce platform runs on Cloud SQL and expects heavy write traffic during a flash sale. The database instance currently has 8 vCPUs and 32 GB RAM. Based on the max_connections formula (max_connections = RAM_MB/16), what is the current maximum number of connections, and what change would increase it?

medium
  • A.2048 connections; increase vCPU to 16
  • B.4096 connections; increase vCPU to 16
  • C.2048 connections; increase RAM to 64 GB
  • D.4096 connections; increase RAM to 64 GB

Why C: With 32 GB = 32768 MB, max_connections = 32768/16 = 2048. To increase connections, you need to increase RAM (e.g., 64 GB gives 4096). vCPU does not directly affect max_connections per the formula.

Variation 3. An application uses Cloud SQL (MySQL) and experiences an increasing number of 'too many connections' errors. The current instance has 4 vCPUs and 15GB of RAM. The application's connection pool is configured for 500 connections. What should the engineer do to resolve this error?

easy
  • A.Configure a Cloud SQL connection pool with a maximum of 100 connections
  • B.Create a read replica to distribute read connections
  • C.Upgrade the instance to have 8 vCPUs to increase connection capacity
  • D.Increase the max_connections flag in the Cloud SQL database flags settings

Why D: The max_connections in MySQL is typically set based on memory: max_connections = RAM_MB/16. With 15GB RAM = 15360 MB, max_connections = 15360/16 = 960. The application pool of 500 should be fine, but if the error occurs, it might be due to other factors. However, the most common fix is to increase the max_connections parameter via a flag. The correct step is to increase the 'max_connections' flag in Cloud SQL. Reducing connections or using a connection pool won't help if the limit is reached. Increasing vCPUs does not directly change max_connections.

Variation 4. A company is migrating their on-premises Oracle OLTP workload to Cloud SQL for PostgreSQL. The database currently supports 500 concurrent connections and has a working set of 8 GB. What is the minimum memory required for the Cloud SQL instance based on the max_connections formula (max_connections = RAM_MB/16)?

medium
  • A.16 GB
  • B.4 GB
  • C.8 GB
  • D.32 GB

Why C: Using the formula, RAM = max_connections * 16 = 500 * 16 = 8000 MB = 8 GB. However, this is only for connection overhead; additional memory is needed for buffer pool and working set. The question asks for minimum memory based on the formula alone, so 8 GB is the answer.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDE exam.