What are GCP's policies for redirecting traffic to a replica?

Hello,

Currently, we have a main instance of Cloud MySQL. Sometimes this database has a very high CPU consume so we decided to create a replica. The problem is that yesterday we had a peak of 82% CPU for half an hour but the replica was not receiving traffic and its CPU load was at minimum.

My question is: at what times and by what policies does GCP redistribute requests to the replica to free the primary instance from load?

PD: The replica is read-only.

Thx.

1 Like

Hi @GabrielGCP ,

Welcome to Google Cloud Community!

Apologies for what’s going on with your Cloud SQL setup. There are several factors why we encounter high usage rate:

  • Inefficient queries
  • Ongoing backup/replication (since you mentioned that you currently have a read replica)
  • Connectivity

These are some of the factors. You could perform the following to check whether this would reoccur:

  • Create a new SQL instance with your current setup if the issue would still persist
  • Check Google Cloud status for any downtime
  • Restarting your app (if it supports downtime)

If the issues still persist, you may file a bug so that our engineers would take a look at this. We don’t have a specific ETA but you can keep track of its progress once the ticket has been created.

Hope this helps.

Thanks @robertcarlos . The problem is not the high usage rate, I mean, we now why we have this peak of CPU. The main problem is when the main database has a high usage rate the traffic is not redirected to the only-read replica.