Обсуждение: [ADMIN] How often are archived was files sent to archive server - too many WALS
Hi
I was wondering if you could help. I am running a Postgresql 9.4 server on Ubuntu 14.04 which has a lot of traffic. I am using wal archiving using rsync as part of a setup using Barman for backups. My server is in a repmgr cluster with one slave and I am doing Barman backups from the slave. That is why I am using rsync rather than wal streaming. There is less than 1 sec replication delay with repmgr. I get a lot of wal generation due to the busyness of the server. To this end, sometimes 20,000 plus WALS accumulate on the master as it seems that the archived wals are not being sent to the Barman (wal archive)server quick enough by rsync to get cleared down on the master. Network bandwidth is not used much at all. Normally I have more then 20,000 ready files at some stages which suggest that that there is lag, or wals are being generated more quickly and processed ready for archiving than Postgres run's the archive command. Servers are on the same network but different SAN's. If I change the archive command so that the wals archive to the servers local disk they clear down quick enough and we do not run into issues. This is not a permanent solution as ultimately I end up switching off the archive command and breaking barman. Can anyone tell me how often Postgres fires the archive command by default and if you can adjust this? Could this be the cause? Or if it is likely to be the fact that the machines are on different SANS (the disks could even be different speeds) which is causing the lag? Or another Postgres setting? Normally I generate 2,000 - 2,500+ WALS an hour when archive is on. When archive mode is off the WALS re-cycle fine and only around 300-430 or less are around at a time. Changed wal_keep_segments to 0 in case this was making things worse.
Any help you could give would be much appreciated.
Sent from ProtonMail, Swiss-based encrypted email.