I have configured archive_timeout = 5 (i.e. 5 seconds) for a PostgreSQL 9.6 database in order to conduct tests around point-in-time recovery. My archive_command invokes cp into a local archive directory.
If I check the file modification dates in that local archive directory I see that WAL files are typically created in there only approx. every 20 seconds apart, i.e. far more than the configured 5 seconds. This is for PostgreSQL 9.6 running inside a Docker container on a lightly loaded system.
What could explain this large discrepancy?