Performance improvement of WAL writing?

From: "Moon, Insung" <tsukiwamoon(dot)pgsql(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Performance improvement of WAL writing?
Date: 2019-08-28 06:43:02
Message-ID: CAEMmqBvQ56-CvUy2kyJp0JJnFE9EAm4t0aGnSfiH+z4=Hw_6DQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Hackers.

Currently, the XLogWrite function is written in 8k(or 16kb) units
regardless of the size of the new record.
For example, even if a new record is only 300 bytes, pg_pwrite is
called to write data in 8k units (if it cannot be writing on one page
is 16kb written).
Let's look at the worst case.
1) LogwrtResult.Flush is 8100 pos.
2) And the new record size is only 100 bytes.
In this case, pg_pwrite is called which writes 16 kb to update only 100 bytes.
It is a rare case, but I think there is overhead for pg_pwrite for some systems.
# For systems that often update one record in one transaction.

So what about modifying the XLogWrite function only to write the size
that should record?
Can this idea benefit from WAL writing performance?
If it's OK to improve, I want to do modification.
How do you think of it?

Best Regards.
Moon.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message movead.li@highgo.ca 2019-08-28 06:48:39 Re: Re: Email to hackers for test coverage
Previous Message Kyotaro Horiguchi 2019-08-28 06:42:10 Re: [HACKERS] WAL logging problem in 9.4.3?