Google Sql problems

Hi, i do a migration from aws to google cloud, with same resorces.

But minha google sql is in 90% and on aws no transpass to 50%.

i think need set a  sinalization or same someting else.

sinalizations:

log_bin_trust_function_creatorson
sql_modeALLOW_INVALID_DATES
max_allowed_packet1073741823
default_time_zone-03:00
max_heap_table_size67108864
tmp_table_size67108864
join_buffer_size26214400
sort_buffer_size26214400
innodb_sort_buffer_size67108863
grafico-google-sql.png
0 1 64
1 REPLY 1

There are several factors why you might be seeing higher CPU Spikes. Below are some Troubleshooting and optimizations options:

  • Performance Profiling: Leverage Cloud SQL's Query Insights and Cloud Monitoring to identify CPU-intensive queries and bottlenecks. Enabling the MySQL slow query log can also help capture long-running queries for further analysis.

  • Query Optimization: Focus on refining slow-running queries by:

    • Enhancing index usage.

    • Rewriting inefficient queries.

    • Reducing unnecessary full table scans.

  • Configuration Review: Adjust Cloud SQL-specific parameters based on performance insights. Important parameters affecting performance include:

    • innodb_buffer_pool_size: Controls the size of the buffer pool, which caches data and indexes in memory.

    • max_connections: Determines the maximum number of simultaneous client connections.

    • Thread and connection management settings to optimize server resource usage.

  • Workload Adjustments: Consider strategies like using read replicas to distribute read-heavy workloads and implementing a caching layer (e.g., Redis, Memcached) to reduce direct database queries.

Serializations and Configuration Parameters

  • While parameters like log_bin_trust_function_creators and sql_mode might not directly impact CPU usage, they influence database behavior and performance. For example, sql_mode can affect how certain queries are executed, potentially impacting CPU indirectly.

Additional Considerations

  • Cloud SQL Insights: Utilize Cloud SQL Insights for detailed query performance analysis, which can help in identifying and diagnosing issues related to high CPU usage.

  • Version Compatibility: Ensure MySQL versions are compatible or identical between AWS RDS and Google Cloud SQL to avoid performance issues stemming from differences in database engine optimizations and configurations.