Thread: Mark change-on-restart-only values in postgresql.conf

Mark change-on-restart-only values in postgresql.conf

From
Zdenek Kotala
Date:
I added additional comments marked setting which need server restart to
take effect. I use (!RSR!) tag for it, however if anybody have different
idea, let me know and I will change it.

I removed comments about commenting out behavior too, because patch now
waiting for commit (or reject?).


    Zdenek
Index: backend/utils/misc/postgresql.conf.sample
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/utils/misc/postgresql.conf.sample,v
retrieving revision 1.182
diff -c -r1.182 postgresql.conf.sample
*** backend/utils/misc/postgresql.conf.sample    27 Jun 2006 22:16:44 -0000    1.182
--- backend/utils/misc/postgresql.conf.sample    18 Jul 2006 21:38:30 -0000
***************
*** 11,19 ****
  # allowed values can be found in the PostgreSQL documentation. The
  # commented-out settings shown in this file represent the default values.
  #
- # Please note that re-commenting a setting is NOT sufficient to revert it
- # to the default value, unless you restart the postmaster.
- #
  # Any option can also be given as a command line switch to the
  # postmaster, e.g. 'postmaster -c log_connections=on'. Some options
  # can be changed at run-time with the 'SET' SQL command.
--- 11,16 ----
***************
*** 22,28 ****
  # receives a SIGHUP. If you edit the file on a running system, you have
  # to SIGHUP the postmaster for the changes to take effect, or use
  # "pg_ctl reload". Some settings, such as listen_addresses, require
! # a postmaster shutdown and restart to take effect.


  #---------------------------------------------------------------------------
--- 19,26 ----
  # receives a SIGHUP. If you edit the file on a running system, you have
  # to SIGHUP the postmaster for the changes to take effect, or use
  # "pg_ctl reload". Some settings, such as listen_addresses, require
! # a postmaster shutdown and restart to take effect. This kind of items are
! # marked with (!RSR!) tag.


  #---------------------------------------------------------------------------
***************
*** 31,36 ****
--- 29,35 ----

  # The default values of these variables are driven from the -D command line
  # switch or PGDATA environment variable, represented here as ConfigDir.
+ # All file locations settings change require server restart to tak effect.

  #data_directory = 'ConfigDir'        # use data in another directory
  #hba_file = 'ConfigDir/pg_hba.conf'    # host-based authentication file
***************
*** 45,55 ****
  #---------------------------------------------------------------------------

  # - Connection Settings -

  #listen_addresses = 'localhost'        # what IP address(es) to listen on;
                      # comma-separated list of addresses;
                      # defaults to 'localhost', '*' = all
! #port = 5432
  #max_connections = 100
  # note: increasing max_connections costs ~400 bytes of shared memory per
  # connection slot, plus lock space (see max_locks_per_transaction).  You
--- 44,55 ----
  #---------------------------------------------------------------------------

  # - Connection Settings -
+ # All connection settings change will take effect after server restart.

  #listen_addresses = 'localhost'        # what IP address(es) to listen on;
                      # comma-separated list of addresses;
                      # defaults to 'localhost', '*' = all
! #port = 5432            # (!RSR!)
  #max_connections = 100
  # note: increasing max_connections costs ~400 bytes of shared memory per
  # connection slot, plus lock space (see max_locks_per_transaction).  You
***************
*** 63,73 ****
  # - Security & Authentication -

  #authentication_timeout = 60        # 1-600, in seconds
! #ssl = off
  #password_encryption = on
  #db_user_namespace = off

! # Kerberos
  #krb_server_keyfile = ''
  #krb_srvname = 'postgres'
  #krb_server_hostname = ''        # empty string matches any keytab entry
--- 63,73 ----
  # - Security & Authentication -

  #authentication_timeout = 60        # 1-600, in seconds
! #ssl = off                            # (!RSR!)
  #password_encryption = on
  #db_user_namespace = off

! # Kerberos (changes in kerberos setting require server restart)
  #krb_server_keyfile = ''
  #krb_srvname = 'postgres'
  #krb_server_hostname = ''        # empty string matches any keytab entry
