I appreciate everyone's feedback and help but we seem to be dancing around the actual question.
What I want to know is if there are other events that would contribute to a WALWriteLock (eg writing to a data file or the postgresql.log file) or is it 100% writing to the WAL file. So when we see a sustained spike in WALWriteLock wait events, we know where to focus our investigation efforts. The effort itself into the WAL writes is a separate issue. First I want to know if there is any other process/place that we also need to account for.
On Fri, 2021-04-30 at 00:13 +0530, Vijaykumar Jain wrote: > I tried the below, but i could not simulate WALWriteLock waits. > > create table foo(id int) > > for i in {1..10}; do psql -c "begin transaction; insert into foo select 1 from generate_series(1, 1000); commit;" & done
Perhaps you should do simple inserts of one row and run that script with a pgbench and lots of clients.