Ensure that "log_checkpoints" database flag is enabled for all PostgreSQL database instances available within your Google Cloud Platform (GCP) account. The "log_checkpoints" PostgreSQL flag allows checkpoints and restart points to be logged in the PostgreSQL server log. By default, the "log_checkpoints" flag is disabled.
PostgreSQL database checkpoints are usually disrupting your database performance and can cause connections to stall for up to a few seconds while they occur. By enabling the "log_checkpoints" flag you can get verbose logging of the checkpoint process for your PostgreSQL database servers. The log messages include statistics such as the number of buffers written and the time spent writing them, therefore the logging data can be used to identify and troubleshoot sub-optimal PostgreSQL database performance.
Note: Some database flag settings can affect instance availability and/or stability, and eventually remove the PostgreSQL instance from the Google Cloud SQL Service Level Agreement (SLA).
Audit
To determine if the "log_checkpoints" flag is enabled for your PostgreSQL database instances, perform the following actions:
Remediation / Resolution
To turn on the "log_checkpoints" database flag for your Google Cloud Platform (GCP) PostgreSQL database instances, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- Cloud SQL for PostgreSQL
- Configuring database flags
- Editing instances
- PostgreSQL Database Documentation
- 19.8. Error Reporting and Logging
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud sql instances list
- gcloud sql instances describe
- gcloud sql instances patch