***************
*** 90,98 ****

  # - Memory -

! #shared_buffers = 1000            # min 16 or max_connections*2, 8KB each
  #temp_buffers = 1000            # min 100, 8KB each
! #max_prepared_transactions = 5        # can be 0 or more
  # note: increasing max_prepared_transactions costs ~600 bytes of shared memory
  # per transaction slot, plus lock space (see max_locks_per_transaction).
  #work_mem = 1024            # min 64, size in KB
--- 90,98 ----

  # - Memory -

! #shared_buffers = 1000            # min 16 or max_connections*2, 8KB each (!RSR!)
  #temp_buffers = 1000            # min 100, 8KB each
! #max_prepared_transactions = 5        # can be 0 or more  (!RSR!)
  # note: increasing max_prepared_transactions costs ~600 bytes of shared memory
  # per transaction slot, plus lock space (see max_locks_per_transaction).
  #work_mem = 1024            # min 64, size in KB
***************
*** 101,113 ****

  # - Free Space Map -

! #max_fsm_pages = 20000            # min max_fsm_relations*16, 6 bytes each
! #max_fsm_relations = 1000        # min 100, ~70 bytes each

  # - Kernel Resource Usage -

! #max_files_per_process = 1000        # min 25
! #preload_libraries = ''

  # - Cost-Based Vacuum Delay -

--- 101,113 ----

  # - Free Space Map -

! #max_fsm_pages = 20000            # min max_fsm_relations*16, 6 bytes each (!RSR!)
! #max_fsm_relations = 1000        # min 100, ~70 bytes each (!RSR)

  # - Kernel Resource Usage -

! #max_files_per_process = 1000        # min 25 (!RSR!)
! #preload_libraries = ''                # (!RSR!)

  # - Cost-Based Vacuum Delay -

***************
*** 141,147 ****
                      #   fsync_writethrough
                      #   open_sync
  #full_page_writes = on            # recover from partial page writes
! #wal_buffers = 8            # min 4, 8KB each
  #commit_delay = 0            # range 0-100000, in microseconds
  #commit_siblings = 5            # range 1-1000

--- 141,147 ----
                      #   fsync_writethrough
                      #   open_sync
  #full_page_writes = on            # recover from partial page writes
! #wal_buffers = 8            # min 4, 8KB each (!RSR!)
  #commit_delay = 0            # range 0-100000, in microseconds
  #commit_siblings = 5            # range 1-1000

***************
*** 212,218 ****

  # This is used when logging to stderr:
  #redirect_stderr = off            # Enable capturing of stderr into log
!                     # files

  # These are only used if redirect_stderr is on:
  #log_directory = 'pg_log'        # Directory where log files are written
--- 212,218 ----

  # This is used when logging to stderr:
  #redirect_stderr = off            # Enable capturing of stderr into log
!                     # files (!RSR!)

  # These are only used if redirect_stderr is on:
  #log_directory = 'pg_log'        # Directory where log files are written
***************
*** 284,290 ****
                      # and their durations, in milliseconds.

  #silent_mode = off            # DO NOT USE without syslog or
!                     # redirect_stderr

  # - What to Log -

--- 284,290 ----
                      # and their durations, in milliseconds.

  #silent_mode = off            # DO NOT USE without syslog or
!                     # redirect_stderr (!RSR!)

  # - What to Log -

***************
*** 325,334 ****
  #stats_command_string = on
  #update_process_title = on

! #stats_start_collector = on        # needed for block or row stats
  #stats_block_level = off
  #stats_row_level = off
! #stats_reset_on_server_start = off


  # - Statistics Monitoring -
--- 325,334 ----
  #stats_command_string = on
  #update_process_title = on

! #stats_start_collector = on        # needed for block or row stats (!RSR!)
  #stats_block_level = off
  #stats_row_level = off
! #stats_reset_on_server_start = off    # (!RSR!)


  # - Statistics Monitoring -
