zip archive log files using archive_command postgres
In PostgreSQL WAL files are created as 16 MB chunks. Even though there is no transactions written into the WAL files still it occupy 16 MB space. To reduce the space usage, zip those files with archive_command parameter.
Enable archiving with compression of archivelogs:
wal_level=archive # you can set this value to any value after archive
archive_mode = on
archive_command = ‘cp %p /home/postgres/archivedir/%f && gzip /home/postgres/archivedir/%f’
NOTE: replace “/home/postgres/archivedir” with the archive location where you want to store your archive logs.