Re: increasing the default WAL segment size
Beena Emerson <memissemerson@gmail.com>
Hello all, On Mon, Dec 19, 2016 at 3:14 PM, Beena Emerson <memissemerson@gmail.com> wrote: > Hello all, > > Please find attached a patch to make wal segment size initdb configurable. > > The attached patch removes --with-wal-segsize configure option and adds a > new initdb option --wal-segsize. The module initdb passes the wal-segsize > value into an environment variable which is used to overwrite the guc value > wal_ segment_size and set the internal variables : XLogSegSize and > XLOG_SEG_SIZE (xlog_internal.h). The default wal_segment_size is not > changed but I have increased the maximum size to 1GB. > > Since XLOG_SEG_SIZE is now variable, it could not be used directly in > src/bin modules and few macros and few changes had to be made: > - in guc.c , remove GUC_UNIT_XSEGS which used XLOG_SEG_SIZE and > introduce show functions for the guc which used the unit (min_wal_size and > max_wal_size). > - For pg_basebackup, add new replication command SHOW_WAL_SEGSZ to > fetch the wal_segment_size in bytes. > - pg_controldata, pg_resetxlog, pg_rewind, fetch the xlog_seg_size from > the ControlFile. > - Since pg_xlogdump reads the wal files, it uses the file size to > determine the xlog_seg_size. > - In pg_test_fsync, a buffer of size XLOG_SEG_SIZE was created, filled > with random data and written to a temporary file to check for any > write/fsync error before performing the tests. Since it does not affect the > actual performance results, the XLOG_SEG_SIZE in the module is replaced > with the default value (16MB). > > Please note that the documents are not updated in this patch. > > Feedback and suggestions are welcome. > This patch has been added to the commit fest (https://commitfest. postgresql.org/12/921/) After further testing, I found that pg_standby contrib module does not work with the changes. I will fix it in the next version of the patch. Comments on the current patch are welcome. Thank you, Beena Emerson Have a Great Day!
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Make WAL segment size configurable at initdb time.
- fc49e24fa69a 11.0 landed
-
Perform only one ReadControlFile() during startup.
- 8356753c212a 11.0 landed
-
Introduce BYTES unit for GUCs.
- 6e7baa322773 11.0 landed
-
Remove useless duplicate inclusions of system header files.
- 9e3755ecb2d0 10.0 cited
-
Refactor other replication commands to use DestRemoteSimple.
- bbd8550bce14 10.0 landed
-
Add a SHOW command to the replication command language.
- d1ecd539477f 10.0 landed
-
Add a new DestReceiver for printing tuples without catalog access.
- a84069d93504 10.0 landed
-
Support fls().
- 4f658dc851a7 9.2.0 cited
-
Extend yesterday's patch making BLCKSZ and RELSEG_SIZE configurable to also
- cf9f6c8d8e9d 8.4.0 cited
-
Commit the reasonably uncontroversial parts of J.R. Nield's PITR patch, to
- c3c09be34b6b 8.0.0 cited
-
XLOG (also known as WAL -:)) Bootstrap/Startup/Shutdown.
- 47937403676d 7.1.1 cited
-
Transaction log manager core code.
- 30659d43eb73 7.1.1 cited