Giter Site home page Giter Site logo

Generate ALTER SYSTEM commands about pgtune HOT 5 CLOSED

le0pard avatar le0pard commented on May 18, 2024
Generate ALTER SYSTEM commands

from pgtune.

Comments (5)

le0pard avatar le0pard commented on May 18, 2024 2

Released new version with "ALTER SYSTEM" commands

from pgtune.

le0pard avatar le0pard commented on May 18, 2024 1

@josuamarcelc let's read for example shared_buffers setting from official doc

https://www.postgresql.org/docs/14/runtime-config-resource.html

This parameter can only be set at server start.

Same for max_worker_processes

This parameter can only be set at server start

And many other params.

So your proposal will not work.

from pgtune.

le0pard avatar le0pard commented on May 18, 2024

@edvinv not sure, what the benefit from this - user can "convert" any pgtune output to this command and pgtune output works for postgresql < 9.4. Because many of this configuration apply after the next server restart:

$ vim postgresql.cof
$ services restart postgresql

is much shorter, than

$ psql
psql# ALTER SYSTEM SET ...;
psql# ALTER SYSTEM SET ...;
psql# \q
$ services restart postgresql

But maybe I don't see bigger picture.

from pgtune.

edvinv avatar edvinv commented on May 18, 2024

@le0pard hi I completely agree with you that you can easy convert pgtune output to ALTER SYSTEM commands with any editor or simple script. I just think that for version >=9.4 ALTER SYSTEM is the way to go and it will be convenient to have both outputs. For me (again personal choice) ALTER SYSTEM is much better because I keep postgresql.conf untouched and I can easy see all changes in postgresql.auto.conf. Of course, current pgtune output should remain as it is.

from pgtune.

josuamarcelc avatar josuamarcelc commented on May 18, 2024

Hi, thx for great tool.

After postgresql 9.4 you can use ALTER SYSTEM SET to change individual options. IMO it will be good that those statements are also generated. This way you can very easy change configuration.

So that you get something like this:

ALTER SYSTEM SET max_connections = '16';
ALTER SYSTEM SET shared_buffers = '4GB';
ALTER SYSTEM SET effective_cache_size = '12GB';
ALTER SYSTEM SET work_mem = '256MB';
ALTER SYSTEM SET maintenance_work_mem = '1GB';
ALTER SYSTEM SET min_wal_size = '1GB';
ALTER SYSTEM SET max_wal_size = '2GB';
ALTER SYSTEM SET checkpoint_completion_target = '0.7';
ALTER SYSTEM SET wal_buffers = '16MB';
ALTER SYSTEM SET default_statistics_target = '100';

br

you don't need to restart the POSTGRESQL, you only need to run this query after ALTER SYSTEM,

select pg_reload_conf()

from pgtune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.