I'm completely new in Postgres optimization. I was reading a lot about checkpoint and WAL files. I found a query to examine the ratio of checkpoints time to requested (exceeded WAL max size)
SELECT checkpoints_timed, checkpoints_req
FROM pg_stat_bgwriter;
checkpoints_timed | checkpoints_req |
---|---|
20496 | 53 |
In order to minimalize requested checkpoint I changed postgres configuration to:
checkpoint_timeout = 15min
max_wal_size = 2GB
min_wal_size = 200MB
But when I check WAL dir space is still 83MB (as the default value from configuration).
select sum(size)
from pg_ls_waldir();
Can anyone explain why WAL directory size is still ~83MB and not increasing to 200MB?
I noted that changing parameters has triggered 2 checkpoints_req so I guess that max_wal_size is still 1GB?