Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure checkpoint timing and Write Ahead Log ( WAL ) limits #3

Closed
Ivansete-status opened this issue Jan 4, 2024 · 2 comments
Closed
Assignees

Comments

@Ivansete-status
Copy link

Ivansete-status commented Jan 4, 2024

The disk volume that we started to contain the Postgres database is 40GB.

With that, I suggest explicitly configuring the default checkpoint/WAL settings and tuning them if we detect that the WAL files (pg_wal) size increases too much.

For that, I suggest explicitly configuring the following:

checkpoint_timeout = 5min
max_wal_size = 1GB
min_wal_size = 80MB

ℹ️ there is no way to directly limit the WAL size kept by Postgres. We need to make it indirectly through those settings.

  • checkpoint_timeout: Determines the maximum time interval between automatic WAL checkpoints.
  • max_wal_size: Specifies the maximum size of the WAL files in bytes before a checkpoint is triggered.
  • min_wal_size: Specifies the minimum size of the WAL files needed before a checkpoint is triggered.
@jakubgs jakubgs self-assigned this Jan 8, 2024
@jakubgs
Copy link
Member

jakubgs commented Jan 8, 2024

The best way to do this is most probably using the ALTER SYSTEM command which writes to postgresql.auto.conf:
https://www.postgresql.org/docs/current/sql-altersystem.html

We could edit postgresql.conf with Ansible, but that is already being created by the container, so I'd rather avoid that.

jakubgs added a commit that referenced this issue Jan 9, 2024
Necessary for waku fleets to limnit WAL growth size.
#3

Signed-off-by: Jakub Sokołowski <jakub@status.im>
jakubgs added a commit to status-im/infra-status that referenced this issue Jan 9, 2024
Related to:
status-im/infra-role-postgres-ha#3

Signed-off-by: Jakub Sokołowski <jakub@status.im>
@jakubgs
Copy link
Member

jakubgs commented Jan 9, 2024

Done:

And shards fleet changes:

If any other fleets need this please tell me.

@jakubgs jakubgs closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants