PostgreSQL checkpoint logging is disabled

Use Cloud SQL for PostgreSQL checkpoint logs to investigate write load and performance.

Description

log_checkpoints records checkpoints and restartpoints, including buffers written and time spent. Disabling it reduces the records available to investigate write load and checkpoint frequency.

Potential impact

Finding the cause of I/O spikes or slow responses can take longer.

Remediation

Set log_checkpoints to the string on in settings.database_flags. Preserve other required flags and verify log collection and retention.

Examples

The examples compare logging settings; supply the actual PostgreSQL version and JSON credential file. Disabling logging does not stop checkpoints themselves.

Before

yaml
- name: create instance
  google.cloud.gcp_sql_instance:
    name: gcp-instance
    settings:
      database_flags:
        - name: log_checkpoints
          value: "off"
      tier: db-n1-standard-1
    region: us-central1
    project: "{{ gcp_project_id }}"
    database_version: "{{ postgres_version }}"
    auth_kind: serviceaccount
    service_account_file: "{{ gcp_credentials_file }}"
    state: present

After

yaml
- name: create a instance
  google.cloud.gcp_sql_instance:
    name: gcp-instance
    settings:
      database_flags:
        - name: log_checkpoints
          value: "on"
      tier: db-n1-standard-1
    region: us-central1
    project: "{{ gcp_project_id }}"
    database_version: "{{ postgres_version }}"
    auth_kind: serviceaccount
    service_account_file: "{{ gcp_credentials_file }}"
    state: present

References