Frederiko Costa <frederiko@gmail.com> wrote:
> I noticed the new logs files don't get copied to the directory
> specified on the archive_command. It's only copied when I do the
> pg_start_backup()/pg_stop_backup() base backup. Is this behaviour
> only achieved if I set archive_timeout? I did not want to do that,
> because I thought as soon as the 16MB WAL segment file got created
> it would be copied to the exported directory.
Have you actually been filling up any 16MB WAL file segments? How
have you determined that? What happens when you run (as a database
superuser) this command?:
SELECT pg_switch_xlog();
If the reason you don't want to set archive_timeout is that you
don't want 16MB files piling up when there is little or no activity,
you might want to consider using pglesslog or pg_clearxlogtail.
These can eliminate nearly all the cost of the more frequent logs.
-Kevin