***************
*** 403,409 ****
  #---------------------------------------------------------------------------

  #deadlock_timeout = 1000        # in milliseconds
! #max_locks_per_transaction = 64        # min 10
  # note: each lock table slot uses ~270 bytes of shared memory, and there are
  # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  # lock table slots.
--- 403,409 ----
  #---------------------------------------------------------------------------

  #deadlock_timeout = 1000        # in milliseconds
! #max_locks_per_transaction = 64        # min 10 (!RSR!)
  # note: each lock table slot uses ~270 bytes of shared memory, and there are
  # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  # lock table slots.

Re: Mark change-on-restart-only values in postgresql.conf

From
Robert Treat
Date:
On Tuesday 18 July 2006 17:44, Zdenek Kotala wrote:
> I added additional comments marked setting which need server restart to
> take effect. I use (!RSR!) tag for it, however if anybody have different
> idea, let me know and I will change it.
>

Out of curisoity, does the !RSR! actually have some meaning?  !RRS (requires
restart) or !RR or !RS (restart) all seem more straightforward.

More importantly, I think you need to mark all of the variables with the
special tag individually, as opposed to where, like in the kerberos settings,
you just say "all kerberose settings require restart".  This is mainly
because...

> I removed comments about commenting out behavior too, because patch now
> waiting for commit (or reject?).

I know some setups remove all commented options from the postgresql.conf, so
that only modified parameters are left inside the postgresql.conf. If they
want to change a setting, they add it into the conf.  I think the theory is
that this is either more secure, since it would require more knowledge to
modify the postgres settings this way, or it is a nod to making
postgresql.conf more portable accross versions (by keeping a smaller subset
of changes its more likely they will work across versions) or in an effort to
make the postgresql.conf simpler (by removing a lot of variables that will
never be modified)... in any case it is a valid setup in 8.1, unfortunatly I
haven't had time to test your patch with CVS, but do you know if it can
support those types of configurations?

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

Re: Mark change-on-restart-only values in postgresql.conf

From
"Jaime Casanova"
Date:
>
> I removed comments about commenting out behavior too, because patch now
> waiting for commit (or reject?).
>
>
>         Zdenek
>

not a big deal but, i think, you should remove this in the patch that
implements that behavior rather than in a newer one that still must be
discussed.

BTW, you have a typo in this line

+ # All file locations settings change require server restart to tak effect.

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

Re: Mark change-on-restart-only values in postgresql.conf

From
Peter Eisentraut
Date:
Am Dienstag, 18. Juli 2006 23:44 schrieb Zdenek Kotala:
> I added additional comments marked setting which need server restart to
> take effect. I use (!RSR!) tag for it, however if anybody have different
> idea, let me know and I will change it.

It seems that people didn't like introducing secret codes into the
configuration file, so I adapted your patch and changed the marker
to "(change requires restart)".

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Mark change-on-restart-only values in postgresql.conf

From
Zdenek Kotala
Date:
Peter Eisentraut wrote:
> Am Dienstag, 18. Juli 2006 23:44 schrieb Zdenek Kotala:
>> I added additional comments marked setting which need server restart to
>> take effect. I use (!RSR!) tag for it, however if anybody have different
>> idea, let me know and I will change it.
>
> It seems that people didn't like introducing secret codes into the
> configuration file, so I adapted your patch and changed the marker
> to "(change requires restart)".
>

OK, I going to change. Is there any limit to char per line?

    Zdenek


Re: Mark change-on-restart-only values in postgresql.conf

From
Peter Eisentraut
Date:
Am Montag, 24. Juli 2006 12:25 schrieb Zdenek Kotala:
> OK, I going to change. Is there any limit to char per line?

It's already committed.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Mark change-on-restart-only values in postgresql.conf

From
Zdenek Kotala
Date:
Peter Eisentraut wrote:
> Am Montag, 24. Juli 2006 12:25 schrieb Zdenek Kotala:
>> OK, I going to change. Is there any limit to char per line?
>
> It's already committed.
>

Oh, excellent. Thanks