Create an assessment of a recommendation

Use assessments in Database Center to assess and test the performance impact of database recommendations before you apply them to your production database fleet.

To assess recommendations, the assessments performs these operations:

  • Clones your database instance.

  • Runs benchmarking simulation tests on the clone.

  • Compares the baseline performance of the clone against the performance after you apply the recommended configuration changes.

Supported products and recommendations

Database Center assessments are available only for Cloud SQL for PostgreSQL instances.

You can assess the following types of recommendations:

  • Compute resource expansion: Evaluates the impact of resizing instances to machine types with more vCPUs or memory.

  • Edition upgrade: Assesses the performance impact of migrating from the Cloud SQL Enterprise edition to the Cloud SQL Enterprise Plus edition of Cloud SQL for PostgreSQL. For details, see Upgrade an instance to Cloud SQL Enterprise Plus edition in place.

  • Data cache activation: Analyzes the latency and throughput implications of enabling the data cache.

Before you begin

Ensure that you meet the following requirements before you run a recommendation assessment:

  • API enablement: Enable the following APIs:

    See Enabling and disabling APIs to enable APIs.

  • Database connection credentials: You must provide the target database name and a database username.

  • Secret Manager secret: You must store the password for your database username in a global Secret Manager secret and know the name of the secret so you can search for it in the secret picker. You only need the full secret path if the secret doesn't appear in the list. For more information about creating secrets, see Creating and accessing secrets.

  • Service account: Configure an Identity and Access Management (IAM) service account for the environment to benchmark and compare baseline performance against recommended changes. This service account requires permissions to read the database credentials secret from Secret Manager and to coordinate benchmarking tasks in Cloud Run. See Creating a service account to configure service accounts.

  • IAM permissions: You must have the required IAM permissions to initiate and manage the testing process. For more information, see Required IAM permissions.

Assess a recommendation

Follow these steps to assess and test a recommendation:

  1. Go to the Database Center page in the Google Cloud console.

    Go to Database Center

  2. Click Assessments in the navigation menu.

  3. Locate a supported recommendation for a Cloud SQL for PostgreSQL instance.

  4. Click Assess impact in the Implications column for that recommendation.

    If you haven't enabled the required APIs, follow the guidance in the panel to enable them.

  5. On the Assessment details page, enter the following connection details in the configuration panel:

    1. In Database, enter the name of the database. Valid options correspond to the databases listed on the Databases page of your Cloud SQL instance.

    2. In Username, enter the database username.

    3. In Password secret, select the Secret Manager secret containing the database user password.

      If the secret doesn't appear in the list, enter the secret path manually in the format projects/PROJECT_ID/secrets/SECRET_NAME. Replace PROJECT_ID with your project ID and SECRET_NAME with the name of the secret. By default, Database Center uses the latest version of the secret. You can optionally specify a version by appending /versions/VERSION to the path, replacing VERSION with the version of the secret.

    4. In Service account, select the service account to use for running the benchmarking jobs.

  6. Click Generate test plan. Generating the plan takes a few minutes.

    Database Center generates a test plan preview showing the sequence of steps to clone the database, run pgbench workloads, apply the recommendation, and analyze performance.

    Database Center lists the session on the Assessments page when it generates the plan. You can safely navigate away from the page and return to the session later.

  7. To refine the test plan, in the Test instructions field, enter instructions (for example, Change the benchmark duration to 60 seconds), and then click Update test plan.

  8. Click Start assessment. In the confirmation dialog, review the billing notice. Provisioning the cloned instance and running benchmark jobs are billable within your project.

    The assessment session is available for 48 hours. Database Center automatically deletes the cloned instance after a successful assessment. If the assessment fails, the cloned instance isn't deleted automatically, and you must delete it manually.

  9. Click Confirm to start the evaluation. The assessment process takes some time to complete.

    Database Center displays the assessment progress. You can safely leave the page while the session runs in the background.

View assessment history and reports

Manage evaluations and review performance comparison reports by tracking assessment sessions. Database Center retains session reports and metadata for 48 hours and displays an expiration countdown for each session.

  1. In the Google Cloud console, go to the Database Center page.

    Go to Database Center

  2. In the navigation menu, click Assessments.

  3. In the sessions list, click the Session ID of the session to view its details.

    The following table describes the assessment session statuses, the information displayed for each status, and the available actions:

    Status Displayed information Available actions
    Planning phase Test plan details and preview. Refine the test plan preview using the Test instructions field, or click Start assessment to begin the assessment.
    Assessment phase The assessment progress and the test plan used by the assessment. Click Cancel to cancel the assessment.
    Completed A summary that compares database performance before and after applying the recommendation. None
    Canceled The progress of the assessment before it was canceled. None
    Generation failed Generation of the test plan failed. You can view test plan details and configuration fields, such as the database name and secret name, to retry generating the test plan. Update the assessment configuration settings, such as database name and username, and retry the test plan generation.
    Assessment failed The assessment of the recommendation failed. You can view the error message and the progress of the assessment before it failed. None

Cancel a session or clean up failed sessions

If you cancel an assessment session in progress or if the execution fails, verify that all temporary resources are removed. Because Database Center can't confirm whether cleanup succeeded after a failure or cancellation, check for and delete remaining database clone instances for all failed and canceled sessions.

  • Cancel a session: On the Assessments page, click the session ID of the assessment you want to cancel, then click Cancel. To cancel a session, its session ID must have a status of Assessment phase.

  • Clean up cloned resources:

    To manually delete the cloned instance:

    1. In the Google Cloud console, go to the Cloud SQL Instances page.

      Go to Cloud SQL Instances

    2. In the instances list, locate the cloned instance. You can identify the clone using the resource link displayed on the session details page.

    3. Click More actions next to the cloned instance, and then click Delete.

    4. In the confirmation dialog, enter the clone instance name and click Delete.

Required IAM permissions

You need specific permissions to initiate and manage the testing process. Obtain these permissions by assigning predefined roles or by creating custom roles with individual permissions.

See Access control with IAM to manage access and understand roles.

Permissions for the end user

The following table lists the permissions required for your user account and the predefined roles that contain them:

Required permissions Predefined role
cloudsql.instances.patch
cloudsql.instances.clone
cloudsql.instances.delete
cloudsql.instances.get
cloudsql.instances.createTestingAgentSession
cloudsql.instances.getAgentSession
cloudsql.instances.listAgentSessions
cloudsql.instances.cancelAgentSession
roles/cloudsql.admin
run.jobs.create
run.jobs.run
roles/run.developer
logging.logEntries.list roles/logging.viewer
secretmanager.secrets.list roles/secretmanager.viewer
serviceusage.services.use roles/serviceusage.serviceUsageConsumer
monitoring.monitoredResourceDescriptors.list (optional) roles/monitoring.viewer or roles/viewer

To view charts data on the assessment results page, your user account must have the monitoring.monitoredResourceDescriptors.list permission. This permission is recommended, but it isn't required to run recommendation assessments.

The user initiating the assessment must also have the Service Account User role (roles/iam.serviceAccountUser) or the iam.serviceAccounts.actAs permission on the selected service account.

Permissions for the Cloud Run service account

The following table lists the permissions required for the service account used by the Cloud Run jobs and the predefined roles that contain them:

Required permissions Predefined role
cloudsql.instances.connect roles/cloudsql.client
cloudsql.instances.login roles/cloudsql.instanceUser
secretmanager.versions.access roles/secretmanager.secretAccessor

Limitations

Consider the following limitations when you use recommendation assessment:

  • Informational report only: The assessment doesn't apply modifications to your production databases. If you approve of the benchmarking results, apply the recommendations manually by using the Cloud SQL for PostgreSQL console or Cloud SQL for PostgreSQL APIs.

  • 48-hour expiration: Database Center retains session reports and metadata in the session store for only 48 hours, and then deletes them.

  • Single user isolation: Only the user who created a validation session can view it. Other principals in your project can't view your session history or results.

  • Global secret location: The Secret Manager secret containing the database password must be a global secret. Regional secrets aren't supported.

Billing

A recommendation assessment incurs charges for the resources that you use during the evaluation. The system creates a clone of your database instance in your project, and you pay for this clone. Database Center automatically deletes the clone after a successful assessment. If an assessment fails or is canceled, you must manually delete the clone to avoid ongoing charges.

In addition, the database agent uses other Google Cloud infrastructure that might incur costs, including:

  • Cloud SQL: For the cloned instance. For details, see Cloud SQL pricing.
  • Cloud Run: To run the assessment agent. For details, see Cloud Run pricing.
  • Other services: Minor charges for other services used to coordinate the assessment.

You pay only for the time that the assessment runs.

What's next