├── tests ├── __init__.py ├── workload.sql └── db_objs.sql ├── pg_configurator ├── __init__.py ├── version.py ├── __main__.py ├── conf_profiles │ ├── __init__.py │ ├── ext_perf.py │ ├── profile_1c.py │ ├── profile_platform_common.py │ └── profile_platform_perf.py ├── pg_settings_history │ ├── README.md │ ├── settings_pg_9_6.csv │ ├── settings_pg_10.csv │ ├── settings_pg_11.csv │ ├── settings_pg_12.csv │ ├── settings_pg_13.csv │ ├── settings_pg_14.csv │ ├── settings_pg_15.csv │ ├── settings_pg_16.csv │ └── settings_pg_17.csv ├── common.py ├── conf_common.py ├── conf_perf.py └── configurator.py ├── requirements.txt ├── .gitignore ├── LICENSE ├── setup.py └── README.md /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pg_configurator/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asyncpg==0.26.0 2 | psutil 3 | -------------------------------------------------------------------------------- /pg_configurator/version.py: -------------------------------------------------------------------------------- 1 | """pg_configurator version information.""" 2 | 3 | __version__ = "25.6.16" 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .pytest_cache/ 2 | build/ 3 | dist/ 4 | *.egg-info/ 5 | output/ 6 | log/ 7 | __pycache__/ 8 | venv/ 9 | .idea/* 10 | *.tar 11 | *.tar.gz 12 | .venv/* 13 | -------------------------------------------------------------------------------- /pg_configurator/__main__.py: -------------------------------------------------------------------------------- 1 | from pg_configurator.configurator import run_pgc 2 | 3 | 4 | def _cli_entrypoint() -> None: 5 | run_pgc() 6 | 7 | 8 | if __name__ == "__main__": 9 | _cli_entrypoint() 10 | -------------------------------------------------------------------------------- /pg_configurator/conf_profiles/__init__.py: -------------------------------------------------------------------------------- 1 | from pg_configurator.conf_profiles.profile_1c import alg_set_1c 2 | from pg_configurator.conf_profiles.ext_perf import ext_alg_set 3 | from pg_configurator.conf_profiles.profile_platform_common import platform_common_alg_set 4 | from pg_configurator.conf_profiles.profile_platform_perf import platform_perf_alg_set 5 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/README.md: -------------------------------------------------------------------------------- 1 | # How to export settings for specific PostgreSQL version 2 | 3 | ``` 4 | docker pull postgres:10 5 | docker run --name pg_10 -v /tmp:/tmp -e POSTGRES_PASSWORD=mysecretpassword -d postgres:10 6 | docker exec -it pg_10 bash 7 | 8 | su - postgres 9 | psql -c "COPY 10 | ( 11 | SELECT 12 | name, 13 | setting AS value, 14 | ( 15 | CASE 16 | WHEN unit = '8kB' THEN 17 | pg_size_pretty(setting::bigint * 1024 * 8) 18 | WHEN unit = 'kB' AND setting <> '-1' THEN 19 | pg_size_pretty(setting::bigint * 1024) 20 | ELSE '' 21 | END 22 | ) AS pretty_value, 23 | boot_val, 24 | unit 25 | FROM pg_settings 26 | ORDER BY name ASC 27 | ) 28 | TO '/tmp/settings_pg10.csv' DELIMITER ',' CSV HEADER;" 29 | 30 | exit 31 | docker stop pg_10 32 | docker rm -f pg_10 33 | ``` -------------------------------------------------------------------------------- /tests/workload.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO s_items (order_items_1_id, cnt, amount, order_items_2_id) 2 | select 3 | floor(random() * 1500)::integer as order_items_1_id, 4 | floor(random() * 20000)::integer as cnt, 5 | floor(random() * 500)::integer as amount, 6 | generate_series(0,10) as order_items_2_id; 7 | 8 | UPDATE s_items SET descr = 'updated at ' || now(), amount = amount + 1 9 | WHERE order_items_1_id in ( 10 | SELECT T.order_items_1_id from( 11 | SELECT floor(random() * 1500)::integer as order_items_1_id, generate_series(1,10) 12 | ) T 13 | ); 14 | 15 | DELETE FROM s_items 16 | WHERE order_items_1_id in ( 17 | SELECT T.order_items_1_id from( 18 | SELECT floor(random() * 1500)::integer as order_items_1_id, generate_series(1,5) 19 | ) T 20 | ); 21 | 22 | \set v1 random(1300, 1350) 23 | \set v2 random(1450, 1500) 24 | 25 | select order_items_1_id, order_items_2_id, max(amount) as max_amount 26 | from s_items t1 27 | join order_items_1 oi1 on t1.order_items_1_id = oi1.id 28 | join order_items_2 oi2 on t1.order_items_2_id = oi2.id 29 | where cnt > :v1 and cnt < :v2 30 | group by order_items_1_id, order_items_2_id; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022-2023, Tantor Labs 4 | Copyright (c) 2018-2023 Oleg Gurov 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from pg_configurator.version import __version__ as version 2 | from setuptools import find_namespace_packages, setup 3 | 4 | name = 'pg_configurator' 5 | install_requires = [ 6 | 'psutil', 7 | ] 8 | 9 | 10 | if __name__ == "__main__": 11 | setup(name=name, 12 | version=version, 13 | description='PostgreSQL configuration tool', 14 | classifiers=[ 15 | 'Intended Audience :: Developers', 16 | 'Intended Audience :: System Administrators', 17 | 'Programming Language :: Python', 18 | 'Programming Language :: Python :: 3', 19 | 'Topic :: Database', 20 | ], 21 | author='Oleg Gurov', 22 | url='https://github.com/TantorLabs/pg_configurator', 23 | license='MIT', 24 | keywords='postgresql configuration', 25 | python_requires='>=3.4', 26 | packages=find_namespace_packages(exclude=['tests*']), 27 | package_data={name: ['pg_settings_history/*']}, 28 | include_package_data=True, 29 | install_requires=install_requires, 30 | entry_points={ 31 | 'console_scripts': [ 32 | 'pg_configurator = pg_configurator.__main__:_cli_entrypoint', 33 | ], 34 | }, 35 | ) 36 | -------------------------------------------------------------------------------- /tests/db_objs.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS public.order_items_1 CASCADE; 2 | DROP TABLE IF EXISTS public.order_items_2 CASCADE; 3 | DROP TABLE IF EXISTS public.s_items CASCADE; 4 | 5 | CREATE TABLE public.order_items_1 6 | ( 7 | id serial, 8 | name character varying(32), 9 | CONSTRAINT order_items_1_pkey UNIQUE (id) 10 | ); 11 | 12 | CREATE TABLE public.order_items_2 13 | ( 14 | id serial, 15 | name character varying(32), 16 | CONSTRAINT order_items_2_pkey UNIQUE (id) 17 | ); 18 | 19 | CREATE TABLE public.s_items ( 20 | id serial, 21 | order_items_1_id integer NOT NULL, 22 | order_items_2_id integer NOT NULL, 23 | amount numeric(16,4) DEFAULT 0 NOT NULL, 24 | cnt smallint DEFAULT 0 NOT NULL, 25 | descr text, 26 | CONSTRAINT stock_items_pk UNIQUE (id) 27 | ); 28 | 29 | -- prepare data 30 | INSERT INTO order_items_1 (id) SELECT generate_series(0,1500) as order_items_1_id; 31 | 32 | INSERT INTO order_items_2 (id) SELECT generate_series(0,1500) as order_items_2_id; 33 | 34 | INSERT INTO s_items (order_items_1_id, cnt, amount, order_items_2_id) 35 | select 36 | floor(random() * 1500)::integer as order_items_1_id, 37 | floor(random() * 20000)::integer as cnt, 38 | floor(random() * 500)::integer as amount, 39 | generate_series(0,1500) as order_items_2_id; 40 | 41 | CREATE INDEX ON public.s_items USING hash (descr); 42 | 43 | CREATE INDEX stock_items_idx01 ON public.s_items USING btree (order_items_2_id); 44 | CREATE INDEX stock_items_idx02 ON public.s_items USING btree (order_items_1_id); 45 | 46 | ALTER TABLE ONLY public.s_items 47 | ADD CONSTRAINT stock_items_fk01 FOREIGN KEY (order_items_1_id) REFERENCES public.order_items_1(id); 48 | ALTER TABLE ONLY public.s_items 49 | ADD CONSTRAINT stock_items_fk02 FOREIGN KEY (order_items_2_id) REFERENCES public.order_items_2(id); -------------------------------------------------------------------------------- /pg_configurator/common.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import inspect 3 | import traceback 4 | from pkg_resources import parse_version as version 5 | import re 6 | from enum import Enum 7 | 8 | 9 | class BasicEnum: 10 | def __str__(self): 11 | return self.value 12 | 13 | 14 | class ResultCode(BasicEnum, Enum): 15 | DONE = 'done' 16 | FAIL = 'fail' 17 | UNKNOWN = 'unknown' 18 | 19 | 20 | class PGConfiguratorResult: 21 | params = None # JSON 22 | result_code = ResultCode.UNKNOWN 23 | result_data = None 24 | 25 | 26 | def exception_helper(show_traceback=True): 27 | exc_type, exc_value, exc_traceback = sys.exc_info() 28 | return "\n".join( 29 | [ 30 | v for v in traceback.format_exception(exc_type, exc_value, exc_traceback if show_traceback else None) 31 | ] 32 | ) 33 | 34 | 35 | def exception_handler(func): 36 | def f(*args, **kwargs): 37 | try: 38 | func(*args, **kwargs) 39 | except: 40 | print(exception_helper(show_traceback=True)) 41 | return f 42 | 43 | 44 | def get_default_args(func): 45 | signature = inspect.signature(func) 46 | return { 47 | k: v.default 48 | for k, v in signature.parameters.items() 49 | if v.default is not inspect.Parameter.empty 50 | } 51 | 52 | 53 | def get_major_version(str_version): 54 | return version(re.findall(r"(\d+)", str_version)[0]) 55 | 56 | 57 | def print_header(header): 58 | print("\n\n") 59 | print("=".join(['=' * 100])) 60 | print(header) 61 | print("=".join(['=' * 100])) 62 | 63 | 64 | def recordset_to_list_flat(rs): 65 | res = [] 66 | for rec in rs: 67 | row = [] 68 | for _, v in dict(rec).items(): 69 | row.append(v) 70 | res.append(row) 71 | return res 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Preparing Development Environment 2 | Use the following instructions to quickly bring up a simple development environment on Debian-based distributions: 3 | ```bash 4 | apt-get -y install git python3-setuptools python3-venv 5 | git clone https://github.com/TantorLabs/pg_configurator.git && cd pg_configurator 6 | python3 -m venv .venv 7 | source .venv/bin/activate 8 | pip3 install -r requirements.txt 9 | ``` 10 | 11 | For testing it is necessary to additionally install Docker 12 | ```bash 13 | apt-get update 14 | apt-get -y install apt-transport-https ca-certificates curl software-properties-common 15 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 16 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list 17 | apt-get update 18 | apt-get -y install docker-ce docker-ce-cli containerd.io 19 | systemctl start docker 20 | ``` 21 | 22 | and PostgreSQL client package 23 | ```bash 24 | apt-get -y remove postgresql\* 25 | install -d /usr/share/postgresql-common/pgdg 26 | curl -fo /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc 27 | echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list 28 | apt-get update 29 | apt-get -y install postgresql-client-15 30 | ``` 31 | 32 | # Packaging the Project 33 | To create a source distribution run: 34 | ```bash 35 | python3 setup.py sdist 36 | ``` 37 | This will generate an archive in the *dist* directory, so you can then upload it to a private PyPI repository if you need. 38 | 39 | # Installing the Package 40 | Use `pip` utility to install the package: 41 | ```bash 42 | pip3 install dist/pg_configurator-22.10.17.tar.gz 43 | ``` 44 | 45 | # Usage 46 | `pip` with create an entrypoint script during the installation, so you should be able to start by simply issuing `pg_configurtor` command from your shell: 47 | ```bash 48 | # Show help 49 | pg_configurator -h 50 | 51 | # Minimal usage 52 | pg_configurator \ 53 | --db-cpu=40 \ 54 | --db-ram=128Gi \ 55 | --db-disk-type=SSD \ 56 | --db-duty=mixed \ 57 | --pg-version=9.6 58 | 59 | # Customized usage 60 | pg_configurator \ 61 | --db-cpu=40 \ 62 | --db-ram=128Gi \ 63 | --db-disk-type=SSD \ 64 | --db-duty=mixed \ 65 | --replication-enabled=True \ 66 | --pg-version=9.6 \ 67 | --min-conns=200 \ 68 | --max-conns=500 \ 69 | --shared-buffers-part=0.3 \ 70 | --client-mem-part=0.6 \ 71 | --maintenance-mem-part=0.1 72 | ``` 73 | -------------------------------------------------------------------------------- /pg_configurator/conf_profiles/ext_perf.py: -------------------------------------------------------------------------------- 1 | ext_alg_set = { 2 | "9.6": [ 3 | # ---------------------------------------------------------------------------------- 4 | # Autovacuum 5 | { 6 | "name": "autovacuum_vacuum_scale_factor", 7 | "alg": "round(float(calc_system_scores_scale(0.001, 0.2)),4)", 8 | "to_unit": "as_is" 9 | }, 10 | { 11 | "name": "autovacuum_analyze_scale_factor", 12 | "alg": "round(float(calc_system_scores_scale(0.0007, 0.1)),4)", 13 | "to_unit": "as_is" 14 | }, 15 | { 16 | "name": "autovacuum_vacuum_cost_limit", 17 | "alg": "int(calc_system_scores_scale(2000, 8000))", 18 | "unit": "as_is" 19 | }, 20 | { 21 | "name": "vacuum_cost_limit", 22 | "const": "8000" 23 | }, 24 | { 25 | "name": "autovacuum_freeze_max_age", 26 | "const": "500000000" 27 | }, 28 | { 29 | "name": "autovacuum_multixact_freeze_max_age", 30 | "const": "800000000" 31 | }, 32 | # ---------------------------------------------------------------------------------- 33 | # Write Ahead Log 34 | { 35 | "name": "wal_keep_segments", 36 | "alg": "int(calc_system_scores_scale(128, 1024)) if replication_enabled else 0" 37 | }, 38 | # ---------------------------------------------------------------------------------- 39 | # Background Writer 40 | { 41 | "name": "bgwriter_delay", 42 | "alg": "int(calc_system_scores_scale(50, 200))", # delay between activity rounds 43 | "unit_postfix": "ms" 44 | }, 45 | { 46 | "name": "bgwriter_lru_maxpages", 47 | "alg": "int(calc_system_scores_scale(500, 1000))", 48 | "to_unit": "as_is" # 4-8MB per each round 49 | }, 50 | { 51 | "name": "bgwriter_lru_multiplier", # some cushion against spikes in demand 52 | "const": "7.0" 53 | }, 54 | { 55 | "name": "random_page_cost", 56 | "alg": """\ 57 | '4' if disk_type == DiskType.SATA else \ 58 | '2.5' if disk_type == DiskType.SAS else \ 59 | '1.1'\ 60 | """, 61 | "to_unit": "as_is" 62 | }, 63 | # ---------------------------------------------------------------------------------- 64 | # Asynchronous Behavior 65 | { 66 | "name": "max_parallel_workers_per_gather", 67 | "alg": """\ 68 | calc_cpu_scale(2, 4) if duty_db == DutyDB.FINANCIAL else \ 69 | calc_cpu_scale(2, 8) if duty_db == DutyDB.MIXED else \ 70 | calc_cpu_scale(2, 16)""" 71 | }, 72 | { 73 | "name": "stats_temp_directory", 74 | "alg": "deprecated" 75 | } 76 | ], 77 | "10": [ 78 | { 79 | "__parent": "9.6" 80 | }, 81 | { 82 | "name": "max_parallel_workers", 83 | "alg": """\ 84 | calc_cpu_scale(4, 12) if duty_db == DutyDB.FINANCIAL else \ 85 | calc_cpu_scale(4, 24) if duty_db == DutyDB.MIXED else \ 86 | calc_cpu_scale(4, 32)\ 87 | """ 88 | } 89 | ], 90 | "11": [ 91 | { 92 | "__parent": "10" 93 | } 94 | ], 95 | "12": [ 96 | { 97 | "__parent": "11" 98 | } 99 | ], 100 | "13": [ 101 | { 102 | "__parent": "12" 103 | } 104 | ], 105 | "14": [ 106 | { 107 | "__parent": "13" 108 | } 109 | ], 110 | "15": [ 111 | { 112 | "__parent": "14" 113 | } 114 | ], 115 | "16": [ 116 | { 117 | "__parent": "15" 118 | } 119 | ], 120 | "17": [ 121 | { 122 | "__parent": "16" 123 | } 124 | ], 125 | } 126 | -------------------------------------------------------------------------------- /pg_configurator/conf_common.py: -------------------------------------------------------------------------------- 1 | common_alg_set = { 2 | "9.6": [ 3 | # ---------------------------------------------------------------------------------- 4 | # Extensions 5 | { 6 | "name": "shared_preload_libraries", 7 | "const": "'pg_stat_statements,auto_explain'" 8 | }, 9 | { 10 | "name": "auto_explain.log_min_duration", 11 | "const": "'3s'" 12 | }, 13 | { 14 | "name": "auto_explain.log_analyze", 15 | "const": "true" 16 | }, 17 | { 18 | "name": "auto_explain.log_verbose", 19 | "const": "true" 20 | }, 21 | { 22 | "name": "auto_explain.log_buffers", 23 | "const": "true" 24 | }, 25 | { 26 | "name": "auto_explain.log_format", 27 | "const": "text" 28 | }, 29 | { 30 | "name": "pg_stat_statements.max", 31 | "const": "1000" 32 | }, 33 | { 34 | "name": "pg_stat_statements.track", 35 | "const": "all" 36 | }, 37 | # ---------------------------------------------------------------------------------- 38 | # Logging 39 | { 40 | "name": "logging_collector", 41 | "const": "on" 42 | }, 43 | { 44 | "name": "log_destination", 45 | "const": "'csvlog'" 46 | }, 47 | { 48 | "name": "log_directory", 49 | "const": "'pg_log'" 50 | }, 51 | { 52 | "name": "log_filename", 53 | "const": "'postgresql-%Y-%m-%d_%H%M%S.log'" 54 | }, 55 | { 56 | "name": "log_truncate_on_rotation", 57 | "const": "on" 58 | }, 59 | { 60 | "name": "log_rotation_age", 61 | "const": "1d" 62 | }, 63 | { 64 | "name": "log_rotation_size", 65 | "const": "100MB" 66 | }, 67 | { 68 | "name": "log_min_messages", 69 | "const": "warning" 70 | }, 71 | { 72 | "name": "log_min_error_statement", 73 | "const": "error" 74 | }, 75 | { 76 | "name": "log_min_duration_statement", 77 | "const": "3000" 78 | }, 79 | { 80 | "name": "log_duration", 81 | "const": "off" 82 | }, 83 | { 84 | "name": "log_lock_waits", 85 | "const": "on" 86 | }, 87 | { 88 | "name": "log_statement", 89 | "const": "'ddl'" 90 | }, 91 | { 92 | "name": "log_temp_files", 93 | "const": "0" 94 | }, 95 | { 96 | "name": "log_checkpoints", 97 | "const": "on" 98 | }, 99 | { 100 | "name": "log_autovacuum_min_duration", 101 | "const": "1s" 102 | }, 103 | # ---------------------------------------------------------------------------------- 104 | # Statistic collection 105 | { 106 | "name": "track_activities", 107 | "const": "on" 108 | }, 109 | { 110 | "name": "track_counts", 111 | "const": "on" 112 | }, 113 | { 114 | "name": "track_io_timing", 115 | "const": "on" 116 | }, 117 | { 118 | "name": "track_functions", 119 | "const": "pl" 120 | }, 121 | { 122 | "name": "track_activity_query_size", 123 | "const": "2048" 124 | } 125 | ], 126 | "10": [ 127 | { 128 | "__parent": "9.6" 129 | } 130 | ], 131 | "11": [ 132 | { 133 | "__parent": "10" 134 | } 135 | ], 136 | "12": [ 137 | { 138 | "__parent": "11" 139 | } 140 | ], 141 | "13": [ 142 | { 143 | "__parent": "12" 144 | } 145 | ], 146 | "14": [ 147 | { 148 | "__parent": "13" 149 | } 150 | ], 151 | "15": [ 152 | { 153 | "__parent": "14" 154 | } 155 | ], 156 | "16": [ 157 | { 158 | "__parent": "15" 159 | } 160 | ], 161 | "17": [ 162 | { 163 | "__parent": "16" 164 | } 165 | ], 166 | } 167 | -------------------------------------------------------------------------------- /pg_configurator/conf_profiles/profile_1c.py: -------------------------------------------------------------------------------- 1 | alg_set_1c = { 2 | "9.6": [ 3 | { 4 | "name": "shared_preload_libraries", 5 | "const": "'pg_stat_statements,pg_store_plans,auto_explain,plantuner,online_analyze'", 6 | "to_unit": "as_is" 7 | }, 8 | { 9 | "name": "autovacuum_naptime", 10 | "const": "20s" 11 | }, 12 | { 13 | "name": "autovacuum_vacuum_cost_delay", 14 | "const": "2ms" 15 | }, 16 | { 17 | "name": "auto_explain.log_min_duration", 18 | "const": "5s" 19 | }, 20 | { 21 | "name": "from_collapse_limit", 22 | "const": "20" 23 | }, 24 | { 25 | "name": "join_collapse_limit", 26 | "const": "20" 27 | }, 28 | # ---------------------------------------------------------------------------------- 29 | # Version and platform compatibility 30 | # ---------------------------------------------------------------------------------- 31 | { 32 | "name": "escape_string_warning", 33 | "const": "off" 34 | }, 35 | { 36 | "name": "standard_conforming_strings", 37 | "const": "off" 38 | }, 39 | # ---------------------------------------------------------------------------------- 40 | # Resource Consumption 41 | { 42 | "name": "max_connections", 43 | "alg": "1000" 44 | }, 45 | { 46 | "name": "max_files_per_process", 47 | "alg": "int(calc_cpu_scale(2000, 30000))", 48 | "to_unit": "as_is" 49 | }, 50 | { 51 | "name": "temp_buffers", 52 | "alg": "max(((total_ram_in_bytes * client_mem_part) / max_connections) * 0.5, 1024 * 1000)" 53 | # where: if 1C then temp_buffers per session 50% of work_mem 54 | }, 55 | # ---------------------------------------------------------------------------------- 56 | # Write Ahead Log 57 | { 58 | "name": "wal_level", 59 | "const": "replica" 60 | }, 61 | { 62 | "name": "full_page_writes", 63 | "const": "on" 64 | }, 65 | # ---------------------------------------------------------------------------------- 66 | # Replication 67 | # Primary 68 | { 69 | "name": "max_wal_senders", 70 | "alg": """\ 71 | 2 if replication_enabled else \ 72 | 0""", 73 | "to_unit": "as_is" 74 | }, 75 | # ---------------------------------------------------------------------------------- 76 | # Checkpointer 77 | { 78 | "name": "checkpoint_timeout", 79 | "const": "15min" 80 | }, 81 | { 82 | "name": "commit_delay", # microseconds 83 | "alg": "int(calc_system_scores_scale(500, 3000))", 84 | "to_unit": "as_is" 85 | }, 86 | # ---------------------------------------------------------------------------------- 87 | # Background Writer 88 | { 89 | "name": "bgwriter_lru_multiplier", # some cushion against spikes in demand 90 | "const": "4" 91 | }, 92 | # ---------------------------------------------------------------------------------- 93 | # Query Planning 94 | { 95 | "name": "cpu_operator_cost", 96 | "const": "0.001" 97 | }, 98 | { 99 | "name": "default_statistics_target", 100 | "const": "100" 101 | }, 102 | # ---------------------------------------------------------------------------------- 103 | # Asynchronous Behavior 104 | { 105 | "name": "max_parallel_workers_per_gather", 106 | "const": "0" 107 | }, 108 | 109 | # The online_analyze module provides a set of features that immediately 110 | # update statistics after INSERT, UPDATE, DELETE, or SELECT INTO operations for the affected tables. 111 | { 112 | "name": "online_analyze.enable", 113 | "const": "off" 114 | }, 115 | { 116 | "name": "online_analyze.verbose", 117 | "const": "off" 118 | }, 119 | { 120 | "name": "online_analyze.scale_factor", 121 | "const": "0.1" 122 | }, 123 | { 124 | "name": "online_analyze.threshold", 125 | "const": "500" 126 | }, 127 | { 128 | "name": "online_analyze.local_tracking", 129 | "const": "on" 130 | }, 131 | { 132 | "name": "online_analyze.min_interval", 133 | "const": "10000" 134 | }, 135 | { 136 | "name": "online_analyze.table_type", 137 | "const": "temporary" 138 | }, 139 | # Store execution plans like pg_stat_statements does for queries. 140 | { 141 | "name": "pg_store_plans.max", 142 | "const": "15000", 143 | }, 144 | { 145 | "name": "pg_store_plans.track", 146 | "const": "top" 147 | }, 148 | { 149 | "name": "pg_store_plans.max_plan_length", 150 | "const": "15000", 151 | }, 152 | { 153 | "name": "pg_store_plans.plan_format", 154 | "const": "raw" 155 | }, 156 | { 157 | "name": "pg_store_plans.min_duration", 158 | "const": "3000", 159 | }, 160 | { 161 | "name": "pg_store_plans.log_analyze", 162 | "const": "on" 163 | }, 164 | { 165 | "name": "pg_store_plans.log_buffers", 166 | "const": "on" 167 | }, 168 | # plantuner is a contribution module for PostgreSQL, which enable planner hints. 169 | { 170 | "name": "plantuner.fix_empty_table", 171 | "const": "on" 172 | }, 173 | # ---------------------------------------------------------------------------------- 174 | # Connection and authentication 175 | # ---------------------------------------------------------------------------------- 176 | { 177 | "name": "row_security", 178 | "const": "off" 179 | }, 180 | { 181 | "name": "ssl", 182 | "const": "off" 183 | } 184 | ], 185 | "10": [ 186 | { 187 | "__parent": "9.6" 188 | }, 189 | { 190 | "name": "max_parallel_workers", 191 | "alg": "calc_cpu_scale(4, 24)" 192 | }, 193 | ], 194 | "11": [ 195 | { 196 | "__parent": "10" 197 | }, 198 | { 199 | "name": "jit", 200 | "const": "off" 201 | } 202 | ], 203 | "12": [ 204 | { 205 | "__parent": "11" 206 | } 207 | ], 208 | "13": [ 209 | { 210 | "__parent": "12" 211 | } 212 | ], 213 | "14": [ 214 | { 215 | "__parent": "13" 216 | } 217 | ], 218 | "15": [ 219 | { 220 | "__parent": "14" 221 | } 222 | ], 223 | "16": [ 224 | { 225 | "__parent": "15" 226 | } 227 | ], 228 | "17": [ 229 | { 230 | "__parent": "16" 231 | } 232 | ], 233 | } 234 | -------------------------------------------------------------------------------- /pg_configurator/conf_profiles/profile_platform_common.py: -------------------------------------------------------------------------------- 1 | platform_common_alg_set = { 2 | "9.6": [ 3 | # ---------------------------------------------------------------------------------- 4 | # Extensions 5 | { 6 | "name": "shared_preload_libraries", 7 | "const": "'pg_stat_statements,pg_store_plans,auto_explain'" 8 | }, 9 | # The online_analyze module provides a set of features that immediately 10 | # update statistics after INSERT, UPDATE, DELETE, or SELECT INTO operations for the affected tables. 11 | { 12 | "name": "online_analyze.enable", 13 | "const": "'on'", 14 | }, 15 | { 16 | "name": "online_analyze.verbose", 17 | "const": "off" 18 | }, 19 | { 20 | "name": "online_analyze.scale_factor", 21 | "alg": "round(float(calc_scale_factor_scale(0.0007, 0.1)),4)", 22 | "to_unit": "as_is" 23 | }, 24 | { 25 | "name": "online_analyze.threshold", 26 | "alg": "int(calc_system_scores_scale(500, 10000))", 27 | "to_unit": "as_is" 28 | }, 29 | { 30 | "name": "online_analyze.local_tracking", 31 | "const": "on" 32 | }, 33 | { 34 | "name": "online_analyze.min_interval", 35 | "const": "10000" 36 | }, 37 | { 38 | "name": "online_analyze.table_type", 39 | "const": "temporary" 40 | }, 41 | # The auto_explain module provides a means for logging execution plans of slow statements automatically, 42 | # without having to run EXPLAIN by hand. 43 | { 44 | "name": "auto_explain.log_min_duration", 45 | "alg": """\ 46 | '3s' if duty_db == DutyDB.FINANCIAL else \ 47 | '5s' if duty_db in [DutyDB.MIXED] else \ 48 | '30s' """, 49 | "to_unit": "as_is" 50 | }, 51 | { 52 | "name": "auto_explain.log_analyze", 53 | "const": "true" 54 | }, 55 | { 56 | "name": "auto_explain.log_verbose", 57 | "const": "true" 58 | }, 59 | { 60 | "name": "auto_explain.log_buffers", 61 | "const": "true" 62 | }, 63 | { 64 | "name": "auto_explain.log_format", 65 | "const": "text" 66 | }, 67 | { 68 | "name": "auto_explain.log_nested_statements", 69 | "const": "true" 70 | }, 71 | # The pg_stat_statements module provides a means for tracking planning 72 | # and execution statistics of all SQL statements executed by a server. 73 | { 74 | "name": "pg_stat_statements.max", 75 | "alg": """\ 76 | '3000' if duty_db == DutyDB.FINANCIAL else \ 77 | '5000' if duty_db == DutyDB.MIXED else \ 78 | '7000' """, 79 | "to_unit": "as_is" 80 | }, 81 | { 82 | "name": "pg_stat_statements.track", 83 | "const": "top" 84 | }, 85 | # Store execution plans like pg_stat_statements does for queries. 86 | { 87 | "name": "pg_store_plans.max", 88 | "alg": """\ 89 | '6000' if duty_db == DutyDB.FINANCIAL else \ 90 | '10000' if duty_db == DutyDB.MIXED else \ 91 | '15000' """, 92 | "to_unit": "as_is" 93 | }, 94 | { 95 | "name": "pg_store_plans.track", 96 | "const": "top" 97 | }, 98 | { 99 | "name": "pg_store_plans.max_plan_length", 100 | "alg": """\ 101 | '3000' if duty_db == DutyDB.FINANCIAL else \ 102 | '5000' if duty_db == DutyDB.MIXED else \ 103 | '10000' """, 104 | "to_unit": "as_is" 105 | }, 106 | { 107 | "name": "pg_store_plans.plan_format", 108 | "const": "raw" 109 | }, 110 | { 111 | "name": "pg_store_plans.min_duration", 112 | "alg": """\ 113 | '100' if duty_db == DutyDB.FINANCIAL else \ 114 | '300' if duty_db == DutyDB.MIXED else \ 115 | '3000' """, 116 | "to_unit": "as_is" 117 | }, 118 | { 119 | "name": "pg_store_plans.log_analyze", 120 | "const": "on" 121 | }, 122 | { 123 | "name": "pg_store_plans.log_buffers", 124 | "const": "on" 125 | }, 126 | # plantuner is a contribution module for PostgreSQL, which enable planner hints. 127 | { 128 | "name": "plantuner.fix_empty_table", 129 | "const": "on" 130 | }, 131 | # ---------------------------------------------------------------------------------- 132 | # Logging 133 | { 134 | "name": "log_rotation_age", 135 | "const": "1d" 136 | }, 137 | { 138 | "name": "log_rotation_size", 139 | "const": "100MB" 140 | }, 141 | { 142 | "name": "log_min_messages", 143 | "const": "warning" 144 | }, 145 | { 146 | "name": "log_min_error_statement", 147 | "const": "error" 148 | }, 149 | { 150 | "name": "log_min_duration_statement", 151 | "alg": """\ 152 | '3s' if duty_db == DutyDB.FINANCIAL else \ 153 | '5s' if duty_db == DutyDB.MIXED else \ 154 | '30s' """, 155 | "to_unit": "as_is" 156 | }, 157 | { 158 | "name": "log_duration", 159 | "const": "off" 160 | }, 161 | { 162 | "name": "log_line_prefix", 163 | "const": "%m [%p:%v] [%d] %r %a " 164 | }, 165 | { 166 | "name": "log_lock_waits", 167 | "const": "on" 168 | }, 169 | { 170 | "name": "log_statement", 171 | "const": "'ddl'" 172 | }, 173 | { 174 | "name": "log_temp_files", 175 | "const": "0" 176 | }, 177 | { 178 | "name": "log_checkpoints", 179 | "const": "on" 180 | }, 181 | { 182 | "name": "log_autovacuum_min_duration", 183 | "const": "5s" 184 | }, 185 | # For the pg-monitor to work correctly, this parameter must be in this locale 186 | { 187 | "name": "lc_messages", 188 | "const": "en_US.UTF-8" 189 | }, 190 | # ---------------------------------------------------------------------------------- 191 | # Statistic collection 192 | # ---------------------------------------------------------------------------------- 193 | { 194 | "name": "track_activities", 195 | "const": "on" 196 | }, 197 | { 198 | "name": "track_counts", 199 | "const": "on" 200 | }, 201 | { 202 | "name": "track_io_timing", 203 | "const": "on" 204 | }, 205 | { 206 | "name": "track_functions", 207 | "const": "pl" 208 | }, 209 | { 210 | "name": "track_activity_query_size", 211 | "alg": """\ 212 | 1024 if duty_db == DutyDB.FINANCIAL else \ 213 | 2048 if duty_db == DutyDB.MIXED else \ 214 | 4096""", 215 | "to_unit": "as_is" 216 | }, 217 | # ---------------------------------------------------------------------------------- 218 | # Version and platform compatibility 219 | # ---------------------------------------------------------------------------------- 220 | { 221 | "name": "escape_string_warning", 222 | "const": "on" 223 | }, 224 | { 225 | "name": "standard_conforming_strings", 226 | "const": "on" 227 | }, 228 | # ---------------------------------------------------------------------------------- 229 | # Connection and authentication 230 | # ---------------------------------------------------------------------------------- 231 | { 232 | "name": "row_security", 233 | "const": "on" 234 | }, 235 | { 236 | "name": "ssl", 237 | "const": "off" 238 | }, 239 | ], 240 | "10": [ 241 | { 242 | "__parent": "9.6" 243 | } 244 | ], 245 | "11": [ 246 | { 247 | "__parent": "10" 248 | } 249 | ], 250 | "12": [ 251 | { 252 | "__parent": "11" 253 | } 254 | ], 255 | "13": [ 256 | { 257 | "__parent": "12" 258 | } 259 | ], 260 | "14": [ 261 | { 262 | "__parent": "13" 263 | }, 264 | { 265 | "name": "track_wal_io_timing", 266 | "const": "on" 267 | }, 268 | { 269 | "name": "log_recovery_conflict_waits", 270 | "alg": "'on' if replication_enabled else 'off'", 271 | "to_unit": "as_is" 272 | } 273 | ], 274 | "15": [ 275 | { 276 | "__parent": "14" 277 | } 278 | ], 279 | "16": [ 280 | { 281 | "__parent": "15" 282 | } 283 | ], 284 | "17": [ 285 | { 286 | "__parent": "16" 287 | } 288 | ], 289 | } -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_9_6.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_system_table_mods,off,"",off, 3 | application_name,psql,"","", 4 | archive_command,(disabled),"","", 5 | archive_mode,off,"",off, 6 | archive_timeout,0,"",0,s 7 | array_nulls,on,"",on, 8 | authentication_timeout,60,"",60,s 9 | autovacuum,on,"",on, 10 | autovacuum_analyze_scale_factor,0.1,"",0.1, 11 | autovacuum_analyze_threshold,50,"",50, 12 | autovacuum_freeze_max_age,200000000,"",200000000, 13 | autovacuum_max_workers,3,"",3, 14 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 15 | autovacuum_naptime,60,"",60,s 16 | autovacuum_vacuum_cost_delay,20,"",20,ms 17 | autovacuum_vacuum_cost_limit,-1,"",-1, 18 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 19 | autovacuum_vacuum_threshold,50,"",50, 20 | autovacuum_work_mem,-1,"",-1,kB 21 | backend_flush_after,0,0 bytes,0,8kB 22 | backslash_quote,safe_encoding,"",safe_encoding, 23 | bgwriter_delay,200,"",200,ms 24 | bgwriter_flush_after,64,512 kB,64,8kB 25 | bgwriter_lru_maxpages,100,"",100, 26 | bgwriter_lru_multiplier,2,"",2, 27 | block_size,8192,"",8192, 28 | bonjour,off,"",off, 29 | bonjour_name,"","","", 30 | bytea_output,hex,"",hex, 31 | check_function_bodies,on,"",on, 32 | checkpoint_completion_target,0.5,"",0.5, 33 | checkpoint_flush_after,32,256 kB,32,8kB 34 | checkpoint_timeout,300,"",300,s 35 | checkpoint_warning,30,"",30,s 36 | client_encoding,SQL_ASCII,"",SQL_ASCII, 37 | client_min_messages,notice,"",notice, 38 | cluster_name,"","","", 39 | commit_delay,0,"",0, 40 | commit_siblings,5,"",5, 41 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 42 | constraint_exclusion,partition,"",partition, 43 | cpu_index_tuple_cost,0.005,"",0.005, 44 | cpu_operator_cost,0.0025,"",0.0025, 45 | cpu_tuple_cost,0.01,"",0.01, 46 | cursor_tuple_fraction,0.1,"",0.1, 47 | data_checksums,off,"",off, 48 | data_directory,/var/lib/postgresql/data,"",, 49 | data_sync_retry,off,"",off, 50 | DateStyle,"ISO, MDY","","ISO, MDY", 51 | db_user_namespace,off,"",off, 52 | deadlock_timeout,1000,"",1000,ms 53 | debug_assertions,off,"",off, 54 | debug_pretty_print,on,"",on, 55 | debug_print_parse,off,"",off, 56 | debug_print_plan,off,"",off, 57 | debug_print_rewritten,off,"",off, 58 | default_statistics_target,100,"",100, 59 | default_tablespace,"","","", 60 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 61 | default_transaction_deferrable,off,"",off, 62 | default_transaction_isolation,read committed,"",read committed, 63 | default_transaction_read_only,off,"",off, 64 | default_with_oids,off,"",off, 65 | dynamic_library_path,$libdir,"",$libdir, 66 | dynamic_shared_memory_type,posix,"",posix, 67 | effective_cache_size,524288,4096 MB,524288,8kB 68 | effective_io_concurrency,1,"",1, 69 | enable_bitmapscan,on,"",on, 70 | enable_hashagg,on,"",on, 71 | enable_hashjoin,on,"",on, 72 | enable_indexonlyscan,on,"",on, 73 | enable_indexscan,on,"",on, 74 | enable_material,on,"",on, 75 | enable_mergejoin,on,"",on, 76 | enable_nestloop,on,"",on, 77 | enable_seqscan,on,"",on, 78 | enable_sort,on,"",on, 79 | enable_tidscan,on,"",on, 80 | escape_string_warning,on,"",on, 81 | event_source,PostgreSQL,"",PostgreSQL, 82 | exit_on_error,off,"",off, 83 | extension_destdir,"","","", 84 | external_pid_file,"","",, 85 | extra_float_digits,0,"",0, 86 | force_parallel_mode,off,"",off, 87 | from_collapse_limit,8,"",8, 88 | fsync,on,"",on, 89 | full_page_writes,on,"",on, 90 | geqo,on,"",on, 91 | geqo_effort,5,"",5, 92 | geqo_generations,0,"",0, 93 | geqo_pool_size,0,"",0, 94 | geqo_seed,0,"",0, 95 | geqo_selection_bias,2,"",2, 96 | geqo_threshold,12,"",12, 97 | gin_fuzzy_search_limit,0,"",0, 98 | gin_pending_list_limit,4096,4096 kB,4096,kB 99 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 100 | hot_standby,off,"",off, 101 | hot_standby_feedback,off,"",off, 102 | huge_pages,try,"",try, 103 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 104 | idle_in_transaction_session_timeout,0,"",0,ms 105 | ignore_checksum_failure,off,"",off, 106 | ignore_system_indexes,off,"",off, 107 | integer_datetimes,on,"",on, 108 | IntervalStyle,postgres,"",postgres, 109 | join_collapse_limit,8,"",8, 110 | krb_caseins_users,off,"",off, 111 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 112 | lc_collate,en_US.utf8,"",C, 113 | lc_ctype,en_US.utf8,"",C, 114 | lc_messages,en_US.utf8,"","", 115 | lc_monetary,en_US.utf8,"",C, 116 | lc_numeric,en_US.utf8,"",C, 117 | lc_time,en_US.utf8,"",C, 118 | listen_addresses,*,"",localhost, 119 | local_preload_libraries,"","","", 120 | lock_timeout,0,"",0,ms 121 | lo_compat_privileges,off,"",off, 122 | log_autovacuum_min_duration,-1,"",-1,ms 123 | log_checkpoints,off,"",off, 124 | log_connections,off,"",off, 125 | log_destination,stderr,"",stderr, 126 | log_directory,pg_log,"",pg_log, 127 | log_disconnections,off,"",off, 128 | log_duration,off,"",off, 129 | log_error_verbosity,default,"",default, 130 | log_executor_stats,off,"",off, 131 | log_file_mode,0600,"",384, 132 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 133 | logging_collector,off,"",off, 134 | log_hostname,off,"",off, 135 | log_line_prefix,"","","", 136 | log_lock_waits,off,"",off, 137 | log_min_duration_statement,-1,"",-1,ms 138 | log_min_error_statement,error,"",error, 139 | log_min_messages,warning,"",warning, 140 | log_parser_stats,off,"",off, 141 | log_planner_stats,off,"",off, 142 | log_replication_commands,off,"",off, 143 | log_rotation_age,1440,"",1440,min 144 | log_rotation_size,10240,10 MB,10240,kB 145 | log_statement,none,"",none, 146 | log_statement_stats,off,"",off, 147 | log_temp_files,-1,"",-1,kB 148 | log_timezone,Etc/UTC,"",GMT, 149 | log_truncate_on_rotation,off,"",off, 150 | maintenance_work_mem,65536,64 MB,65536,kB 151 | max_connections,100,"",100, 152 | max_files_per_process,1000,"",1000, 153 | max_function_args,100,"",100, 154 | max_identifier_length,63,"",63, 155 | max_index_keys,32,"",32, 156 | max_locks_per_transaction,64,"",64, 157 | max_parallel_workers_per_gather,0,"",0, 158 | max_pred_locks_per_transaction,64,"",64, 159 | max_prepared_transactions,0,"",0, 160 | max_replication_slots,0,"",0, 161 | max_stack_depth,2048,2048 kB,100,kB 162 | max_standby_archive_delay,30000,"",30000,ms 163 | max_standby_streaming_delay,30000,"",30000,ms 164 | max_wal_senders,0,"",0, 165 | max_wal_size,64,"",64,16MB 166 | max_worker_processes,8,"",8, 167 | min_parallel_relation_size,1024,8192 kB,1024,8kB 168 | min_wal_size,5,"",5,16MB 169 | old_snapshot_threshold,-1,"",-1,min 170 | operator_precedence_warning,off,"",off, 171 | parallel_setup_cost,1000,"",1000, 172 | parallel_tuple_cost,0.1,"",0.1, 173 | password_encryption,on,"",on, 174 | port,5432,"",5432, 175 | post_auth_delay,0,"",0,s 176 | pre_auth_delay,0,"",0,s 177 | quote_all_identifiers,off,"",off, 178 | random_page_cost,4,"",4, 179 | replacement_sort_tuples,150000,"",150000, 180 | restart_after_crash,on,"",on, 181 | row_security,on,"",on, 182 | search_path,"""$user"", public","","""$user"", public", 183 | segment_size,131072,1024 MB,131072,8kB 184 | seq_page_cost,1,"",1, 185 | server_encoding,UTF8,"",SQL_ASCII, 186 | server_version,9.6.24,"",9.6.24, 187 | server_version_num,90624,"",90624, 188 | session_preload_libraries,"","","", 189 | session_replication_role,origin,"",origin, 190 | shared_buffers,16384,128 MB,1024,8kB 191 | shared_preload_libraries,"","","", 192 | sql_inheritance,on,"",on, 193 | ssl,off,"",off, 194 | ssl_ca_file,"","","", 195 | ssl_cert_file,server.crt,"",server.crt, 196 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 197 | ssl_crl_file,"","","", 198 | ssl_ecdh_curve,prime256v1,"",prime256v1, 199 | ssl_key_file,server.key,"",server.key, 200 | ssl_prefer_server_ciphers,on,"",on, 201 | standard_conforming_strings,on,"",on, 202 | statement_timeout,0,"",0,ms 203 | stats_temp_directory,pg_stat_tmp,"",pg_stat_tmp, 204 | superuser_reserved_connections,3,"",3, 205 | synchronize_seqscans,on,"",on, 206 | synchronous_commit,on,"",on, 207 | synchronous_standby_names,"","","", 208 | syslog_facility,local0,"",local0, 209 | syslog_ident,postgres,"",postgres, 210 | syslog_sequence_numbers,on,"",on, 211 | syslog_split_messages,on,"",on, 212 | tcp_keepalives_count,0,"",0, 213 | tcp_keepalives_idle,0,"",0,s 214 | tcp_keepalives_interval,0,"",0,s 215 | temp_buffers,1024,8192 kB,1024,8kB 216 | temp_file_limit,-1,"",-1,kB 217 | temp_tablespaces,"","","", 218 | TimeZone,Etc/UTC,"",GMT, 219 | timezone_abbreviations,Default,"",, 220 | trace_notify,off,"",off, 221 | trace_recovery_messages,log,"",log, 222 | trace_sort,off,"",off, 223 | track_activities,on,"",on, 224 | track_activity_query_size,1024,"",1024, 225 | track_commit_timestamp,off,"",off, 226 | track_counts,on,"",on, 227 | track_functions,none,"",none, 228 | track_io_timing,off,"",off, 229 | transaction_deferrable,off,"",off, 230 | transaction_isolation,read committed,"",default, 231 | transaction_read_only,off,"",off, 232 | transform_null_equals,off,"",off, 233 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 234 | unix_socket_group,"","","", 235 | unix_socket_permissions,0777,"",511, 236 | update_process_title,on,"",on, 237 | vacuum_cost_delay,0,"",0,ms 238 | vacuum_cost_limit,200,"",200, 239 | vacuum_cost_page_dirty,20,"",20, 240 | vacuum_cost_page_hit,1,"",1, 241 | vacuum_cost_page_miss,10,"",10, 242 | vacuum_defer_cleanup_age,0,"",0, 243 | vacuum_freeze_min_age,50000000,"",50000000, 244 | vacuum_freeze_table_age,150000000,"",150000000, 245 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 246 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 247 | wal_block_size,8192,"",8192, 248 | wal_buffers,512,4096 kB,-1,8kB 249 | wal_compression,off,"",off, 250 | wal_keep_segments,0,"",0, 251 | wal_level,minimal,"",minimal, 252 | wal_log_hints,off,"",off, 253 | wal_receiver_status_interval,10,"",10,s 254 | wal_receiver_timeout,60000,"",60000,ms 255 | wal_retrieve_retry_interval,5000,"",5000,ms 256 | wal_segment_size,2048,16 MB,2048,8kB 257 | wal_sender_timeout,60000,"",60000,ms 258 | wal_sync_method,fdatasync,"",fdatasync, 259 | wal_writer_delay,200,"",200,ms 260 | wal_writer_flush_after,128,1024 kB,128,8kB 261 | work_mem,4096,4096 kB,4096,kB 262 | xmlbinary,base64,"",base64, 263 | xmloption,content,"",content, 264 | zero_damaged_pages,off,"",off, 265 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_10.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_system_table_mods,off,"",off, 3 | application_name,psql,"","", 4 | archive_command,(disabled),"","", 5 | archive_mode,off,"",off, 6 | archive_timeout,0,"",0,s 7 | array_nulls,on,"",on, 8 | authentication_timeout,60,"",60,s 9 | autovacuum,on,"",on, 10 | autovacuum_analyze_scale_factor,0.1,"",0.1, 11 | autovacuum_analyze_threshold,50,"",50, 12 | autovacuum_freeze_max_age,200000000,"",200000000, 13 | autovacuum_max_workers,3,"",3, 14 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 15 | autovacuum_naptime,60,"",60,s 16 | autovacuum_vacuum_cost_delay,20,"",20,ms 17 | autovacuum_vacuum_cost_limit,-1,"",-1, 18 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 19 | autovacuum_vacuum_threshold,50,"",50, 20 | autovacuum_work_mem,-1,"",-1,kB 21 | backend_flush_after,0,0 bytes,0,8kB 22 | backslash_quote,safe_encoding,"",safe_encoding, 23 | bgwriter_delay,200,"",200,ms 24 | bgwriter_flush_after,64,512 kB,64,8kB 25 | bgwriter_lru_maxpages,100,"",100, 26 | bgwriter_lru_multiplier,2,"",2, 27 | block_size,8192,"",8192, 28 | bonjour,off,"",off, 29 | bonjour_name,"","","", 30 | bytea_output,hex,"",hex, 31 | check_function_bodies,on,"",on, 32 | checkpoint_completion_target,0.5,"",0.5, 33 | checkpoint_flush_after,32,256 kB,32,8kB 34 | checkpoint_timeout,300,"",300,s 35 | checkpoint_warning,30,"",30,s 36 | client_encoding,SQL_ASCII,"",SQL_ASCII, 37 | client_min_messages,notice,"",notice, 38 | cluster_name,"","","", 39 | commit_delay,0,"",0, 40 | commit_siblings,5,"",5, 41 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 42 | constraint_exclusion,partition,"",partition, 43 | cpu_index_tuple_cost,0.005,"",0.005, 44 | cpu_operator_cost,0.0025,"",0.0025, 45 | cpu_tuple_cost,0.01,"",0.01, 46 | cursor_tuple_fraction,0.1,"",0.1, 47 | data_checksums,off,"",off, 48 | data_directory,/var/lib/postgresql/data,"",, 49 | data_sync_retry,off,"",off, 50 | DateStyle,"ISO, MDY","","ISO, MDY", 51 | db_user_namespace,off,"",off, 52 | deadlock_timeout,1000,"",1000,ms 53 | debug_assertions,off,"",off, 54 | debug_pretty_print,on,"",on, 55 | debug_print_parse,off,"",off, 56 | debug_print_plan,off,"",off, 57 | debug_print_rewritten,off,"",off, 58 | default_statistics_target,100,"",100, 59 | default_tablespace,"","","", 60 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 61 | default_transaction_deferrable,off,"",off, 62 | default_transaction_isolation,read committed,"",read committed, 63 | default_transaction_read_only,off,"",off, 64 | default_with_oids,off,"",off, 65 | dynamic_library_path,$libdir,"",$libdir, 66 | dynamic_shared_memory_type,posix,"",posix, 67 | effective_cache_size,524288,4096 MB,524288,8kB 68 | effective_io_concurrency,1,"",1, 69 | enable_bitmapscan,on,"",on, 70 | enable_gathermerge,on,"",on, 71 | enable_hashagg,on,"",on, 72 | enable_hashjoin,on,"",on, 73 | enable_indexonlyscan,on,"",on, 74 | enable_indexscan,on,"",on, 75 | enable_material,on,"",on, 76 | enable_mergejoin,on,"",on, 77 | enable_nestloop,on,"",on, 78 | enable_seqscan,on,"",on, 79 | enable_sort,on,"",on, 80 | enable_tidscan,on,"",on, 81 | escape_string_warning,on,"",on, 82 | event_source,PostgreSQL,"",PostgreSQL, 83 | exit_on_error,off,"",off, 84 | extension_destdir,"","","", 85 | external_pid_file,"","",, 86 | extra_float_digits,0,"",0, 87 | force_parallel_mode,off,"",off, 88 | from_collapse_limit,8,"",8, 89 | fsync,on,"",on, 90 | full_page_writes,on,"",on, 91 | geqo,on,"",on, 92 | geqo_effort,5,"",5, 93 | geqo_generations,0,"",0, 94 | geqo_pool_size,0,"",0, 95 | geqo_seed,0,"",0, 96 | geqo_selection_bias,2,"",2, 97 | geqo_threshold,12,"",12, 98 | gin_fuzzy_search_limit,0,"",0, 99 | gin_pending_list_limit,4096,4096 kB,4096,kB 100 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 101 | hot_standby,on,"",on, 102 | hot_standby_feedback,off,"",off, 103 | huge_pages,try,"",try, 104 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 105 | idle_in_transaction_session_timeout,0,"",0,ms 106 | ignore_checksum_failure,off,"",off, 107 | ignore_system_indexes,off,"",off, 108 | integer_datetimes,on,"",on, 109 | IntervalStyle,postgres,"",postgres, 110 | join_collapse_limit,8,"",8, 111 | krb_caseins_users,off,"",off, 112 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 113 | lc_collate,en_US.utf8,"",C, 114 | lc_ctype,en_US.utf8,"",C, 115 | lc_messages,en_US.utf8,"","", 116 | lc_monetary,en_US.utf8,"",C, 117 | lc_numeric,en_US.utf8,"",C, 118 | lc_time,en_US.utf8,"",C, 119 | listen_addresses,*,"",localhost, 120 | local_preload_libraries,"","","", 121 | lock_timeout,0,"",0,ms 122 | lo_compat_privileges,off,"",off, 123 | log_autovacuum_min_duration,-1,"",-1,ms 124 | log_checkpoints,off,"",off, 125 | log_connections,off,"",off, 126 | log_destination,stderr,"",stderr, 127 | log_directory,log,"",log, 128 | log_disconnections,off,"",off, 129 | log_duration,off,"",off, 130 | log_error_verbosity,default,"",default, 131 | log_executor_stats,off,"",off, 132 | log_file_mode,0600,"",384, 133 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 134 | logging_collector,off,"",off, 135 | log_hostname,off,"",off, 136 | log_line_prefix,%m [%p] ,"",%m [%p] , 137 | log_lock_waits,off,"",off, 138 | log_min_duration_statement,-1,"",-1,ms 139 | log_min_error_statement,error,"",error, 140 | log_min_messages,warning,"",warning, 141 | log_parser_stats,off,"",off, 142 | log_planner_stats,off,"",off, 143 | log_replication_commands,off,"",off, 144 | log_rotation_age,1440,"",1440,min 145 | log_rotation_size,10240,10 MB,10240,kB 146 | log_statement,none,"",none, 147 | log_statement_stats,off,"",off, 148 | log_temp_files,-1,"",-1,kB 149 | log_timezone,Etc/UTC,"",GMT, 150 | log_truncate_on_rotation,off,"",off, 151 | maintenance_work_mem,65536,64 MB,65536,kB 152 | max_connections,100,"",100, 153 | max_files_per_process,1000,"",1000, 154 | max_function_args,100,"",100, 155 | max_identifier_length,63,"",63, 156 | max_index_keys,32,"",32, 157 | max_locks_per_transaction,64,"",64, 158 | max_logical_replication_workers,4,"",4, 159 | max_parallel_workers,8,"",8, 160 | max_parallel_workers_per_gather,2,"",2, 161 | max_pred_locks_per_page,2,"",2, 162 | max_pred_locks_per_relation,-2,"",-2, 163 | max_pred_locks_per_transaction,64,"",64, 164 | max_prepared_transactions,0,"",0, 165 | max_replication_slots,10,"",10, 166 | max_stack_depth,2048,2048 kB,100,kB 167 | max_standby_archive_delay,30000,"",30000,ms 168 | max_standby_streaming_delay,30000,"",30000,ms 169 | max_sync_workers_per_subscription,2,"",2, 170 | max_wal_senders,10,"",10, 171 | max_wal_size,1024,"",1024,MB 172 | max_worker_processes,8,"",8, 173 | min_parallel_index_scan_size,64,512 kB,64,8kB 174 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 175 | min_wal_size,80,"",80,MB 176 | old_snapshot_threshold,-1,"",-1,min 177 | operator_precedence_warning,off,"",off, 178 | parallel_setup_cost,1000,"",1000, 179 | parallel_tuple_cost,0.1,"",0.1, 180 | password_encryption,md5,"",md5, 181 | port,5432,"",5432, 182 | post_auth_delay,0,"",0,s 183 | pre_auth_delay,0,"",0,s 184 | quote_all_identifiers,off,"",off, 185 | random_page_cost,4,"",4, 186 | replacement_sort_tuples,150000,"",150000, 187 | restart_after_crash,on,"",on, 188 | row_security,on,"",on, 189 | search_path,"""$user"", public","","""$user"", public", 190 | segment_size,131072,1024 MB,131072,8kB 191 | seq_page_cost,1,"",1, 192 | server_encoding,UTF8,"",SQL_ASCII, 193 | server_version,10.21 (Debian 10.21-1.pgdg90+1),"",10.21 (Debian 10.21-1.pgdg90+1), 194 | server_version_num,100021,"",100021, 195 | session_preload_libraries,"","","", 196 | session_replication_role,origin,"",origin, 197 | shared_buffers,16384,128 MB,1024,8kB 198 | shared_preload_libraries,"","","", 199 | ssl,off,"",off, 200 | ssl_ca_file,"","","", 201 | ssl_cert_file,server.crt,"",server.crt, 202 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 203 | ssl_crl_file,"","","", 204 | ssl_dh_params_file,"","","", 205 | ssl_ecdh_curve,prime256v1,"",prime256v1, 206 | ssl_key_file,server.key,"",server.key, 207 | ssl_prefer_server_ciphers,on,"",on, 208 | standard_conforming_strings,on,"",on, 209 | statement_timeout,0,"",0,ms 210 | stats_temp_directory,pg_stat_tmp,"",pg_stat_tmp, 211 | superuser_reserved_connections,3,"",3, 212 | synchronize_seqscans,on,"",on, 213 | synchronous_commit,on,"",on, 214 | synchronous_standby_names,"","","", 215 | syslog_facility,local0,"",local0, 216 | syslog_ident,postgres,"",postgres, 217 | syslog_sequence_numbers,on,"",on, 218 | syslog_split_messages,on,"",on, 219 | tcp_keepalives_count,0,"",0, 220 | tcp_keepalives_idle,0,"",0,s 221 | tcp_keepalives_interval,0,"",0,s 222 | temp_buffers,1024,8192 kB,1024,8kB 223 | temp_file_limit,-1,"",-1,kB 224 | temp_tablespaces,"","","", 225 | TimeZone,Etc/UTC,"",GMT, 226 | timezone_abbreviations,Default,"",, 227 | trace_notify,off,"",off, 228 | trace_recovery_messages,log,"",log, 229 | trace_sort,off,"",off, 230 | track_activities,on,"",on, 231 | track_activity_query_size,1024,"",1024, 232 | track_commit_timestamp,off,"",off, 233 | track_counts,on,"",on, 234 | track_functions,none,"",none, 235 | track_io_timing,off,"",off, 236 | transaction_deferrable,off,"",off, 237 | transaction_isolation,read committed,"",default, 238 | transaction_read_only,off,"",off, 239 | transform_null_equals,off,"",off, 240 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 241 | unix_socket_group,"","","", 242 | unix_socket_permissions,0777,"",511, 243 | update_process_title,on,"",on, 244 | vacuum_cost_delay,0,"",0,ms 245 | vacuum_cost_limit,200,"",200, 246 | vacuum_cost_page_dirty,20,"",20, 247 | vacuum_cost_page_hit,1,"",1, 248 | vacuum_cost_page_miss,10,"",10, 249 | vacuum_defer_cleanup_age,0,"",0, 250 | vacuum_freeze_min_age,50000000,"",50000000, 251 | vacuum_freeze_table_age,150000000,"",150000000, 252 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 253 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 254 | wal_block_size,8192,"",8192, 255 | wal_buffers,512,4096 kB,-1,8kB 256 | wal_compression,off,"",off, 257 | wal_consistency_checking,"","","", 258 | wal_keep_segments,0,"",0, 259 | wal_level,replica,"",replica, 260 | wal_log_hints,off,"",off, 261 | wal_receiver_status_interval,10,"",10,s 262 | wal_receiver_timeout,60000,"",60000,ms 263 | wal_retrieve_retry_interval,5000,"",5000,ms 264 | wal_segment_size,2048,16 MB,2048,8kB 265 | wal_sender_timeout,60000,"",60000,ms 266 | wal_sync_method,fdatasync,"",fdatasync, 267 | wal_writer_delay,200,"",200,ms 268 | wal_writer_flush_after,128,1024 kB,128,8kB 269 | work_mem,4096,4096 kB,4096,kB 270 | xmlbinary,base64,"",base64, 271 | xmloption,content,"",content, 272 | zero_damaged_pages,off,"",off, 273 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_11.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_system_table_mods,off,"",off, 3 | application_name,psql,"","", 4 | archive_command,(disabled),"","", 5 | archive_mode,off,"",off, 6 | archive_timeout,0,"",0,s 7 | array_nulls,on,"",on, 8 | authentication_timeout,60,"",60,s 9 | autovacuum,on,"",on, 10 | autovacuum_analyze_scale_factor,0.1,"",0.1, 11 | autovacuum_analyze_threshold,50,"",50, 12 | autovacuum_freeze_max_age,200000000,"",200000000, 13 | autovacuum_max_workers,3,"",3, 14 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 15 | autovacuum_naptime,60,"",60,s 16 | autovacuum_vacuum_cost_delay,20,"",20,ms 17 | autovacuum_vacuum_cost_limit,-1,"",-1, 18 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 19 | autovacuum_vacuum_threshold,50,"",50, 20 | autovacuum_work_mem,-1,"",-1,kB 21 | backend_flush_after,0,0 bytes,0,8kB 22 | backslash_quote,safe_encoding,"",safe_encoding, 23 | bgwriter_delay,200,"",200,ms 24 | bgwriter_flush_after,64,512 kB,64,8kB 25 | bgwriter_lru_maxpages,100,"",100, 26 | bgwriter_lru_multiplier,2,"",2, 27 | block_size,8192,"",8192, 28 | bonjour,off,"",off, 29 | bonjour_name,"","","", 30 | bytea_output,hex,"",hex, 31 | check_function_bodies,on,"",on, 32 | checkpoint_completion_target,0.5,"",0.5, 33 | checkpoint_flush_after,32,256 kB,32,8kB 34 | checkpoint_timeout,300,"",300,s 35 | checkpoint_warning,30,"",30,s 36 | client_encoding,SQL_ASCII,"",SQL_ASCII, 37 | client_min_messages,notice,"",notice, 38 | cluster_name,"","","", 39 | commit_delay,0,"",0, 40 | commit_siblings,5,"",5, 41 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 42 | constraint_exclusion,partition,"",partition, 43 | cpu_index_tuple_cost,0.005,"",0.005, 44 | cpu_operator_cost,0.0025,"",0.0025, 45 | cpu_tuple_cost,0.01,"",0.01, 46 | cursor_tuple_fraction,0.1,"",0.1, 47 | data_checksums,off,"",off, 48 | data_directory,/var/lib/postgresql/data,"",, 49 | data_directory_mode,0700,"",448, 50 | data_sync_retry,off,"",off, 51 | DateStyle,"ISO, MDY","","ISO, MDY", 52 | db_user_namespace,off,"",off, 53 | deadlock_timeout,1000,"",1000,ms 54 | debug_assertions,off,"",off, 55 | debug_pretty_print,on,"",on, 56 | debug_print_parse,off,"",off, 57 | debug_print_plan,off,"",off, 58 | debug_print_rewritten,off,"",off, 59 | default_statistics_target,100,"",100, 60 | default_tablespace,"","","", 61 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 62 | default_transaction_deferrable,off,"",off, 63 | default_transaction_isolation,read committed,"",read committed, 64 | default_transaction_read_only,off,"",off, 65 | default_with_oids,off,"",off, 66 | dynamic_library_path,$libdir,"",$libdir, 67 | dynamic_shared_memory_type,posix,"",posix, 68 | effective_cache_size,524288,4096 MB,524288,8kB 69 | effective_io_concurrency,1,"",1, 70 | enable_bitmapscan,on,"",on, 71 | enable_gathermerge,on,"",on, 72 | enable_hashagg,on,"",on, 73 | enable_hashjoin,on,"",on, 74 | enable_indexonlyscan,on,"",on, 75 | enable_indexscan,on,"",on, 76 | enable_material,on,"",on, 77 | enable_mergejoin,on,"",on, 78 | enable_nestloop,on,"",on, 79 | enable_parallel_append,on,"",on, 80 | enable_parallel_hash,on,"",on, 81 | enable_partition_pruning,on,"",on, 82 | enable_partitionwise_aggregate,off,"",off, 83 | enable_partitionwise_join,off,"",off, 84 | enable_seqscan,on,"",on, 85 | enable_sort,on,"",on, 86 | enable_tidscan,on,"",on, 87 | escape_string_warning,on,"",on, 88 | event_source,PostgreSQL,"",PostgreSQL, 89 | exit_on_error,off,"",off, 90 | extension_destdir,"","","", 91 | external_pid_file,"","",, 92 | extra_float_digits,0,"",0, 93 | force_parallel_mode,off,"",off, 94 | from_collapse_limit,8,"",8, 95 | fsync,on,"",on, 96 | full_page_writes,on,"",on, 97 | geqo,on,"",on, 98 | geqo_effort,5,"",5, 99 | geqo_generations,0,"",0, 100 | geqo_pool_size,0,"",0, 101 | geqo_seed,0,"",0, 102 | geqo_selection_bias,2,"",2, 103 | geqo_threshold,12,"",12, 104 | gin_fuzzy_search_limit,0,"",0, 105 | gin_pending_list_limit,4096,4096 kB,4096,kB 106 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 107 | hot_standby,on,"",on, 108 | hot_standby_feedback,off,"",off, 109 | huge_pages,try,"",try, 110 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 111 | idle_in_transaction_session_timeout,0,"",0,ms 112 | ignore_checksum_failure,off,"",off, 113 | ignore_system_indexes,off,"",off, 114 | integer_datetimes,on,"",on, 115 | IntervalStyle,postgres,"",postgres, 116 | jit,off,"",off, 117 | jit_above_cost,100000,"",100000, 118 | jit_debugging_support,off,"",off, 119 | jit_dump_bitcode,off,"",off, 120 | jit_expressions,on,"",on, 121 | jit_inline_above_cost,500000,"",500000, 122 | jit_optimize_above_cost,500000,"",500000, 123 | jit_profiling_support,off,"",off, 124 | jit_provider,llvmjit,"",llvmjit, 125 | jit_tuple_deforming,on,"",on, 126 | join_collapse_limit,8,"",8, 127 | krb_caseins_users,off,"",off, 128 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 129 | lc_collate,en_US.utf8,"",C, 130 | lc_ctype,en_US.utf8,"",C, 131 | lc_messages,en_US.utf8,"","", 132 | lc_monetary,en_US.utf8,"",C, 133 | lc_numeric,en_US.utf8,"",C, 134 | lc_time,en_US.utf8,"",C, 135 | listen_addresses,*,"",localhost, 136 | local_preload_libraries,"","","", 137 | lock_timeout,0,"",0,ms 138 | lo_compat_privileges,off,"",off, 139 | log_autovacuum_min_duration,-1,"",-1,ms 140 | log_checkpoints,off,"",off, 141 | log_connections,off,"",off, 142 | log_destination,stderr,"",stderr, 143 | log_directory,log,"",log, 144 | log_disconnections,off,"",off, 145 | log_duration,off,"",off, 146 | log_error_verbosity,default,"",default, 147 | log_executor_stats,off,"",off, 148 | log_file_mode,0600,"",384, 149 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 150 | logging_collector,off,"",off, 151 | log_hostname,off,"",off, 152 | log_line_prefix,%m [%p] ,"",%m [%p] , 153 | log_lock_waits,off,"",off, 154 | log_min_duration_statement,-1,"",-1,ms 155 | log_min_error_statement,error,"",error, 156 | log_min_messages,warning,"",warning, 157 | log_parser_stats,off,"",off, 158 | log_planner_stats,off,"",off, 159 | log_replication_commands,off,"",off, 160 | log_rotation_age,1440,"",1440,min 161 | log_rotation_size,10240,10 MB,10240,kB 162 | log_statement,none,"",none, 163 | log_statement_stats,off,"",off, 164 | log_temp_files,-1,"",-1,kB 165 | log_timezone,Etc/UTC,"",GMT, 166 | log_truncate_on_rotation,off,"",off, 167 | maintenance_work_mem,65536,64 MB,65536,kB 168 | max_connections,100,"",100, 169 | max_files_per_process,1000,"",1000, 170 | max_function_args,100,"",100, 171 | max_identifier_length,63,"",63, 172 | max_index_keys,32,"",32, 173 | max_locks_per_transaction,64,"",64, 174 | max_logical_replication_workers,4,"",4, 175 | max_parallel_maintenance_workers,2,"",2, 176 | max_parallel_workers,8,"",8, 177 | max_parallel_workers_per_gather,2,"",2, 178 | max_pred_locks_per_page,2,"",2, 179 | max_pred_locks_per_relation,-2,"",-2, 180 | max_pred_locks_per_transaction,64,"",64, 181 | max_prepared_transactions,0,"",0, 182 | max_replication_slots,10,"",10, 183 | max_stack_depth,2048,2048 kB,100,kB 184 | max_standby_archive_delay,30000,"",30000,ms 185 | max_standby_streaming_delay,30000,"",30000,ms 186 | max_sync_workers_per_subscription,2,"",2, 187 | max_wal_senders,10,"",10, 188 | max_wal_size,1024,"",1024,MB 189 | max_worker_processes,8,"",8, 190 | min_parallel_index_scan_size,64,512 kB,64,8kB 191 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 192 | min_wal_size,80,"",80,MB 193 | old_snapshot_threshold,-1,"",-1,min 194 | operator_precedence_warning,off,"",off, 195 | parallel_leader_participation,on,"",on, 196 | parallel_setup_cost,1000,"",1000, 197 | parallel_tuple_cost,0.1,"",0.1, 198 | password_encryption,md5,"",md5, 199 | port,5432,"",5432, 200 | post_auth_delay,0,"",0,s 201 | pre_auth_delay,0,"",0,s 202 | quote_all_identifiers,off,"",off, 203 | random_page_cost,4,"",4, 204 | restart_after_crash,on,"",on, 205 | row_security,on,"",on, 206 | search_path,"""$user"", public","","""$user"", public", 207 | segment_size,131072,1024 MB,131072,8kB 208 | seq_page_cost,1,"",1, 209 | server_encoding,UTF8,"",SQL_ASCII, 210 | server_version,11.16 (Debian 11.16-1.pgdg90+1),"",11.16 (Debian 11.16-1.pgdg90+1), 211 | server_version_num,110016,"",110016, 212 | session_preload_libraries,"","","", 213 | session_replication_role,origin,"",origin, 214 | shared_buffers,16384,128 MB,1024,8kB 215 | shared_preload_libraries,"","","", 216 | ssl,off,"",off, 217 | ssl_ca_file,"","","", 218 | ssl_cert_file,server.crt,"",server.crt, 219 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 220 | ssl_crl_file,"","","", 221 | ssl_dh_params_file,"","","", 222 | ssl_ecdh_curve,prime256v1,"",prime256v1, 223 | ssl_key_file,server.key,"",server.key, 224 | ssl_passphrase_command,"","","", 225 | ssl_passphrase_command_supports_reload,off,"",off, 226 | ssl_prefer_server_ciphers,on,"",on, 227 | standard_conforming_strings,on,"",on, 228 | statement_timeout,0,"",0,ms 229 | stats_temp_directory,pg_stat_tmp,"",pg_stat_tmp, 230 | superuser_reserved_connections,3,"",3, 231 | synchronize_seqscans,on,"",on, 232 | synchronous_commit,on,"",on, 233 | synchronous_standby_names,"","","", 234 | syslog_facility,local0,"",local0, 235 | syslog_ident,postgres,"",postgres, 236 | syslog_sequence_numbers,on,"",on, 237 | syslog_split_messages,on,"",on, 238 | tcp_keepalives_count,0,"",0, 239 | tcp_keepalives_idle,0,"",0,s 240 | tcp_keepalives_interval,0,"",0,s 241 | temp_buffers,1024,8192 kB,1024,8kB 242 | temp_file_limit,-1,"",-1,kB 243 | temp_tablespaces,"","","", 244 | TimeZone,Etc/UTC,"",GMT, 245 | timezone_abbreviations,Default,"",, 246 | trace_notify,off,"",off, 247 | trace_recovery_messages,log,"",log, 248 | trace_sort,off,"",off, 249 | track_activities,on,"",on, 250 | track_activity_query_size,1024,"",1024,B 251 | track_commit_timestamp,off,"",off, 252 | track_counts,on,"",on, 253 | track_functions,none,"",none, 254 | track_io_timing,off,"",off, 255 | transaction_deferrable,off,"",off, 256 | transaction_isolation,read committed,"",default, 257 | transaction_read_only,off,"",off, 258 | transform_null_equals,off,"",off, 259 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 260 | unix_socket_group,"","","", 261 | unix_socket_permissions,0777,"",511, 262 | update_process_title,on,"",on, 263 | vacuum_cleanup_index_scale_factor,0.1,"",0.1, 264 | vacuum_cost_delay,0,"",0,ms 265 | vacuum_cost_limit,200,"",200, 266 | vacuum_cost_page_dirty,20,"",20, 267 | vacuum_cost_page_hit,1,"",1, 268 | vacuum_cost_page_miss,10,"",10, 269 | vacuum_defer_cleanup_age,0,"",0, 270 | vacuum_freeze_min_age,50000000,"",50000000, 271 | vacuum_freeze_table_age,150000000,"",150000000, 272 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 273 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 274 | wal_block_size,8192,"",8192, 275 | wal_buffers,512,4096 kB,-1,8kB 276 | wal_compression,off,"",off, 277 | wal_consistency_checking,"","","", 278 | wal_keep_segments,0,"",0, 279 | wal_level,replica,"",replica, 280 | wal_log_hints,off,"",off, 281 | wal_receiver_status_interval,10,"",10,s 282 | wal_receiver_timeout,60000,"",60000,ms 283 | wal_retrieve_retry_interval,5000,"",5000,ms 284 | wal_segment_size,16777216,"",16777216,B 285 | wal_sender_timeout,60000,"",60000,ms 286 | wal_sync_method,fdatasync,"",fdatasync, 287 | wal_writer_delay,200,"",200,ms 288 | wal_writer_flush_after,128,1024 kB,128,8kB 289 | work_mem,4096,4096 kB,4096,kB 290 | xmlbinary,base64,"",base64, 291 | xmloption,content,"",content, 292 | zero_damaged_pages,off,"",off, 293 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_12.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_in_place_tablespaces,off,"",off, 3 | allow_system_table_mods,off,"",off, 4 | application_name,psql,"","", 5 | archive_cleanup_command,"","","", 6 | archive_command,(disabled),"","", 7 | archive_mode,off,"",off, 8 | archive_timeout,0,"",0,s 9 | array_nulls,on,"",on, 10 | authentication_timeout,60,"",60,s 11 | autovacuum,on,"",on, 12 | autovacuum_analyze_scale_factor,0.1,"",0.1, 13 | autovacuum_analyze_threshold,50,"",50, 14 | autovacuum_freeze_max_age,200000000,"",200000000, 15 | autovacuum_max_workers,3,"",3, 16 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 17 | autovacuum_naptime,60,"",60,s 18 | autovacuum_vacuum_cost_delay,2,"",2,ms 19 | autovacuum_vacuum_cost_limit,-1,"",-1, 20 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 21 | autovacuum_vacuum_threshold,50,"",50, 22 | autovacuum_work_mem,-1,"",-1,kB 23 | backend_flush_after,0,0 bytes,0,8kB 24 | backslash_quote,safe_encoding,"",safe_encoding, 25 | bgwriter_delay,200,"",200,ms 26 | bgwriter_flush_after,64,512 kB,64,8kB 27 | bgwriter_lru_maxpages,100,"",100, 28 | bgwriter_lru_multiplier,2,"",2, 29 | block_size,8192,"",8192, 30 | bonjour,off,"",off, 31 | bonjour_name,"","","", 32 | bytea_output,hex,"",hex, 33 | check_function_bodies,on,"",on, 34 | checkpoint_completion_target,0.5,"",0.5, 35 | checkpoint_flush_after,32,256 kB,32,8kB 36 | checkpoint_timeout,300,"",300,s 37 | checkpoint_warning,30,"",30,s 38 | client_encoding,SQL_ASCII,"",SQL_ASCII, 39 | client_min_messages,notice,"",notice, 40 | cluster_name,"","","", 41 | commit_delay,0,"",0, 42 | commit_siblings,5,"",5, 43 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 44 | constraint_exclusion,partition,"",partition, 45 | cpu_index_tuple_cost,0.005,"",0.005, 46 | cpu_operator_cost,0.0025,"",0.0025, 47 | cpu_tuple_cost,0.01,"",0.01, 48 | cursor_tuple_fraction,0.1,"",0.1, 49 | data_checksums,off,"",off, 50 | data_directory,/var/lib/postgresql/data,"",, 51 | data_directory_mode,0700,"",448, 52 | data_sync_retry,off,"",off, 53 | DateStyle,"ISO, MDY","","ISO, MDY", 54 | db_user_namespace,off,"",off, 55 | deadlock_timeout,1000,"",1000,ms 56 | debug_assertions,off,"",off, 57 | debug_pretty_print,on,"",on, 58 | debug_print_parse,off,"",off, 59 | debug_print_plan,off,"",off, 60 | debug_print_rewritten,off,"",off, 61 | default_statistics_target,100,"",100, 62 | default_table_access_method,heap,"",heap, 63 | default_tablespace,"","","", 64 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 65 | default_transaction_deferrable,off,"",off, 66 | default_transaction_isolation,read committed,"",read committed, 67 | default_transaction_read_only,off,"",off, 68 | dynamic_library_path,$libdir,"",$libdir, 69 | dynamic_shared_memory_type,posix,"",posix, 70 | effective_cache_size,524288,4096 MB,524288,8kB 71 | effective_io_concurrency,1,"",1, 72 | enable_bitmapscan,on,"",on, 73 | enable_gathermerge,on,"",on, 74 | enable_hashagg,on,"",on, 75 | enable_hashjoin,on,"",on, 76 | enable_indexonlyscan,on,"",on, 77 | enable_indexscan,on,"",on, 78 | enable_material,on,"",on, 79 | enable_mergejoin,on,"",on, 80 | enable_nestloop,on,"",on, 81 | enable_parallel_append,on,"",on, 82 | enable_parallel_hash,on,"",on, 83 | enable_partition_pruning,on,"",on, 84 | enable_partitionwise_aggregate,off,"",off, 85 | enable_partitionwise_join,off,"",off, 86 | enable_seqscan,on,"",on, 87 | enable_sort,on,"",on, 88 | enable_tidscan,on,"",on, 89 | escape_string_warning,on,"",on, 90 | event_source,PostgreSQL,"",PostgreSQL, 91 | exit_on_error,off,"",off, 92 | extension_destdir,"","","", 93 | external_pid_file,"","",, 94 | extra_float_digits,1,"",1, 95 | force_parallel_mode,off,"",off, 96 | from_collapse_limit,8,"",8, 97 | fsync,on,"",on, 98 | full_page_writes,on,"",on, 99 | geqo,on,"",on, 100 | geqo_effort,5,"",5, 101 | geqo_generations,0,"",0, 102 | geqo_pool_size,0,"",0, 103 | geqo_seed,0,"",0, 104 | geqo_selection_bias,2,"",2, 105 | geqo_threshold,12,"",12, 106 | gin_fuzzy_search_limit,0,"",0, 107 | gin_pending_list_limit,4096,4096 kB,4096,kB 108 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 109 | hot_standby,on,"",on, 110 | hot_standby_feedback,off,"",off, 111 | huge_pages,try,"",try, 112 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 113 | idle_in_transaction_session_timeout,0,"",0,ms 114 | ignore_checksum_failure,off,"",off, 115 | ignore_system_indexes,off,"",off, 116 | integer_datetimes,on,"",on, 117 | IntervalStyle,postgres,"",postgres, 118 | jit,on,"",on, 119 | jit_above_cost,100000,"",100000, 120 | jit_debugging_support,off,"",off, 121 | jit_dump_bitcode,off,"",off, 122 | jit_expressions,on,"",on, 123 | jit_inline_above_cost,500000,"",500000, 124 | jit_optimize_above_cost,500000,"",500000, 125 | jit_profiling_support,off,"",off, 126 | jit_provider,llvmjit,"",llvmjit, 127 | jit_tuple_deforming,on,"",on, 128 | join_collapse_limit,8,"",8, 129 | krb_caseins_users,off,"",off, 130 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 131 | lc_collate,en_US.utf8,"",C, 132 | lc_ctype,en_US.utf8,"",C, 133 | lc_messages,en_US.utf8,"","", 134 | lc_monetary,en_US.utf8,"",C, 135 | lc_numeric,en_US.utf8,"",C, 136 | lc_time,en_US.utf8,"",C, 137 | listen_addresses,*,"",localhost, 138 | local_preload_libraries,"","","", 139 | lock_timeout,0,"",0,ms 140 | lo_compat_privileges,off,"",off, 141 | log_autovacuum_min_duration,-1,"",-1,ms 142 | log_checkpoints,off,"",off, 143 | log_connections,off,"",off, 144 | log_destination,stderr,"",stderr, 145 | log_directory,log,"",log, 146 | log_disconnections,off,"",off, 147 | log_duration,off,"",off, 148 | log_error_verbosity,default,"",default, 149 | log_executor_stats,off,"",off, 150 | log_file_mode,0600,"",384, 151 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 152 | logging_collector,off,"",off, 153 | log_hostname,off,"",off, 154 | log_line_prefix,%m [%p] ,"",%m [%p] , 155 | log_lock_waits,off,"",off, 156 | log_min_duration_statement,-1,"",-1,ms 157 | log_min_error_statement,error,"",error, 158 | log_min_messages,warning,"",warning, 159 | log_parser_stats,off,"",off, 160 | log_planner_stats,off,"",off, 161 | log_replication_commands,off,"",off, 162 | log_rotation_age,1440,"",1440,min 163 | log_rotation_size,10240,10 MB,10240,kB 164 | log_statement,none,"",none, 165 | log_statement_stats,off,"",off, 166 | log_temp_files,-1,"",-1,kB 167 | log_timezone,Etc/UTC,"",GMT, 168 | log_transaction_sample_rate,0,"",0, 169 | log_truncate_on_rotation,off,"",off, 170 | maintenance_work_mem,65536,64 MB,65536,kB 171 | max_connections,100,"",100, 172 | max_files_per_process,1000,"",1000, 173 | max_function_args,100,"",100, 174 | max_identifier_length,63,"",63, 175 | max_index_keys,32,"",32, 176 | max_locks_per_transaction,64,"",64, 177 | max_logical_replication_workers,4,"",4, 178 | max_parallel_maintenance_workers,2,"",2, 179 | max_parallel_workers,8,"",8, 180 | max_parallel_workers_per_gather,2,"",2, 181 | max_pred_locks_per_page,2,"",2, 182 | max_pred_locks_per_relation,-2,"",-2, 183 | max_pred_locks_per_transaction,64,"",64, 184 | max_prepared_transactions,0,"",0, 185 | max_replication_slots,10,"",10, 186 | max_stack_depth,2048,2048 kB,100,kB 187 | max_standby_archive_delay,30000,"",30000,ms 188 | max_standby_streaming_delay,30000,"",30000,ms 189 | max_sync_workers_per_subscription,2,"",2, 190 | max_wal_senders,10,"",10, 191 | max_wal_size,1024,"",1024,MB 192 | max_worker_processes,8,"",8, 193 | min_parallel_index_scan_size,64,512 kB,64,8kB 194 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 195 | min_wal_size,80,"",80,MB 196 | old_snapshot_threshold,-1,"",-1,min 197 | operator_precedence_warning,off,"",off, 198 | parallel_leader_participation,on,"",on, 199 | parallel_setup_cost,1000,"",1000, 200 | parallel_tuple_cost,0.1,"",0.1, 201 | password_encryption,md5,"",md5, 202 | plan_cache_mode,auto,"",auto, 203 | port,5432,"",5432, 204 | post_auth_delay,0,"",0,s 205 | pre_auth_delay,0,"",0,s 206 | primary_conninfo,"","","", 207 | primary_slot_name,"","","", 208 | promote_trigger_file,"","","", 209 | quote_all_identifiers,off,"",off, 210 | random_page_cost,4,"",4, 211 | recovery_end_command,"","","", 212 | recovery_min_apply_delay,0,"",0,ms 213 | recovery_target,"","","", 214 | recovery_target_action,pause,"",pause, 215 | recovery_target_inclusive,on,"",on, 216 | recovery_target_lsn,"","","", 217 | recovery_target_name,"","","", 218 | recovery_target_time,"","","", 219 | recovery_target_timeline,latest,"",latest, 220 | recovery_target_xid,"","","", 221 | restart_after_crash,on,"",on, 222 | restore_command,"","","", 223 | row_security,on,"",on, 224 | search_path,"""$user"", public","","""$user"", public", 225 | segment_size,131072,1024 MB,131072,8kB 226 | seq_page_cost,1,"",1, 227 | server_encoding,UTF8,"",SQL_ASCII, 228 | server_version,12.12 (Debian 12.12-1.pgdg110+1),"",12.12 (Debian 12.12-1.pgdg110+1), 229 | server_version_num,120012,"",120012, 230 | session_preload_libraries,"","","", 231 | session_replication_role,origin,"",origin, 232 | shared_buffers,16384,128 MB,1024,8kB 233 | shared_memory_type,mmap,"",mmap, 234 | shared_preload_libraries,"","","", 235 | ssl,off,"",off, 236 | ssl_ca_file,"","","", 237 | ssl_cert_file,server.crt,"",server.crt, 238 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 239 | ssl_crl_file,"","","", 240 | ssl_dh_params_file,"","","", 241 | ssl_ecdh_curve,prime256v1,"",prime256v1, 242 | ssl_key_file,server.key,"",server.key, 243 | ssl_library,OpenSSL,"",OpenSSL, 244 | ssl_max_protocol_version,"","","", 245 | ssl_min_protocol_version,TLSv1,"",TLSv1, 246 | ssl_passphrase_command,"","","", 247 | ssl_passphrase_command_supports_reload,off,"",off, 248 | ssl_prefer_server_ciphers,on,"",on, 249 | standard_conforming_strings,on,"",on, 250 | statement_timeout,0,"",0,ms 251 | stats_temp_directory,pg_stat_tmp,"",pg_stat_tmp, 252 | superuser_reserved_connections,3,"",3, 253 | synchronize_seqscans,on,"",on, 254 | synchronous_commit,on,"",on, 255 | synchronous_standby_names,"","","", 256 | syslog_facility,local0,"",local0, 257 | syslog_ident,postgres,"",postgres, 258 | syslog_sequence_numbers,on,"",on, 259 | syslog_split_messages,on,"",on, 260 | tcp_keepalives_count,0,"",0, 261 | tcp_keepalives_idle,0,"",0,s 262 | tcp_keepalives_interval,0,"",0,s 263 | tcp_user_timeout,0,"",0,ms 264 | temp_buffers,1024,8192 kB,1024,8kB 265 | temp_file_limit,-1,"",-1,kB 266 | temp_tablespaces,"","","", 267 | TimeZone,Etc/UTC,"",GMT, 268 | timezone_abbreviations,Default,"",, 269 | trace_notify,off,"",off, 270 | trace_recovery_messages,log,"",log, 271 | trace_sort,off,"",off, 272 | track_activities,on,"",on, 273 | track_activity_query_size,1024,"",1024,B 274 | track_commit_timestamp,off,"",off, 275 | track_counts,on,"",on, 276 | track_functions,none,"",none, 277 | track_io_timing,off,"",off, 278 | transaction_deferrable,off,"",off, 279 | transaction_isolation,read committed,"",read committed, 280 | transaction_read_only,off,"",off, 281 | transform_null_equals,off,"",off, 282 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 283 | unix_socket_group,"","","", 284 | unix_socket_permissions,0777,"",511, 285 | update_process_title,on,"",on, 286 | vacuum_cleanup_index_scale_factor,0.1,"",0.1, 287 | vacuum_cost_delay,0,"",0,ms 288 | vacuum_cost_limit,200,"",200, 289 | vacuum_cost_page_dirty,20,"",20, 290 | vacuum_cost_page_hit,1,"",1, 291 | vacuum_cost_page_miss,10,"",10, 292 | vacuum_defer_cleanup_age,0,"",0, 293 | vacuum_freeze_min_age,50000000,"",50000000, 294 | vacuum_freeze_table_age,150000000,"",150000000, 295 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 296 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 297 | wal_block_size,8192,"",8192, 298 | wal_buffers,512,4096 kB,-1,8kB 299 | wal_compression,off,"",off, 300 | wal_consistency_checking,"","","", 301 | wal_init_zero,on,"",on, 302 | wal_keep_segments,0,"",0, 303 | wal_level,replica,"",replica, 304 | wal_log_hints,off,"",off, 305 | wal_receiver_status_interval,10,"",10,s 306 | wal_receiver_timeout,60000,"",60000,ms 307 | wal_recycle,on,"",on, 308 | wal_retrieve_retry_interval,5000,"",5000,ms 309 | wal_segment_size,16777216,"",16777216,B 310 | wal_sender_timeout,60000,"",60000,ms 311 | wal_sync_method,fdatasync,"",fdatasync, 312 | wal_writer_delay,200,"",200,ms 313 | wal_writer_flush_after,128,1024 kB,128,8kB 314 | work_mem,4096,4096 kB,4096,kB 315 | xmlbinary,base64,"",base64, 316 | xmloption,content,"",content, 317 | zero_damaged_pages,off,"",off, 318 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_13.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_in_place_tablespaces,off,"",off, 3 | allow_system_table_mods,off,"",off, 4 | application_name,psql,"","", 5 | archive_cleanup_command,"","","", 6 | archive_command,(disabled),"","", 7 | archive_mode,off,"",off, 8 | archive_timeout,0,"",0,s 9 | array_nulls,on,"",on, 10 | authentication_timeout,60,"",60,s 11 | autovacuum,on,"",on, 12 | autovacuum_analyze_scale_factor,0.1,"",0.1, 13 | autovacuum_analyze_threshold,50,"",50, 14 | autovacuum_freeze_max_age,200000000,"",200000000, 15 | autovacuum_max_workers,3,"",3, 16 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 17 | autovacuum_naptime,60,"",60,s 18 | autovacuum_vacuum_cost_delay,2,"",2,ms 19 | autovacuum_vacuum_cost_limit,-1,"",-1, 20 | autovacuum_vacuum_insert_scale_factor,0.2,"",0.2, 21 | autovacuum_vacuum_insert_threshold,1000,"",1000, 22 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 23 | autovacuum_vacuum_threshold,50,"",50, 24 | autovacuum_work_mem,-1,"",-1,kB 25 | backend_flush_after,0,0 bytes,0,8kB 26 | backslash_quote,safe_encoding,"",safe_encoding, 27 | backtrace_functions,"","","", 28 | bgwriter_delay,200,"",200,ms 29 | bgwriter_flush_after,64,512 kB,64,8kB 30 | bgwriter_lru_maxpages,100,"",100, 31 | bgwriter_lru_multiplier,2,"",2, 32 | block_size,8192,"",8192, 33 | bonjour,off,"",off, 34 | bonjour_name,"","","", 35 | bytea_output,hex,"",hex, 36 | check_function_bodies,on,"",on, 37 | checkpoint_completion_target,0.5,"",0.5, 38 | checkpoint_flush_after,32,256 kB,32,8kB 39 | checkpoint_timeout,300,"",300,s 40 | checkpoint_warning,30,"",30,s 41 | client_encoding,SQL_ASCII,"",SQL_ASCII, 42 | client_min_messages,notice,"",notice, 43 | cluster_name,"","","", 44 | commit_delay,0,"",0, 45 | commit_siblings,5,"",5, 46 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 47 | constraint_exclusion,partition,"",partition, 48 | cpu_index_tuple_cost,0.005,"",0.005, 49 | cpu_operator_cost,0.0025,"",0.0025, 50 | cpu_tuple_cost,0.01,"",0.01, 51 | cursor_tuple_fraction,0.1,"",0.1, 52 | data_checksums,off,"",off, 53 | data_directory,/var/lib/postgresql/data,"",, 54 | data_directory_mode,0700,"",448, 55 | data_sync_retry,off,"",off, 56 | DateStyle,"ISO, MDY","","ISO, MDY", 57 | db_user_namespace,off,"",off, 58 | deadlock_timeout,1000,"",1000,ms 59 | debug_assertions,off,"",off, 60 | debug_pretty_print,on,"",on, 61 | debug_print_parse,off,"",off, 62 | debug_print_plan,off,"",off, 63 | debug_print_rewritten,off,"",off, 64 | default_statistics_target,100,"",100, 65 | default_table_access_method,heap,"",heap, 66 | default_tablespace,"","","", 67 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 68 | default_transaction_deferrable,off,"",off, 69 | default_transaction_isolation,read committed,"",read committed, 70 | default_transaction_read_only,off,"",off, 71 | dynamic_library_path,$libdir,"",$libdir, 72 | dynamic_shared_memory_type,posix,"",posix, 73 | effective_cache_size,524288,4096 MB,524288,8kB 74 | effective_io_concurrency,1,"",1, 75 | enable_bitmapscan,on,"",on, 76 | enable_gathermerge,on,"",on, 77 | enable_hashagg,on,"",on, 78 | enable_hashjoin,on,"",on, 79 | enable_incremental_sort,on,"",on, 80 | enable_indexonlyscan,on,"",on, 81 | enable_indexscan,on,"",on, 82 | enable_material,on,"",on, 83 | enable_mergejoin,on,"",on, 84 | enable_nestloop,on,"",on, 85 | enable_parallel_append,on,"",on, 86 | enable_parallel_hash,on,"",on, 87 | enable_partition_pruning,on,"",on, 88 | enable_partitionwise_aggregate,off,"",off, 89 | enable_partitionwise_join,off,"",off, 90 | enable_seqscan,on,"",on, 91 | enable_sort,on,"",on, 92 | enable_tidscan,on,"",on, 93 | escape_string_warning,on,"",on, 94 | event_source,PostgreSQL,"",PostgreSQL, 95 | exit_on_error,off,"",off, 96 | extension_destdir,"","","", 97 | external_pid_file,"","",, 98 | extra_float_digits,1,"",1, 99 | force_parallel_mode,off,"",off, 100 | from_collapse_limit,8,"",8, 101 | fsync,on,"",on, 102 | full_page_writes,on,"",on, 103 | geqo,on,"",on, 104 | geqo_effort,5,"",5, 105 | geqo_generations,0,"",0, 106 | geqo_pool_size,0,"",0, 107 | geqo_seed,0,"",0, 108 | geqo_selection_bias,2,"",2, 109 | geqo_threshold,12,"",12, 110 | gin_fuzzy_search_limit,0,"",0, 111 | gin_pending_list_limit,4096,4096 kB,4096,kB 112 | hash_mem_multiplier,1,"",1, 113 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 114 | hot_standby,on,"",on, 115 | hot_standby_feedback,off,"",off, 116 | huge_pages,try,"",try, 117 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 118 | idle_in_transaction_session_timeout,0,"",0,ms 119 | ignore_checksum_failure,off,"",off, 120 | ignore_invalid_pages,off,"",off, 121 | ignore_system_indexes,off,"",off, 122 | integer_datetimes,on,"",on, 123 | IntervalStyle,postgres,"",postgres, 124 | jit,on,"",on, 125 | jit_above_cost,100000,"",100000, 126 | jit_debugging_support,off,"",off, 127 | jit_dump_bitcode,off,"",off, 128 | jit_expressions,on,"",on, 129 | jit_inline_above_cost,500000,"",500000, 130 | jit_optimize_above_cost,500000,"",500000, 131 | jit_profiling_support,off,"",off, 132 | jit_provider,llvmjit,"",llvmjit, 133 | jit_tuple_deforming,on,"",on, 134 | join_collapse_limit,8,"",8, 135 | krb_caseins_users,off,"",off, 136 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 137 | lc_collate,en_US.utf8,"",C, 138 | lc_ctype,en_US.utf8,"",C, 139 | lc_messages,en_US.utf8,"","", 140 | lc_monetary,en_US.utf8,"",C, 141 | lc_numeric,en_US.utf8,"",C, 142 | lc_time,en_US.utf8,"",C, 143 | listen_addresses,*,"",localhost, 144 | local_preload_libraries,"","","", 145 | lock_timeout,0,"",0,ms 146 | lo_compat_privileges,off,"",off, 147 | log_autovacuum_min_duration,-1,"",-1,ms 148 | log_checkpoints,off,"",off, 149 | log_connections,off,"",off, 150 | log_destination,stderr,"",stderr, 151 | log_directory,log,"",log, 152 | log_disconnections,off,"",off, 153 | log_duration,off,"",off, 154 | log_error_verbosity,default,"",default, 155 | log_executor_stats,off,"",off, 156 | log_file_mode,0600,"",384, 157 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 158 | logging_collector,off,"",off, 159 | log_hostname,off,"",off, 160 | logical_decoding_work_mem,65536,64 MB,65536,kB 161 | log_line_prefix,%m [%p] ,"",%m [%p] , 162 | log_lock_waits,off,"",off, 163 | log_min_duration_sample,-1,"",-1,ms 164 | log_min_duration_statement,-1,"",-1,ms 165 | log_min_error_statement,error,"",error, 166 | log_min_messages,warning,"",warning, 167 | log_parameter_max_length,-1,"",-1,B 168 | log_parameter_max_length_on_error,0,"",0,B 169 | log_parser_stats,off,"",off, 170 | log_planner_stats,off,"",off, 171 | log_replication_commands,off,"",off, 172 | log_rotation_age,1440,"",1440,min 173 | log_rotation_size,10240,10 MB,10240,kB 174 | log_statement,none,"",none, 175 | log_statement_sample_rate,1,"",1, 176 | log_statement_stats,off,"",off, 177 | log_temp_files,-1,"",-1,kB 178 | log_timezone,Etc/UTC,"",GMT, 179 | log_transaction_sample_rate,0,"",0, 180 | log_truncate_on_rotation,off,"",off, 181 | maintenance_io_concurrency,10,"",10, 182 | maintenance_work_mem,65536,64 MB,65536,kB 183 | max_connections,100,"",100, 184 | max_files_per_process,1000,"",1000, 185 | max_function_args,100,"",100, 186 | max_identifier_length,63,"",63, 187 | max_index_keys,32,"",32, 188 | max_locks_per_transaction,64,"",64, 189 | max_logical_replication_workers,4,"",4, 190 | max_parallel_maintenance_workers,2,"",2, 191 | max_parallel_workers,8,"",8, 192 | max_parallel_workers_per_gather,2,"",2, 193 | max_pred_locks_per_page,2,"",2, 194 | max_pred_locks_per_relation,-2,"",-2, 195 | max_pred_locks_per_transaction,64,"",64, 196 | max_prepared_transactions,0,"",0, 197 | max_replication_slots,10,"",10, 198 | max_slot_wal_keep_size,-1,"",-1,MB 199 | max_stack_depth,2048,2048 kB,100,kB 200 | max_standby_archive_delay,30000,"",30000,ms 201 | max_standby_streaming_delay,30000,"",30000,ms 202 | max_sync_workers_per_subscription,2,"",2, 203 | max_wal_senders,10,"",10, 204 | max_wal_size,1024,"",1024,MB 205 | max_worker_processes,8,"",8, 206 | min_parallel_index_scan_size,64,512 kB,64,8kB 207 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 208 | min_wal_size,80,"",80,MB 209 | old_snapshot_threshold,-1,"",-1,min 210 | operator_precedence_warning,off,"",off, 211 | parallel_leader_participation,on,"",on, 212 | parallel_setup_cost,1000,"",1000, 213 | parallel_tuple_cost,0.1,"",0.1, 214 | password_encryption,md5,"",md5, 215 | plan_cache_mode,auto,"",auto, 216 | port,5432,"",5432, 217 | post_auth_delay,0,"",0,s 218 | pre_auth_delay,0,"",0,s 219 | primary_conninfo,"","","", 220 | primary_slot_name,"","","", 221 | promote_trigger_file,"","","", 222 | quote_all_identifiers,off,"",off, 223 | random_page_cost,4,"",4, 224 | recovery_end_command,"","","", 225 | recovery_min_apply_delay,0,"",0,ms 226 | recovery_target,"","","", 227 | recovery_target_action,pause,"",pause, 228 | recovery_target_inclusive,on,"",on, 229 | recovery_target_lsn,"","","", 230 | recovery_target_name,"","","", 231 | recovery_target_time,"","","", 232 | recovery_target_timeline,latest,"",latest, 233 | recovery_target_xid,"","","", 234 | restart_after_crash,on,"",on, 235 | restore_command,"","","", 236 | row_security,on,"",on, 237 | search_path,"""$user"", public","","""$user"", public", 238 | segment_size,131072,1024 MB,131072,8kB 239 | seq_page_cost,1,"",1, 240 | server_encoding,UTF8,"",SQL_ASCII, 241 | server_version,13.8 (Debian 13.8-1.pgdg110+1),"",13.8 (Debian 13.8-1.pgdg110+1), 242 | server_version_num,130008,"",130008, 243 | session_preload_libraries,"","","", 244 | session_replication_role,origin,"",origin, 245 | shared_buffers,16384,128 MB,1024,8kB 246 | shared_memory_type,mmap,"",mmap, 247 | shared_preload_libraries,"","","", 248 | ssl,off,"",off, 249 | ssl_ca_file,"","","", 250 | ssl_cert_file,server.crt,"",server.crt, 251 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 252 | ssl_crl_file,"","","", 253 | ssl_dh_params_file,"","","", 254 | ssl_ecdh_curve,prime256v1,"",prime256v1, 255 | ssl_key_file,server.key,"",server.key, 256 | ssl_library,OpenSSL,"",OpenSSL, 257 | ssl_max_protocol_version,"","","", 258 | ssl_min_protocol_version,TLSv1.2,"",TLSv1.2, 259 | ssl_passphrase_command,"","","", 260 | ssl_passphrase_command_supports_reload,off,"",off, 261 | ssl_prefer_server_ciphers,on,"",on, 262 | standard_conforming_strings,on,"",on, 263 | statement_timeout,0,"",0,ms 264 | stats_temp_directory,pg_stat_tmp,"",pg_stat_tmp, 265 | superuser_reserved_connections,3,"",3, 266 | synchronize_seqscans,on,"",on, 267 | synchronous_commit,on,"",on, 268 | synchronous_standby_names,"","","", 269 | syslog_facility,local0,"",local0, 270 | syslog_ident,postgres,"",postgres, 271 | syslog_sequence_numbers,on,"",on, 272 | syslog_split_messages,on,"",on, 273 | tcp_keepalives_count,0,"",0, 274 | tcp_keepalives_idle,0,"",0,s 275 | tcp_keepalives_interval,0,"",0,s 276 | tcp_user_timeout,0,"",0,ms 277 | temp_buffers,1024,8192 kB,1024,8kB 278 | temp_file_limit,-1,"",-1,kB 279 | temp_tablespaces,"","","", 280 | TimeZone,Etc/UTC,"",GMT, 281 | timezone_abbreviations,Default,"",, 282 | trace_notify,off,"",off, 283 | trace_recovery_messages,log,"",log, 284 | trace_sort,off,"",off, 285 | track_activities,on,"",on, 286 | track_activity_query_size,1024,"",1024,B 287 | track_commit_timestamp,off,"",off, 288 | track_counts,on,"",on, 289 | track_functions,none,"",none, 290 | track_io_timing,off,"",off, 291 | transaction_deferrable,off,"",off, 292 | transaction_isolation,read committed,"",read committed, 293 | transaction_read_only,off,"",off, 294 | transform_null_equals,off,"",off, 295 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 296 | unix_socket_group,"","","", 297 | unix_socket_permissions,0777,"",511, 298 | update_process_title,on,"",on, 299 | vacuum_cleanup_index_scale_factor,0.1,"",0.1, 300 | vacuum_cost_delay,0,"",0,ms 301 | vacuum_cost_limit,200,"",200, 302 | vacuum_cost_page_dirty,20,"",20, 303 | vacuum_cost_page_hit,1,"",1, 304 | vacuum_cost_page_miss,10,"",10, 305 | vacuum_defer_cleanup_age,0,"",0, 306 | vacuum_freeze_min_age,50000000,"",50000000, 307 | vacuum_freeze_table_age,150000000,"",150000000, 308 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 309 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 310 | wal_block_size,8192,"",8192, 311 | wal_buffers,512,4096 kB,-1,8kB 312 | wal_compression,off,"",off, 313 | wal_consistency_checking,"","","", 314 | wal_init_zero,on,"",on, 315 | wal_keep_size,0,"",0,MB 316 | wal_level,replica,"",replica, 317 | wal_log_hints,off,"",off, 318 | wal_receiver_create_temp_slot,off,"",off, 319 | wal_receiver_status_interval,10,"",10,s 320 | wal_receiver_timeout,60000,"",60000,ms 321 | wal_recycle,on,"",on, 322 | wal_retrieve_retry_interval,5000,"",5000,ms 323 | wal_segment_size,16777216,"",16777216,B 324 | wal_sender_timeout,60000,"",60000,ms 325 | wal_skip_threshold,2048,2048 kB,2048,kB 326 | wal_sync_method,fdatasync,"",fdatasync, 327 | wal_writer_delay,200,"",200,ms 328 | wal_writer_flush_after,128,1024 kB,128,8kB 329 | work_mem,4096,4096 kB,4096,kB 330 | xmlbinary,base64,"",base64, 331 | xmloption,content,"",content, 332 | zero_damaged_pages,off,"",off, 333 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_14.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_in_place_tablespaces,off,"",off, 3 | allow_system_table_mods,off,"",off, 4 | application_name,psql,"","", 5 | archive_cleanup_command,"","","", 6 | archive_command,(disabled),"","", 7 | archive_mode,off,"",off, 8 | archive_timeout,0,"",0,s 9 | array_nulls,on,"",on, 10 | authentication_timeout,60,"",60,s 11 | autovacuum,on,"",on, 12 | autovacuum_analyze_scale_factor,0.1,"",0.1, 13 | autovacuum_analyze_threshold,50,"",50, 14 | autovacuum_freeze_max_age,200000000,"",200000000, 15 | autovacuum_max_workers,3,"",3, 16 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 17 | autovacuum_naptime,60,"",60,s 18 | autovacuum_vacuum_cost_delay,2,"",2,ms 19 | autovacuum_vacuum_cost_limit,-1,"",-1, 20 | autovacuum_vacuum_insert_scale_factor,0.2,"",0.2, 21 | autovacuum_vacuum_insert_threshold,1000,"",1000, 22 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 23 | autovacuum_vacuum_threshold,50,"",50, 24 | autovacuum_work_mem,-1,"",-1,kB 25 | backend_flush_after,0,0 bytes,0,8kB 26 | backslash_quote,safe_encoding,"",safe_encoding, 27 | backtrace_functions,"","","", 28 | bgwriter_delay,200,"",200,ms 29 | bgwriter_flush_after,64,512 kB,64,8kB 30 | bgwriter_lru_maxpages,100,"",100, 31 | bgwriter_lru_multiplier,2,"",2, 32 | block_size,8192,"",8192, 33 | bonjour,off,"",off, 34 | bonjour_name,"","","", 35 | bytea_output,hex,"",hex, 36 | check_function_bodies,on,"",on, 37 | checkpoint_completion_target,0.9,"",0.9, 38 | checkpoint_flush_after,32,256 kB,32,8kB 39 | checkpoint_timeout,300,"",300,s 40 | checkpoint_warning,30,"",30,s 41 | client_connection_check_interval,0,"",0,ms 42 | client_encoding,SQL_ASCII,"",SQL_ASCII, 43 | client_min_messages,notice,"",notice, 44 | cluster_name,"","","", 45 | commit_delay,0,"",0, 46 | commit_siblings,5,"",5, 47 | compute_query_id,auto,"",auto, 48 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 49 | constraint_exclusion,partition,"",partition, 50 | cpu_index_tuple_cost,0.005,"",0.005, 51 | cpu_operator_cost,0.0025,"",0.0025, 52 | cpu_tuple_cost,0.01,"",0.01, 53 | cursor_tuple_fraction,0.1,"",0.1, 54 | data_checksums,off,"",off, 55 | data_directory,/var/lib/postgresql/data,"",, 56 | data_directory_mode,0700,"",448, 57 | data_sync_retry,off,"",off, 58 | DateStyle,"ISO, MDY","","ISO, MDY", 59 | db_user_namespace,off,"",off, 60 | deadlock_timeout,1000,"",1000,ms 61 | debug_assertions,off,"",off, 62 | debug_discard_caches,0,"",0, 63 | debug_pretty_print,on,"",on, 64 | debug_print_parse,off,"",off, 65 | debug_print_plan,off,"",off, 66 | debug_print_rewritten,off,"",off, 67 | default_statistics_target,100,"",100, 68 | default_table_access_method,heap,"",heap, 69 | default_tablespace,"","","", 70 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 71 | default_toast_compression,pglz,"",pglz, 72 | default_transaction_deferrable,off,"",off, 73 | default_transaction_isolation,read committed,"",read committed, 74 | default_transaction_read_only,off,"",off, 75 | dynamic_library_path,$libdir,"",$libdir, 76 | dynamic_shared_memory_type,posix,"",posix, 77 | effective_cache_size,524288,4096 MB,524288,8kB 78 | effective_io_concurrency,1,"",1, 79 | enable_async_append,on,"",on, 80 | enable_bitmapscan,on,"",on, 81 | enable_gathermerge,on,"",on, 82 | enable_hashagg,on,"",on, 83 | enable_hashjoin,on,"",on, 84 | enable_incremental_sort,on,"",on, 85 | enable_indexonlyscan,on,"",on, 86 | enable_indexscan,on,"",on, 87 | enable_material,on,"",on, 88 | enable_memoize,on,"",on, 89 | enable_mergejoin,on,"",on, 90 | enable_nestloop,on,"",on, 91 | enable_parallel_append,on,"",on, 92 | enable_parallel_hash,on,"",on, 93 | enable_partition_pruning,on,"",on, 94 | enable_partitionwise_aggregate,off,"",off, 95 | enable_partitionwise_join,off,"",off, 96 | enable_seqscan,on,"",on, 97 | enable_sort,on,"",on, 98 | enable_tidscan,on,"",on, 99 | escape_string_warning,on,"",on, 100 | event_source,PostgreSQL,"",PostgreSQL, 101 | exit_on_error,off,"",off, 102 | extension_destdir,"","","", 103 | external_pid_file,"","",, 104 | extra_float_digits,1,"",1, 105 | force_parallel_mode,off,"",off, 106 | from_collapse_limit,8,"",8, 107 | fsync,on,"",on, 108 | full_page_writes,on,"",on, 109 | geqo,on,"",on, 110 | geqo_effort,5,"",5, 111 | geqo_generations,0,"",0, 112 | geqo_pool_size,0,"",0, 113 | geqo_seed,0,"",0, 114 | geqo_selection_bias,2,"",2, 115 | geqo_threshold,12,"",12, 116 | gin_fuzzy_search_limit,0,"",0, 117 | gin_pending_list_limit,4096,4096 kB,4096,kB 118 | hash_mem_multiplier,1,"",1, 119 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 120 | hot_standby,on,"",on, 121 | hot_standby_feedback,off,"",off, 122 | huge_pages,try,"",try, 123 | huge_page_size,0,0 bytes,0,kB 124 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 125 | idle_in_transaction_session_timeout,0,"",0,ms 126 | idle_session_timeout,0,"",0,ms 127 | ignore_checksum_failure,off,"",off, 128 | ignore_invalid_pages,off,"",off, 129 | ignore_system_indexes,off,"",off, 130 | in_hot_standby,off,"",off, 131 | integer_datetimes,on,"",on, 132 | IntervalStyle,postgres,"",postgres, 133 | jit,on,"",on, 134 | jit_above_cost,100000,"",100000, 135 | jit_debugging_support,off,"",off, 136 | jit_dump_bitcode,off,"",off, 137 | jit_expressions,on,"",on, 138 | jit_inline_above_cost,500000,"",500000, 139 | jit_optimize_above_cost,500000,"",500000, 140 | jit_profiling_support,off,"",off, 141 | jit_provider,llvmjit,"",llvmjit, 142 | jit_tuple_deforming,on,"",on, 143 | join_collapse_limit,8,"",8, 144 | krb_caseins_users,off,"",off, 145 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 146 | lc_collate,en_US.utf8,"",C, 147 | lc_ctype,en_US.utf8,"",C, 148 | lc_messages,en_US.utf8,"","", 149 | lc_monetary,en_US.utf8,"",C, 150 | lc_numeric,en_US.utf8,"",C, 151 | lc_time,en_US.utf8,"",C, 152 | listen_addresses,*,"",localhost, 153 | local_preload_libraries,"","","", 154 | lock_timeout,0,"",0,ms 155 | lo_compat_privileges,off,"",off, 156 | log_autovacuum_min_duration,-1,"",-1,ms 157 | log_checkpoints,off,"",off, 158 | log_connections,off,"",off, 159 | log_destination,stderr,"",stderr, 160 | log_directory,log,"",log, 161 | log_disconnections,off,"",off, 162 | log_duration,off,"",off, 163 | log_error_verbosity,default,"",default, 164 | log_executor_stats,off,"",off, 165 | log_file_mode,0600,"",384, 166 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 167 | logging_collector,off,"",off, 168 | log_hostname,off,"",off, 169 | logical_decoding_work_mem,65536,64 MB,65536,kB 170 | log_line_prefix,%m [%p] ,"",%m [%p] , 171 | log_lock_waits,off,"",off, 172 | log_min_duration_sample,-1,"",-1,ms 173 | log_min_duration_statement,-1,"",-1,ms 174 | log_min_error_statement,error,"",error, 175 | log_min_messages,warning,"",warning, 176 | log_parameter_max_length,-1,"",-1,B 177 | log_parameter_max_length_on_error,0,"",0,B 178 | log_parser_stats,off,"",off, 179 | log_planner_stats,off,"",off, 180 | log_recovery_conflict_waits,off,"",off, 181 | log_replication_commands,off,"",off, 182 | log_rotation_age,1440,"",1440,min 183 | log_rotation_size,10240,10 MB,10240,kB 184 | log_statement,none,"",none, 185 | log_statement_sample_rate,1,"",1, 186 | log_statement_stats,off,"",off, 187 | log_temp_files,-1,"",-1,kB 188 | log_timezone,Etc/UTC,"",GMT, 189 | log_transaction_sample_rate,0,"",0, 190 | log_truncate_on_rotation,off,"",off, 191 | maintenance_io_concurrency,10,"",10, 192 | maintenance_work_mem,65536,64 MB,65536,kB 193 | max_connections,100,"",100, 194 | max_files_per_process,1000,"",1000, 195 | max_function_args,100,"",100, 196 | max_identifier_length,63,"",63, 197 | max_index_keys,32,"",32, 198 | max_locks_per_transaction,64,"",64, 199 | max_logical_replication_workers,4,"",4, 200 | max_parallel_maintenance_workers,2,"",2, 201 | max_parallel_workers,8,"",8, 202 | max_parallel_workers_per_gather,2,"",2, 203 | max_pred_locks_per_page,2,"",2, 204 | max_pred_locks_per_relation,-2,"",-2, 205 | max_pred_locks_per_transaction,64,"",64, 206 | max_prepared_transactions,0,"",0, 207 | max_replication_slots,10,"",10, 208 | max_slot_wal_keep_size,-1,"",-1,MB 209 | max_stack_depth,2048,2048 kB,100,kB 210 | max_standby_archive_delay,30000,"",30000,ms 211 | max_standby_streaming_delay,30000,"",30000,ms 212 | max_sync_workers_per_subscription,2,"",2, 213 | max_wal_senders,10,"",10, 214 | max_wal_size,1024,"",1024,MB 215 | max_worker_processes,8,"",8, 216 | min_dynamic_shared_memory,0,"",0,MB 217 | min_parallel_index_scan_size,64,512 kB,64,8kB 218 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 219 | min_wal_size,80,"",80,MB 220 | old_snapshot_threshold,-1,"",-1,min 221 | parallel_leader_participation,on,"",on, 222 | parallel_setup_cost,1000,"",1000, 223 | parallel_tuple_cost,0.1,"",0.1, 224 | password_encryption,scram-sha-256,"",scram-sha-256, 225 | plan_cache_mode,auto,"",auto, 226 | port,5432,"",5432, 227 | post_auth_delay,0,"",0,s 228 | pre_auth_delay,0,"",0,s 229 | primary_conninfo,"","","", 230 | primary_slot_name,"","","", 231 | promote_trigger_file,"","","", 232 | quote_all_identifiers,off,"",off, 233 | random_page_cost,4,"",4, 234 | recovery_end_command,"","","", 235 | recovery_init_sync_method,fsync,"",fsync, 236 | recovery_min_apply_delay,0,"",0,ms 237 | recovery_target,"","","", 238 | recovery_target_action,pause,"",pause, 239 | recovery_target_inclusive,on,"",on, 240 | recovery_target_lsn,"","","", 241 | recovery_target_name,"","","", 242 | recovery_target_time,"","","", 243 | recovery_target_timeline,latest,"",latest, 244 | recovery_target_xid,"","","", 245 | remove_temp_files_after_crash,on,"",on, 246 | restart_after_crash,on,"",on, 247 | restore_command,"","","", 248 | row_security,on,"",on, 249 | search_path,"""$user"", public","","""$user"", public", 250 | segment_size,131072,1024 MB,131072,8kB 251 | seq_page_cost,1,"",1, 252 | server_encoding,UTF8,"",SQL_ASCII, 253 | server_version,14.5 (Debian 14.5-2.pgdg110+2),"",14.5 (Debian 14.5-2.pgdg110+2), 254 | server_version_num,140005,"",140005, 255 | session_preload_libraries,"","","", 256 | session_replication_role,origin,"",origin, 257 | shared_buffers,16384,128 MB,1024,8kB 258 | shared_memory_type,mmap,"",mmap, 259 | shared_preload_libraries,"","","", 260 | ssl,off,"",off, 261 | ssl_ca_file,"","","", 262 | ssl_cert_file,server.crt,"",server.crt, 263 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 264 | ssl_crl_dir,"","","", 265 | ssl_crl_file,"","","", 266 | ssl_dh_params_file,"","","", 267 | ssl_ecdh_curve,prime256v1,"",prime256v1, 268 | ssl_key_file,server.key,"",server.key, 269 | ssl_library,OpenSSL,"",OpenSSL, 270 | ssl_max_protocol_version,"","","", 271 | ssl_min_protocol_version,TLSv1.2,"",TLSv1.2, 272 | ssl_passphrase_command,"","","", 273 | ssl_passphrase_command_supports_reload,off,"",off, 274 | ssl_prefer_server_ciphers,on,"",on, 275 | standard_conforming_strings,on,"",on, 276 | statement_timeout,0,"",0,ms 277 | stats_temp_directory,pg_stat_tmp,"",pg_stat_tmp, 278 | superuser_reserved_connections,3,"",3, 279 | synchronize_seqscans,on,"",on, 280 | synchronous_commit,on,"",on, 281 | synchronous_standby_names,"","","", 282 | syslog_facility,local0,"",local0, 283 | syslog_ident,postgres,"",postgres, 284 | syslog_sequence_numbers,on,"",on, 285 | syslog_split_messages,on,"",on, 286 | tcp_keepalives_count,0,"",0, 287 | tcp_keepalives_idle,0,"",0,s 288 | tcp_keepalives_interval,0,"",0,s 289 | tcp_user_timeout,0,"",0,ms 290 | temp_buffers,1024,8192 kB,1024,8kB 291 | temp_file_limit,-1,"",-1,kB 292 | temp_tablespaces,"","","", 293 | TimeZone,Etc/UTC,"",GMT, 294 | timezone_abbreviations,Default,"",, 295 | trace_notify,off,"",off, 296 | trace_recovery_messages,log,"",log, 297 | trace_sort,off,"",off, 298 | track_activities,on,"",on, 299 | track_activity_query_size,1024,"",1024,B 300 | track_commit_timestamp,off,"",off, 301 | track_counts,on,"",on, 302 | track_functions,none,"",none, 303 | track_io_timing,off,"",off, 304 | track_wal_io_timing,off,"",off, 305 | transaction_deferrable,off,"",off, 306 | transaction_isolation,read committed,"",read committed, 307 | transaction_read_only,off,"",off, 308 | transform_null_equals,off,"",off, 309 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 310 | unix_socket_group,"","","", 311 | unix_socket_permissions,0777,"",511, 312 | update_process_title,on,"",on, 313 | vacuum_cost_delay,0,"",0,ms 314 | vacuum_cost_limit,200,"",200, 315 | vacuum_cost_page_dirty,20,"",20, 316 | vacuum_cost_page_hit,1,"",1, 317 | vacuum_cost_page_miss,2,"",2, 318 | vacuum_defer_cleanup_age,0,"",0, 319 | vacuum_failsafe_age,1600000000,"",1600000000, 320 | vacuum_freeze_min_age,50000000,"",50000000, 321 | vacuum_freeze_table_age,150000000,"",150000000, 322 | vacuum_multixact_failsafe_age,1600000000,"",1600000000, 323 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 324 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 325 | wal_block_size,8192,"",8192, 326 | wal_buffers,512,4096 kB,-1,8kB 327 | wal_compression,off,"",off, 328 | wal_consistency_checking,"","","", 329 | wal_init_zero,on,"",on, 330 | wal_keep_size,0,"",0,MB 331 | wal_level,replica,"",replica, 332 | wal_log_hints,off,"",off, 333 | wal_receiver_create_temp_slot,off,"",off, 334 | wal_receiver_status_interval,10,"",10,s 335 | wal_receiver_timeout,60000,"",60000,ms 336 | wal_recycle,on,"",on, 337 | wal_retrieve_retry_interval,5000,"",5000,ms 338 | wal_segment_size,16777216,"",16777216,B 339 | wal_sender_timeout,60000,"",60000,ms 340 | wal_skip_threshold,2048,2048 kB,2048,kB 341 | wal_sync_method,fdatasync,"",fdatasync, 342 | wal_writer_delay,200,"",200,ms 343 | wal_writer_flush_after,128,1024 kB,128,8kB 344 | work_mem,4096,4096 kB,4096,kB 345 | xmlbinary,base64,"",base64, 346 | xmloption,content,"",content, 347 | zero_damaged_pages,off,"",off, 348 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_15.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_in_place_tablespaces,off,"",off, 3 | allow_system_table_mods,off,"",off, 4 | application_name,psql,"","", 5 | archive_cleanup_command,"","","", 6 | archive_command,(disabled),"","", 7 | archive_library,"","","", 8 | archive_mode,off,"",off, 9 | archive_timeout,0,"",0,s 10 | array_nulls,on,"",on, 11 | authentication_timeout,60,"",60,s 12 | autovacuum,on,"",on, 13 | autovacuum_analyze_scale_factor,0.1,"",0.1, 14 | autovacuum_analyze_threshold,50,"",50, 15 | autovacuum_freeze_max_age,200000000,"",200000000, 16 | autovacuum_max_workers,3,"",3, 17 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 18 | autovacuum_naptime,60,"",60,s 19 | autovacuum_vacuum_cost_delay,2,"",2,ms 20 | autovacuum_vacuum_cost_limit,-1,"",-1, 21 | autovacuum_vacuum_insert_scale_factor,0.2,"",0.2, 22 | autovacuum_vacuum_insert_threshold,1000,"",1000, 23 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 24 | autovacuum_vacuum_threshold,50,"",50, 25 | autovacuum_work_mem,-1,"",-1,kB 26 | backend_flush_after,0,0 bytes,0,8kB 27 | backslash_quote,safe_encoding,"",safe_encoding, 28 | backtrace_functions,"","","", 29 | bgwriter_delay,200,"",200,ms 30 | bgwriter_flush_after,64,512 kB,64,8kB 31 | bgwriter_lru_maxpages,100,"",100, 32 | bgwriter_lru_multiplier,2,"",2, 33 | block_size,8192,"",8192, 34 | bonjour,off,"",off, 35 | bonjour_name,"","","", 36 | bytea_output,hex,"",hex, 37 | check_function_bodies,on,"",on, 38 | checkpoint_completion_target,0.9,"",0.9, 39 | checkpoint_flush_after,32,256 kB,32,8kB 40 | checkpoint_timeout,300,"",300,s 41 | checkpoint_warning,30,"",30,s 42 | client_connection_check_interval,0,"",0,ms 43 | client_encoding,SQL_ASCII,"",SQL_ASCII, 44 | client_min_messages,notice,"",notice, 45 | cluster_name,"","","", 46 | commit_delay,0,"",0, 47 | commit_siblings,5,"",5, 48 | compute_query_id,auto,"",auto, 49 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 50 | constraint_exclusion,partition,"",partition, 51 | cpu_index_tuple_cost,0.005,"",0.005, 52 | cpu_operator_cost,0.0025,"",0.0025, 53 | cpu_tuple_cost,0.01,"",0.01, 54 | cursor_tuple_fraction,0.1,"",0.1, 55 | data_checksums,off,"",off, 56 | data_directory,/var/lib/postgresql/data,"",, 57 | data_directory_mode,0700,"",448, 58 | data_sync_retry,off,"",off, 59 | DateStyle,"ISO, MDY","","ISO, MDY", 60 | db_user_namespace,off,"",off, 61 | deadlock_timeout,1000,"",1000,ms 62 | debug_assertions,off,"",off, 63 | debug_discard_caches,0,"",0, 64 | debug_pretty_print,on,"",on, 65 | debug_print_parse,off,"",off, 66 | debug_print_plan,off,"",off, 67 | debug_print_rewritten,off,"",off, 68 | default_statistics_target,100,"",100, 69 | default_table_access_method,heap,"",heap, 70 | default_tablespace,"","","", 71 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 72 | default_toast_compression,pglz,"",pglz, 73 | default_transaction_deferrable,off,"",off, 74 | default_transaction_isolation,read committed,"",read committed, 75 | default_transaction_read_only,off,"",off, 76 | dynamic_library_path,$libdir,"",$libdir, 77 | dynamic_shared_memory_type,posix,"",posix, 78 | effective_cache_size,524288,4096 MB,524288,8kB 79 | effective_io_concurrency,1,"",1, 80 | enable_async_append,on,"",on, 81 | enable_bitmapscan,on,"",on, 82 | enable_gathermerge,on,"",on, 83 | enable_hashagg,on,"",on, 84 | enable_hashjoin,on,"",on, 85 | enable_incremental_sort,on,"",on, 86 | enable_indexonlyscan,on,"",on, 87 | enable_indexscan,on,"",on, 88 | enable_material,on,"",on, 89 | enable_memoize,on,"",on, 90 | enable_mergejoin,on,"",on, 91 | enable_nestloop,on,"",on, 92 | enable_parallel_append,on,"",on, 93 | enable_parallel_hash,on,"",on, 94 | enable_partition_pruning,on,"",on, 95 | enable_partitionwise_aggregate,off,"",off, 96 | enable_partitionwise_join,off,"",off, 97 | enable_seqscan,on,"",on, 98 | enable_sort,on,"",on, 99 | enable_tidscan,on,"",on, 100 | escape_string_warning,on,"",on, 101 | event_source,PostgreSQL,"",PostgreSQL, 102 | exit_on_error,off,"",off, 103 | extension_destdir,"","","", 104 | external_pid_file,"","",, 105 | extra_float_digits,1,"",1, 106 | force_parallel_mode,off,"",off, 107 | from_collapse_limit,8,"",8, 108 | fsync,on,"",on, 109 | full_page_writes,on,"",on, 110 | geqo,on,"",on, 111 | geqo_effort,5,"",5, 112 | geqo_generations,0,"",0, 113 | geqo_pool_size,0,"",0, 114 | geqo_seed,0,"",0, 115 | geqo_selection_bias,2,"",2, 116 | geqo_threshold,12,"",12, 117 | gin_fuzzy_search_limit,0,"",0, 118 | gin_pending_list_limit,4096,4096 kB,4096,kB 119 | hash_mem_multiplier,2,"",2, 120 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 121 | hot_standby,on,"",on, 122 | hot_standby_feedback,off,"",off, 123 | huge_pages,try,"",try, 124 | huge_page_size,0,0 bytes,0,kB 125 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 126 | idle_in_transaction_session_timeout,0,"",0,ms 127 | idle_session_timeout,0,"",0,ms 128 | ignore_checksum_failure,off,"",off, 129 | ignore_invalid_pages,off,"",off, 130 | ignore_system_indexes,off,"",off, 131 | in_hot_standby,off,"",off, 132 | integer_datetimes,on,"",on, 133 | IntervalStyle,postgres,"",postgres, 134 | jit,on,"",on, 135 | jit_above_cost,100000,"",100000, 136 | jit_debugging_support,off,"",off, 137 | jit_dump_bitcode,off,"",off, 138 | jit_expressions,on,"",on, 139 | jit_inline_above_cost,500000,"",500000, 140 | jit_optimize_above_cost,500000,"",500000, 141 | jit_profiling_support,off,"",off, 142 | jit_provider,llvmjit,"",llvmjit, 143 | jit_tuple_deforming,on,"",on, 144 | join_collapse_limit,8,"",8, 145 | krb_caseins_users,off,"",off, 146 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 147 | lc_collate,en_US.utf8,"",C, 148 | lc_ctype,en_US.utf8,"",C, 149 | lc_messages,en_US.utf8,"","", 150 | lc_monetary,en_US.utf8,"",C, 151 | lc_numeric,en_US.utf8,"",C, 152 | lc_time,en_US.utf8,"",C, 153 | listen_addresses,*,"",localhost, 154 | local_preload_libraries,"","","", 155 | lock_timeout,0,"",0,ms 156 | lo_compat_privileges,off,"",off, 157 | log_autovacuum_min_duration,600000,"",600000,ms 158 | log_checkpoints,on,"",on, 159 | log_connections,off,"",off, 160 | log_destination,stderr,"",stderr, 161 | log_directory,log,"",log, 162 | log_disconnections,off,"",off, 163 | log_duration,off,"",off, 164 | log_error_verbosity,default,"",default, 165 | log_executor_stats,off,"",off, 166 | log_file_mode,0600,"",384, 167 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 168 | logging_collector,off,"",off, 169 | log_hostname,off,"",off, 170 | logical_decoding_work_mem,65536,64 MB,65536,kB 171 | log_line_prefix,%m [%p] ,"",%m [%p] , 172 | log_lock_waits,off,"",off, 173 | log_min_duration_sample,-1,"",-1,ms 174 | log_min_duration_statement,-1,"",-1,ms 175 | log_min_error_statement,error,"",error, 176 | log_min_messages,warning,"",warning, 177 | log_parameter_max_length,-1,"",-1,B 178 | log_parameter_max_length_on_error,0,"",0,B 179 | log_parser_stats,off,"",off, 180 | log_planner_stats,off,"",off, 181 | log_recovery_conflict_waits,off,"",off, 182 | log_replication_commands,off,"",off, 183 | log_rotation_age,1440,"",1440,min 184 | log_rotation_size,10240,10 MB,10240,kB 185 | log_startup_progress_interval,10000,"",10000,ms 186 | log_statement,none,"",none, 187 | log_statement_sample_rate,1,"",1, 188 | log_statement_stats,off,"",off, 189 | log_temp_files,-1,"",-1,kB 190 | log_timezone,Etc/UTC,"",GMT, 191 | log_transaction_sample_rate,0,"",0, 192 | log_truncate_on_rotation,off,"",off, 193 | maintenance_io_concurrency,10,"",10, 194 | maintenance_work_mem,65536,64 MB,65536,kB 195 | max_connections,100,"",100, 196 | max_files_per_process,1000,"",1000, 197 | max_function_args,100,"",100, 198 | max_identifier_length,63,"",63, 199 | max_index_keys,32,"",32, 200 | max_locks_per_transaction,64,"",64, 201 | max_logical_replication_workers,4,"",4, 202 | max_parallel_maintenance_workers,2,"",2, 203 | max_parallel_workers,8,"",8, 204 | max_parallel_workers_per_gather,2,"",2, 205 | max_pred_locks_per_page,2,"",2, 206 | max_pred_locks_per_relation,-2,"",-2, 207 | max_pred_locks_per_transaction,64,"",64, 208 | max_prepared_transactions,0,"",0, 209 | max_replication_slots,10,"",10, 210 | max_slot_wal_keep_size,-1,"",-1,MB 211 | max_stack_depth,2048,2048 kB,100,kB 212 | max_standby_archive_delay,30000,"",30000,ms 213 | max_standby_streaming_delay,30000,"",30000,ms 214 | max_sync_workers_per_subscription,2,"",2, 215 | max_wal_senders,10,"",10, 216 | max_wal_size,1024,"",1024,MB 217 | max_worker_processes,8,"",8, 218 | min_dynamic_shared_memory,0,"",0,MB 219 | min_parallel_index_scan_size,64,512 kB,64,8kB 220 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 221 | min_wal_size,80,"",80,MB 222 | old_snapshot_threshold,-1,"",-1,min 223 | parallel_leader_participation,on,"",on, 224 | parallel_setup_cost,1000,"",1000, 225 | parallel_tuple_cost,0.1,"",0.1, 226 | password_encryption,scram-sha-256,"",scram-sha-256, 227 | plan_cache_mode,auto,"",auto, 228 | port,5432,"",5432, 229 | post_auth_delay,0,"",0,s 230 | pre_auth_delay,0,"",0,s 231 | primary_conninfo,"","","", 232 | primary_slot_name,"","","", 233 | promote_trigger_file,"","","", 234 | quote_all_identifiers,off,"",off, 235 | random_page_cost,4,"",4, 236 | recovery_end_command,"","","", 237 | recovery_init_sync_method,fsync,"",fsync, 238 | recovery_min_apply_delay,0,"",0,ms 239 | recovery_prefetch,try,"",try, 240 | recovery_target,"","","", 241 | recovery_target_action,pause,"",pause, 242 | recovery_target_inclusive,on,"",on, 243 | recovery_target_lsn,"","","", 244 | recovery_target_name,"","","", 245 | recovery_target_time,"","","", 246 | recovery_target_timeline,latest,"",latest, 247 | recovery_target_xid,"","","", 248 | recursive_worktable_factor,10,"",10, 249 | remove_temp_files_after_crash,on,"",on, 250 | restart_after_crash,on,"",on, 251 | restore_command,"","","", 252 | row_security,on,"",on, 253 | search_path,"""$user"", public","","""$user"", public", 254 | segment_size,131072,1024 MB,131072,8kB 255 | seq_page_cost,1,"",1, 256 | server_encoding,UTF8,"",SQL_ASCII, 257 | server_version,15.0 (Debian 15.0-1.pgdg110+1),"",15.0 (Debian 15.0-1.pgdg110+1), 258 | server_version_num,150000,"",150000, 259 | session_preload_libraries,"","","", 260 | session_replication_role,origin,"",origin, 261 | shared_buffers,16384,128 MB,16384,8kB 262 | shared_memory_size,143,"",0,MB 263 | shared_memory_size_in_huge_pages,72,"",-1, 264 | shared_memory_type,mmap,"",mmap, 265 | shared_preload_libraries,"","","", 266 | ssl,off,"",off, 267 | ssl_ca_file,"","","", 268 | ssl_cert_file,server.crt,"",server.crt, 269 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 270 | ssl_crl_dir,"","","", 271 | ssl_crl_file,"","","", 272 | ssl_dh_params_file,"","","", 273 | ssl_ecdh_curve,prime256v1,"",prime256v1, 274 | ssl_key_file,server.key,"",server.key, 275 | ssl_library,OpenSSL,"",OpenSSL, 276 | ssl_max_protocol_version,"","","", 277 | ssl_min_protocol_version,TLSv1.2,"",TLSv1.2, 278 | ssl_passphrase_command,"","","", 279 | ssl_passphrase_command_supports_reload,off,"",off, 280 | ssl_prefer_server_ciphers,on,"",on, 281 | standard_conforming_strings,on,"",on, 282 | statement_timeout,0,"",0,ms 283 | stats_fetch_consistency,cache,"",cache, 284 | superuser_reserved_connections,3,"",3, 285 | synchronize_seqscans,on,"",on, 286 | synchronous_commit,on,"",on, 287 | synchronous_standby_names,"","","", 288 | syslog_facility,local0,"",local0, 289 | syslog_ident,postgres,"",postgres, 290 | syslog_sequence_numbers,on,"",on, 291 | syslog_split_messages,on,"",on, 292 | tcp_keepalives_count,0,"",0, 293 | tcp_keepalives_idle,0,"",0,s 294 | tcp_keepalives_interval,0,"",0,s 295 | tcp_user_timeout,0,"",0,ms 296 | temp_buffers,1024,8192 kB,1024,8kB 297 | temp_file_limit,-1,"",-1,kB 298 | temp_tablespaces,"","","", 299 | TimeZone,Etc/UTC,"",GMT, 300 | timezone_abbreviations,Default,"",, 301 | trace_notify,off,"",off, 302 | trace_recovery_messages,log,"",log, 303 | trace_sort,off,"",off, 304 | track_activities,on,"",on, 305 | track_activity_query_size,1024,"",1024,B 306 | track_commit_timestamp,off,"",off, 307 | track_counts,on,"",on, 308 | track_functions,none,"",none, 309 | track_io_timing,off,"",off, 310 | track_wal_io_timing,off,"",off, 311 | transaction_deferrable,off,"",off, 312 | transaction_isolation,read committed,"",read committed, 313 | transaction_read_only,off,"",off, 314 | transform_null_equals,off,"",off, 315 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 316 | unix_socket_group,"","","", 317 | unix_socket_permissions,0777,"",511, 318 | update_process_title,on,"",on, 319 | vacuum_cost_delay,0,"",0,ms 320 | vacuum_cost_limit,200,"",200, 321 | vacuum_cost_page_dirty,20,"",20, 322 | vacuum_cost_page_hit,1,"",1, 323 | vacuum_cost_page_miss,2,"",2, 324 | vacuum_defer_cleanup_age,0,"",0, 325 | vacuum_failsafe_age,1600000000,"",1600000000, 326 | vacuum_freeze_min_age,50000000,"",50000000, 327 | vacuum_freeze_table_age,150000000,"",150000000, 328 | vacuum_multixact_failsafe_age,1600000000,"",1600000000, 329 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 330 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 331 | wal_block_size,8192,"",8192, 332 | wal_buffers,512,4096 kB,-1,8kB 333 | wal_compression,off,"",off, 334 | wal_consistency_checking,"","","", 335 | wal_decode_buffer_size,524288,"",524288,B 336 | wal_init_zero,on,"",on, 337 | wal_keep_size,0,"",0,MB 338 | wal_level,replica,"",replica, 339 | wal_log_hints,off,"",off, 340 | wal_receiver_create_temp_slot,off,"",off, 341 | wal_receiver_status_interval,10,"",10,s 342 | wal_receiver_timeout,60000,"",60000,ms 343 | wal_recycle,on,"",on, 344 | wal_retrieve_retry_interval,5000,"",5000,ms 345 | wal_segment_size,16777216,"",16777216,B 346 | wal_sender_timeout,60000,"",60000,ms 347 | wal_skip_threshold,2048,2048 kB,2048,kB 348 | wal_sync_method,fdatasync,"",fdatasync, 349 | wal_writer_delay,200,"",200,ms 350 | wal_writer_flush_after,128,1024 kB,128,8kB 351 | work_mem,4096,4096 kB,4096,kB 352 | xmlbinary,base64,"",base64, 353 | xmloption,content,"",content, 354 | zero_damaged_pages,off,"",off, 355 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_16.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_in_place_tablespaces,off,"",off, 3 | allow_system_table_mods,off,"",off, 4 | application_name,psql,"","", 5 | archive_cleanup_command,"","","", 6 | archive_command,(disabled),"","", 7 | archive_library,"","","", 8 | archive_mode,off,"",off, 9 | archive_timeout,0,"",0,s 10 | array_nulls,on,"",on, 11 | authentication_timeout,60,"",60,s 12 | autovacuum,on,"",on, 13 | autovacuum_analyze_scale_factor,0.1,"",0.1, 14 | autovacuum_analyze_threshold,50,"",50, 15 | autovacuum_freeze_max_age,200000000,"",200000000, 16 | autovacuum_max_workers,3,"",3, 17 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 18 | autovacuum_naptime,60,"",60,s 19 | autovacuum_vacuum_cost_delay,2,"",2,ms 20 | autovacuum_vacuum_cost_limit,-1,"",-1, 21 | autovacuum_vacuum_insert_scale_factor,0.2,"",0.2, 22 | autovacuum_vacuum_insert_threshold,1000,"",1000, 23 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 24 | autovacuum_vacuum_threshold,50,"",50, 25 | autovacuum_work_mem,-1,"",-1,kB 26 | backend_flush_after,0,0 bytes,0,8kB 27 | backslash_quote,safe_encoding,"",safe_encoding, 28 | backtrace_functions,"","","", 29 | bgwriter_delay,200,"",200,ms 30 | bgwriter_flush_after,64,512 kB,64,8kB 31 | bgwriter_lru_maxpages,100,"",100, 32 | bgwriter_lru_multiplier,2,"",2, 33 | block_size,8192,"",8192, 34 | bonjour,off,"",off, 35 | bonjour_name,"","","", 36 | bytea_output,hex,"",hex, 37 | check_function_bodies,on,"",on, 38 | checkpoint_completion_target,0.9,"",0.9, 39 | checkpoint_flush_after,32,256 kB,32,8kB 40 | checkpoint_timeout,300,"",300,s 41 | checkpoint_warning,30,"",30,s 42 | client_connection_check_interval,0,"",0,ms 43 | client_encoding,SQL_ASCII,"",SQL_ASCII, 44 | client_min_messages,notice,"",notice, 45 | cluster_name,"","","", 46 | commit_delay,0,"",0, 47 | commit_siblings,5,"",5, 48 | compute_query_id,auto,"",auto, 49 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 50 | constraint_exclusion,partition,"",partition, 51 | cpu_index_tuple_cost,0.005,"",0.005, 52 | cpu_operator_cost,0.0025,"",0.0025, 53 | cpu_tuple_cost,0.01,"",0.01, 54 | createrole_self_grant,"","","", 55 | cursor_tuple_fraction,0.1,"",0.1, 56 | data_checksums,off,"",off, 57 | data_directory,/var/lib/postgresql/data,"",, 58 | data_directory_mode,0700,"",448, 59 | data_sync_retry,off,"",off, 60 | DateStyle,"ISO, MDY","","ISO, MDY", 61 | db_user_namespace,off,"",off, 62 | deadlock_timeout,1000,"",1000,ms 63 | debug_assertions,off,"",off, 64 | debug_discard_caches,0,"",0, 65 | debug_io_direct,"","","", 66 | debug_logical_replication_streaming,buffered,"",buffered, 67 | debug_parallel_query,off,"",off, 68 | debug_pretty_print,on,"",on, 69 | debug_print_parse,off,"",off, 70 | debug_print_plan,off,"",off, 71 | debug_print_rewritten,off,"",off, 72 | default_statistics_target,100,"",100, 73 | default_table_access_method,heap,"",heap, 74 | default_tablespace,"","","", 75 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 76 | default_toast_compression,pglz,"",pglz, 77 | default_transaction_deferrable,off,"",off, 78 | default_transaction_isolation,read committed,"",read committed, 79 | default_transaction_read_only,off,"",off, 80 | dynamic_library_path,$libdir,"",$libdir, 81 | dynamic_shared_memory_type,posix,"",posix, 82 | effective_cache_size,524288,4096 MB,524288,8kB 83 | effective_io_concurrency,1,"",1, 84 | enable_async_append,on,"",on, 85 | enable_bitmapscan,on,"",on, 86 | enable_gathermerge,on,"",on, 87 | enable_hashagg,on,"",on, 88 | enable_hashjoin,on,"",on, 89 | enable_incremental_sort,on,"",on, 90 | enable_indexonlyscan,on,"",on, 91 | enable_indexscan,on,"",on, 92 | enable_material,on,"",on, 93 | enable_memoize,on,"",on, 94 | enable_mergejoin,on,"",on, 95 | enable_nestloop,on,"",on, 96 | enable_parallel_append,on,"",on, 97 | enable_parallel_hash,on,"",on, 98 | enable_partition_pruning,on,"",on, 99 | enable_partitionwise_aggregate,off,"",off, 100 | enable_partitionwise_join,off,"",off, 101 | enable_presorted_aggregate,on,"",on, 102 | enable_seqscan,on,"",on, 103 | enable_sort,on,"",on, 104 | enable_tidscan,on,"",on, 105 | escape_string_warning,on,"",on, 106 | event_source,PostgreSQL,"",PostgreSQL, 107 | exit_on_error,off,"",off, 108 | extension_destdir,"","","", 109 | external_pid_file,"","",, 110 | extra_float_digits,1,"",1, 111 | from_collapse_limit,8,"",8, 112 | fsync,on,"",on, 113 | full_page_writes,on,"",on, 114 | geqo,on,"",on, 115 | geqo_effort,5,"",5, 116 | geqo_generations,0,"",0, 117 | geqo_pool_size,0,"",0, 118 | geqo_seed,0,"",0, 119 | geqo_selection_bias,2,"",2, 120 | geqo_threshold,12,"",12, 121 | gin_fuzzy_search_limit,0,"",0, 122 | gin_pending_list_limit,4096,4096 kB,4096,kB 123 | gss_accept_delegation,off,"",off, 124 | hash_mem_multiplier,2,"",2, 125 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 126 | hot_standby,on,"",on, 127 | hot_standby_feedback,off,"",off, 128 | huge_pages,try,"",try, 129 | huge_page_size,0,0 bytes,0,kB 130 | icu_validation_level,warning,"",warning, 131 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 132 | idle_in_transaction_session_timeout,0,"",0,ms 133 | idle_session_timeout,0,"",0,ms 134 | ignore_checksum_failure,off,"",off, 135 | ignore_invalid_pages,off,"",off, 136 | ignore_system_indexes,off,"",off, 137 | in_hot_standby,off,"",off, 138 | integer_datetimes,on,"",on, 139 | IntervalStyle,postgres,"",postgres, 140 | jit,on,"",on, 141 | jit_above_cost,100000,"",100000, 142 | jit_debugging_support,off,"",off, 143 | jit_dump_bitcode,off,"",off, 144 | jit_expressions,on,"",on, 145 | jit_inline_above_cost,500000,"",500000, 146 | jit_optimize_above_cost,500000,"",500000, 147 | jit_profiling_support,off,"",off, 148 | jit_provider,llvmjit,"",llvmjit, 149 | jit_tuple_deforming,on,"",on, 150 | join_collapse_limit,8,"",8, 151 | krb_caseins_users,off,"",off, 152 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 153 | lc_messages,en_US.utf8,"","", 154 | lc_monetary,en_US.utf8,"",C, 155 | lc_numeric,en_US.utf8,"",C, 156 | lc_time,en_US.utf8,"",C, 157 | listen_addresses,*,"",localhost, 158 | local_preload_libraries,"","","", 159 | lock_timeout,0,"",0,ms 160 | lo_compat_privileges,off,"",off, 161 | log_autovacuum_min_duration,600000,"",600000,ms 162 | log_checkpoints,on,"",on, 163 | log_connections,off,"",off, 164 | log_destination,stderr,"",stderr, 165 | log_directory,log,"",log, 166 | log_disconnections,off,"",off, 167 | log_duration,off,"",off, 168 | log_error_verbosity,default,"",default, 169 | log_executor_stats,off,"",off, 170 | log_file_mode,0600,"",384, 171 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 172 | logging_collector,off,"",off, 173 | log_hostname,off,"",off, 174 | logical_decoding_work_mem,65536,64 MB,65536,kB 175 | log_line_prefix,%m [%p] ,"",%m [%p] , 176 | log_lock_waits,off,"",off, 177 | log_min_duration_sample,-1,"",-1,ms 178 | log_min_duration_statement,-1,"",-1,ms 179 | log_min_error_statement,error,"",error, 180 | log_min_messages,warning,"",warning, 181 | log_parameter_max_length,-1,"",-1,B 182 | log_parameter_max_length_on_error,0,"",0,B 183 | log_parser_stats,off,"",off, 184 | log_planner_stats,off,"",off, 185 | log_recovery_conflict_waits,off,"",off, 186 | log_replication_commands,off,"",off, 187 | log_rotation_age,1440,"",1440,min 188 | log_rotation_size,10240,10 MB,10240,kB 189 | log_startup_progress_interval,10000,"",10000,ms 190 | log_statement,none,"",none, 191 | log_statement_sample_rate,1,"",1, 192 | log_statement_stats,off,"",off, 193 | log_temp_files,-1,"",-1,kB 194 | log_timezone,Etc/UTC,"",GMT, 195 | log_transaction_sample_rate,0,"",0, 196 | log_truncate_on_rotation,off,"",off, 197 | maintenance_io_concurrency,10,"",10, 198 | maintenance_work_mem,65536,64 MB,65536,kB 199 | max_connections,100,"",100, 200 | max_files_per_process,1000,"",1000, 201 | max_function_args,100,"",100, 202 | max_identifier_length,63,"",63, 203 | max_index_keys,32,"",32, 204 | max_locks_per_transaction,64,"",64, 205 | max_logical_replication_workers,4,"",4, 206 | max_parallel_apply_workers_per_subscription,2,"",2, 207 | max_parallel_maintenance_workers,2,"",2, 208 | max_parallel_workers,8,"",8, 209 | max_parallel_workers_per_gather,2,"",2, 210 | max_pred_locks_per_page,2,"",2, 211 | max_pred_locks_per_relation,-2,"",-2, 212 | max_pred_locks_per_transaction,64,"",64, 213 | max_prepared_transactions,0,"",0, 214 | max_replication_slots,10,"",10, 215 | max_slot_wal_keep_size,-1,"",-1,MB 216 | max_stack_depth,2048,2048 kB,100,kB 217 | max_standby_archive_delay,30000,"",30000,ms 218 | max_standby_streaming_delay,30000,"",30000,ms 219 | max_sync_workers_per_subscription,2,"",2, 220 | max_wal_senders,10,"",10, 221 | max_wal_size,1024,"",1024,MB 222 | max_worker_processes,8,"",8, 223 | min_dynamic_shared_memory,0,"",0,MB 224 | min_parallel_index_scan_size,64,512 kB,64,8kB 225 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 226 | min_wal_size,80,"",80,MB 227 | old_snapshot_threshold,-1,"",-1,min 228 | parallel_leader_participation,on,"",on, 229 | parallel_setup_cost,1000,"",1000, 230 | parallel_tuple_cost,0.1,"",0.1, 231 | password_encryption,scram-sha-256,"",scram-sha-256, 232 | plan_cache_mode,auto,"",auto, 233 | port,5432,"",5432, 234 | post_auth_delay,0,"",0,s 235 | pre_auth_delay,0,"",0,s 236 | primary_conninfo,"","","", 237 | primary_slot_name,"","","", 238 | quote_all_identifiers,off,"",off, 239 | random_page_cost,4,"",4, 240 | recovery_end_command,"","","", 241 | recovery_init_sync_method,fsync,"",fsync, 242 | recovery_min_apply_delay,0,"",0,ms 243 | recovery_prefetch,try,"",try, 244 | recovery_target,"","","", 245 | recovery_target_action,pause,"",pause, 246 | recovery_target_inclusive,on,"",on, 247 | recovery_target_lsn,"","","", 248 | recovery_target_name,"","","", 249 | recovery_target_time,"","","", 250 | recovery_target_timeline,latest,"",latest, 251 | recovery_target_xid,"","","", 252 | recursive_worktable_factor,10,"",10, 253 | remove_temp_files_after_crash,on,"",on, 254 | reserved_connections,0,"",0, 255 | restart_after_crash,on,"",on, 256 | restore_command,"","","", 257 | row_security,on,"",on, 258 | scram_iterations,4096,"",4096, 259 | search_path,"""$user"", public","","""$user"", public", 260 | segment_size,131072,1024 MB,131072,8kB 261 | send_abort_for_crash,off,"",off, 262 | send_abort_for_kill,off,"",off, 263 | seq_page_cost,1,"",1, 264 | server_encoding,UTF8,"",SQL_ASCII, 265 | server_version,16.0 (Debian 16.0-1.pgdg120+1),"",16.0 (Debian 16.0-1.pgdg120+1), 266 | server_version_num,160000,"",160000, 267 | session_preload_libraries,"","","", 268 | session_replication_role,origin,"",origin, 269 | shared_buffers,16384,128 MB,16384,8kB 270 | shared_memory_size,143,"",0,MB 271 | shared_memory_size_in_huge_pages,72,"",-1, 272 | shared_memory_type,mmap,"",mmap, 273 | shared_preload_libraries,"","","", 274 | ssl,off,"",off, 275 | ssl_ca_file,"","","", 276 | ssl_cert_file,server.crt,"",server.crt, 277 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 278 | ssl_crl_dir,"","","", 279 | ssl_crl_file,"","","", 280 | ssl_dh_params_file,"","","", 281 | ssl_ecdh_curve,prime256v1,"",prime256v1, 282 | ssl_key_file,server.key,"",server.key, 283 | ssl_library,OpenSSL,"",OpenSSL, 284 | ssl_max_protocol_version,"","","", 285 | ssl_min_protocol_version,TLSv1.2,"",TLSv1.2, 286 | ssl_passphrase_command,"","","", 287 | ssl_passphrase_command_supports_reload,off,"",off, 288 | ssl_prefer_server_ciphers,on,"",on, 289 | standard_conforming_strings,on,"",on, 290 | statement_timeout,0,"",0,ms 291 | stats_fetch_consistency,cache,"",cache, 292 | superuser_reserved_connections,3,"",3, 293 | synchronize_seqscans,on,"",on, 294 | synchronous_commit,on,"",on, 295 | synchronous_standby_names,"","","", 296 | syslog_facility,local0,"",local0, 297 | syslog_ident,postgres,"",postgres, 298 | syslog_sequence_numbers,on,"",on, 299 | syslog_split_messages,on,"",on, 300 | tcp_keepalives_count,0,"",0, 301 | tcp_keepalives_idle,0,"",0,s 302 | tcp_keepalives_interval,0,"",0,s 303 | tcp_user_timeout,0,"",0,ms 304 | temp_buffers,1024,8192 kB,1024,8kB 305 | temp_file_limit,-1,"",-1,kB 306 | temp_tablespaces,"","","", 307 | TimeZone,Etc/UTC,"",GMT, 308 | timezone_abbreviations,Default,"",, 309 | trace_notify,off,"",off, 310 | trace_recovery_messages,log,"",log, 311 | trace_sort,off,"",off, 312 | track_activities,on,"",on, 313 | track_activity_query_size,1024,"",1024,B 314 | track_commit_timestamp,off,"",off, 315 | track_counts,on,"",on, 316 | track_functions,none,"",none, 317 | track_io_timing,off,"",off, 318 | track_wal_io_timing,off,"",off, 319 | transaction_deferrable,off,"",off, 320 | transaction_isolation,read committed,"",read committed, 321 | transaction_read_only,off,"",off, 322 | transform_null_equals,off,"",off, 323 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 324 | unix_socket_group,"","","", 325 | unix_socket_permissions,0777,"",511, 326 | update_process_title,on,"",on, 327 | vacuum_buffer_usage_limit,256,256 kB,256,kB 328 | vacuum_cost_delay,0,"",0,ms 329 | vacuum_cost_limit,200,"",200, 330 | vacuum_cost_page_dirty,20,"",20, 331 | vacuum_cost_page_hit,1,"",1, 332 | vacuum_cost_page_miss,2,"",2, 333 | vacuum_failsafe_age,1600000000,"",1600000000, 334 | vacuum_freeze_min_age,50000000,"",50000000, 335 | vacuum_freeze_table_age,150000000,"",150000000, 336 | vacuum_multixact_failsafe_age,1600000000,"",1600000000, 337 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 338 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 339 | wal_block_size,8192,"",8192, 340 | wal_buffers,512,4096 kB,-1,8kB 341 | wal_compression,off,"",off, 342 | wal_consistency_checking,"","","", 343 | wal_decode_buffer_size,524288,"",524288,B 344 | wal_init_zero,on,"",on, 345 | wal_keep_size,0,"",0,MB 346 | wal_level,replica,"",replica, 347 | wal_log_hints,off,"",off, 348 | wal_receiver_create_temp_slot,off,"",off, 349 | wal_receiver_status_interval,10,"",10,s 350 | wal_receiver_timeout,60000,"",60000,ms 351 | wal_recycle,on,"",on, 352 | wal_retrieve_retry_interval,5000,"",5000,ms 353 | wal_segment_size,16777216,"",16777216,B 354 | wal_sender_timeout,60000,"",60000,ms 355 | wal_skip_threshold,2048,2048 kB,2048,kB 356 | wal_sync_method,fdatasync,"",fdatasync, 357 | wal_writer_delay,200,"",200,ms 358 | wal_writer_flush_after,128,1024 kB,128,8kB 359 | work_mem,4096,4096 kB,4096,kB 360 | xmlbinary,base64,"",base64, 361 | xmloption,content,"",content, 362 | zero_damaged_pages,off,"",off, 363 | -------------------------------------------------------------------------------- /pg_configurator/pg_settings_history/settings_pg_17.csv: -------------------------------------------------------------------------------- 1 | name,value,pretty_value,boot_val,unit 2 | allow_alter_system,on,"",on, 3 | allow_in_place_tablespaces,off,"",off, 4 | allow_system_table_mods,off,"",off, 5 | application_name,psql,"","", 6 | archive_cleanup_command,"","","", 7 | archive_command,(disabled),"","", 8 | archive_library,"","","", 9 | archive_mode,off,"",off, 10 | archive_timeout,0,"",0,s 11 | array_nulls,on,"",on, 12 | authentication_timeout,60,"",60,s 13 | autovacuum,on,"",on, 14 | autovacuum_analyze_scale_factor,0.1,"",0.1, 15 | autovacuum_analyze_threshold,50,"",50, 16 | autovacuum_freeze_max_age,200000000,"",200000000, 17 | autovacuum_max_workers,3,"",3, 18 | autovacuum_multixact_freeze_max_age,400000000,"",400000000, 19 | autovacuum_naptime,60,"",60,s 20 | autovacuum_vacuum_cost_delay,2,"",2,ms 21 | autovacuum_vacuum_cost_limit,-1,"",-1, 22 | autovacuum_vacuum_insert_scale_factor,0.2,"",0.2, 23 | autovacuum_vacuum_insert_threshold,1000,"",1000, 24 | autovacuum_vacuum_scale_factor,0.2,"",0.2, 25 | autovacuum_vacuum_threshold,50,"",50, 26 | autovacuum_work_mem,-1,"",-1,kB 27 | backend_flush_after,0,0 bytes,0,8kB 28 | backslash_quote,safe_encoding,"",safe_encoding, 29 | backtrace_functions,"","","", 30 | bgwriter_delay,200,"",200,ms 31 | bgwriter_flush_after,64,512 kB,64,8kB 32 | bgwriter_lru_maxpages,100,"",100, 33 | bgwriter_lru_multiplier,2,"",2, 34 | block_size,8192,"",8192, 35 | bonjour,off,"",off, 36 | bonjour_name,"","","", 37 | bytea_output,hex,"",hex, 38 | check_function_bodies,on,"",on, 39 | checkpoint_completion_target,0.9,"",0.9, 40 | checkpoint_flush_after,32,256 kB,32,8kB 41 | checkpoint_timeout,300,"",300,s 42 | checkpoint_warning,30,"",30,s 43 | client_connection_check_interval,0,"",0,ms 44 | client_encoding,SQL_ASCII,"",SQL_ASCII, 45 | client_min_messages,notice,"",notice, 46 | cluster_name,"","","", 47 | commit_delay,0,"",0, 48 | commit_siblings,5,"",5, 49 | commit_timestamp_buffers,32,256 kB,0,8kB 50 | compute_query_id,auto,"",auto, 51 | config_file,/var/lib/postgresql/data/postgresql.conf,"",, 52 | constraint_exclusion,partition,"",partition, 53 | cpu_index_tuple_cost,0.005,"",0.005, 54 | cpu_operator_cost,0.0025,"",0.0025, 55 | cpu_tuple_cost,0.01,"",0.01, 56 | createrole_self_grant,"","","", 57 | cursor_tuple_fraction,0.1,"",0.1, 58 | data_checksums,off,"",off, 59 | data_directory,/var/lib/postgresql/data,"",, 60 | data_directory_mode,0700,"",448, 61 | data_sync_retry,off,"",off, 62 | DateStyle,"ISO, MDY","","ISO, MDY", 63 | deadlock_timeout,1000,"",1000,ms 64 | debug_assertions,off,"",off, 65 | debug_discard_caches,0,"",0, 66 | debug_io_direct,"","","", 67 | debug_logical_replication_streaming,buffered,"",buffered, 68 | debug_parallel_query,off,"",off, 69 | debug_pretty_print,on,"",on, 70 | debug_print_parse,off,"",off, 71 | debug_print_plan,off,"",off, 72 | debug_print_rewritten,off,"",off, 73 | default_statistics_target,100,"",100, 74 | default_table_access_method,heap,"",heap, 75 | default_tablespace,"","","", 76 | default_text_search_config,pg_catalog.english,"",pg_catalog.simple, 77 | default_toast_compression,pglz,"",pglz, 78 | default_transaction_deferrable,off,"",off, 79 | default_transaction_isolation,read committed,"",read committed, 80 | default_transaction_read_only,off,"",off, 81 | dynamic_library_path,$libdir,"",$libdir, 82 | dynamic_shared_memory_type,posix,"",posix, 83 | effective_cache_size,524288,4096 MB,524288,8kB 84 | effective_io_concurrency,1,"",1, 85 | enable_async_append,on,"",on, 86 | enable_bitmapscan,on,"",on, 87 | enable_gathermerge,on,"",on, 88 | enable_group_by_reordering,on,"",on, 89 | enable_hashagg,on,"",on, 90 | enable_hashjoin,on,"",on, 91 | enable_incremental_sort,on,"",on, 92 | enable_indexonlyscan,on,"",on, 93 | enable_indexscan,on,"",on, 94 | enable_material,on,"",on, 95 | enable_memoize,on,"",on, 96 | enable_mergejoin,on,"",on, 97 | enable_nestloop,on,"",on, 98 | enable_parallel_append,on,"",on, 99 | enable_parallel_hash,on,"",on, 100 | enable_partition_pruning,on,"",on, 101 | enable_partitionwise_aggregate,off,"",off, 102 | enable_partitionwise_join,off,"",off, 103 | enable_presorted_aggregate,on,"",on, 104 | enable_seqscan,on,"",on, 105 | enable_sort,on,"",on, 106 | enable_tidscan,on,"",on, 107 | escape_string_warning,on,"",on, 108 | event_source,PostgreSQL,"",PostgreSQL, 109 | event_triggers,on,"",on, 110 | exit_on_error,off,"",off, 111 | extension_destdir,"","","", 112 | external_pid_file,"","",, 113 | extra_float_digits,1,"",1, 114 | from_collapse_limit,8,"",8, 115 | fsync,on,"",on, 116 | full_page_writes,on,"",on, 117 | geqo,on,"",on, 118 | geqo_effort,5,"",5, 119 | geqo_generations,0,"",0, 120 | geqo_pool_size,0,"",0, 121 | geqo_seed,0,"",0, 122 | geqo_selection_bias,2,"",2, 123 | geqo_threshold,12,"",12, 124 | gin_fuzzy_search_limit,0,"",0, 125 | gin_pending_list_limit,4096,4096 kB,4096,kB 126 | gss_accept_delegation,off,"",off, 127 | hash_mem_multiplier,2,"",2, 128 | hba_file,/var/lib/postgresql/data/pg_hba.conf,"",, 129 | hot_standby,on,"",on, 130 | hot_standby_feedback,off,"",off, 131 | huge_pages,try,"",try, 132 | huge_page_size,0,0 bytes,0,kB 133 | huge_pages_status,off,"",unknown, 134 | icu_validation_level,warning,"",warning, 135 | ident_file,/var/lib/postgresql/data/pg_ident.conf,"",, 136 | idle_in_transaction_session_timeout,0,"",0,ms 137 | idle_session_timeout,0,"",0,ms 138 | ignore_checksum_failure,off,"",off, 139 | ignore_invalid_pages,off,"",off, 140 | ignore_system_indexes,off,"",off, 141 | in_hot_standby,off,"",off, 142 | integer_datetimes,on,"",on, 143 | IntervalStyle,postgres,"",postgres, 144 | io_combine_limit,16,128 kB,16,8kB 145 | jit,on,"",on, 146 | jit_above_cost,100000,"",100000, 147 | jit_debugging_support,off,"",off, 148 | jit_dump_bitcode,off,"",off, 149 | jit_expressions,on,"",on, 150 | jit_inline_above_cost,500000,"",500000, 151 | jit_optimize_above_cost,500000,"",500000, 152 | jit_profiling_support,off,"",off, 153 | jit_provider,llvmjit,"",llvmjit, 154 | jit_tuple_deforming,on,"",on, 155 | join_collapse_limit,8,"",8, 156 | krb_caseins_users,off,"",off, 157 | krb_server_keyfile,FILE:/etc/postgresql-common/krb5.keytab,"",FILE:/etc/postgresql-common/krb5.keytab, 158 | lc_messages,en_US.utf8,"","", 159 | lc_monetary,en_US.utf8,"",C, 160 | lc_numeric,en_US.utf8,"",C, 161 | lc_time,en_US.utf8,"",C, 162 | listen_addresses,*,"",localhost, 163 | local_preload_libraries,"","","", 164 | lock_timeout,0,"",0,ms 165 | lo_compat_privileges,off,"",off, 166 | log_autovacuum_min_duration,600000,"",600000,ms 167 | log_checkpoints,on,"",on, 168 | log_connections,off,"",off, 169 | log_destination,stderr,"",stderr, 170 | log_directory,log,"",log, 171 | log_disconnections,off,"",off, 172 | log_duration,off,"",off, 173 | log_error_verbosity,default,"",default, 174 | log_executor_stats,off,"",off, 175 | log_file_mode,0600,"",384, 176 | log_filename,postgresql-%Y-%m-%d_%H%M%S.log,"",postgresql-%Y-%m-%d_%H%M%S.log, 177 | logging_collector,off,"",off, 178 | log_hostname,off,"",off, 179 | logical_decoding_work_mem,65536,64 MB,65536,kB 180 | log_line_prefix,%m [%p] ,"",%m [%p] , 181 | log_lock_waits,off,"",off, 182 | log_min_duration_sample,-1,"",-1,ms 183 | log_min_duration_statement,-1,"",-1,ms 184 | log_min_error_statement,error,"",error, 185 | log_min_messages,warning,"",warning, 186 | log_parameter_max_length,-1,"",-1,B 187 | log_parameter_max_length_on_error,0,"",0,B 188 | log_parser_stats,off,"",off, 189 | log_planner_stats,off,"",off, 190 | log_recovery_conflict_waits,off,"",off, 191 | log_replication_commands,off,"",off, 192 | log_rotation_age,1440,"",1440,min 193 | log_rotation_size,10240,10 MB,10240,kB 194 | log_startup_progress_interval,10000,"",10000,ms 195 | log_statement,none,"",none, 196 | log_statement_sample_rate,1,"",1, 197 | log_statement_stats,off,"",off, 198 | log_temp_files,-1,"",-1,kB 199 | log_timezone,Etc/UTC,"",GMT, 200 | log_transaction_sample_rate,0,"",0, 201 | log_truncate_on_rotation,off,"",off, 202 | maintenance_io_concurrency,10,"",10, 203 | maintenance_work_mem,65536,64 MB,65536,kB 204 | max_connections,100,"",100, 205 | max_files_per_process,1000,"",1000, 206 | max_function_args,100,"",100, 207 | max_identifier_length,63,"",63, 208 | max_index_keys,32,"",32, 209 | max_locks_per_transaction,64,"",64, 210 | max_logical_replication_workers,4,"",4, 211 | max_notify_queue_pages,1048576,"",1048576, 212 | max_parallel_apply_workers_per_subscription,2,"",2, 213 | max_parallel_maintenance_workers,2,"",2, 214 | max_parallel_workers,8,"",8, 215 | max_parallel_workers_per_gather,2,"",2, 216 | max_pred_locks_per_page,2,"",2, 217 | max_pred_locks_per_relation,-2,"",-2, 218 | max_pred_locks_per_transaction,64,"",64, 219 | max_prepared_transactions,0,"",0, 220 | max_replication_slots,10,"",10, 221 | max_slot_wal_keep_size,-1,"",-1,MB 222 | max_stack_depth,2048,2048 kB,100,kB 223 | max_standby_archive_delay,30000,"",30000,ms 224 | max_standby_streaming_delay,30000,"",30000,ms 225 | max_sync_workers_per_subscription,2,"",2, 226 | max_wal_senders,10,"",10, 227 | max_wal_size,1024,"",1024,MB 228 | max_worker_processes,8,"",8, 229 | min_dynamic_shared_memory,0,"",0,MB 230 | min_parallel_index_scan_size,64,512 kB,64,8kB 231 | min_parallel_table_scan_size,1024,8192 kB,1024,8kB 232 | min_wal_size,80,"",80,MB 233 | multixact_member_buffers,32,256 kB,32,8kB 234 | multixact_offset_buffers,16,128 kB,16,8kB 235 | notify_buffers,16,128 kB,16,8kB 236 | parallel_leader_participation,on,"",on, 237 | parallel_setup_cost,1000,"",1000, 238 | parallel_tuple_cost,0.1,"",0.1, 239 | password_encryption,scram-sha-256,"",scram-sha-256, 240 | plan_cache_mode,auto,"",auto, 241 | port,5432,"",5432, 242 | post_auth_delay,0,"",0,s 243 | pre_auth_delay,0,"",0,s 244 | primary_conninfo,"","","", 245 | primary_slot_name,"","","", 246 | quote_all_identifiers,off,"",off, 247 | random_page_cost,4,"",4, 248 | recovery_end_command,"","","", 249 | recovery_init_sync_method,fsync,"",fsync, 250 | recovery_min_apply_delay,0,"",0,ms 251 | recovery_prefetch,try,"",try, 252 | recovery_target,"","","", 253 | recovery_target_action,pause,"",pause, 254 | recovery_target_inclusive,on,"",on, 255 | recovery_target_lsn,"","","", 256 | recovery_target_name,"","","", 257 | recovery_target_time,"","","", 258 | recovery_target_timeline,latest,"",latest, 259 | recovery_target_xid,"","","", 260 | recursive_worktable_factor,10,"",10, 261 | remove_temp_files_after_crash,on,"",on, 262 | reserved_connections,0,"",0, 263 | restart_after_crash,on,"",on, 264 | restore_command,"","","", 265 | restrict_nonsystem_relation_kind,"","","", 266 | row_security,on,"",on, 267 | scram_iterations,4096,"",4096, 268 | search_path,"""$user"", public","","""$user"", public", 269 | segment_size,131072,1024 MB,131072,8kB 270 | send_abort_for_crash,off,"",off, 271 | send_abort_for_kill,off,"",off, 272 | seq_page_cost,1,"",1, 273 | serializable_buffers,32,256 kB,32,8kB 274 | server_encoding,UTF8,"",SQL_ASCII, 275 | server_version,17.5 (Debian 17.5-1.pgdg120+1),"",17.5 (Debian 17.5-1.pgdg120+1), 276 | server_version_num,170005,"",170005, 277 | session_preload_libraries,"","","", 278 | session_replication_role,origin,"",origin, 279 | shared_buffers,16384,128 MB,16384,8kB 280 | shared_memory_size,143,"",0,MB 281 | shared_memory_size_in_huge_pages,72,"",-1, 282 | shared_memory_type,mmap,"",mmap, 283 | shared_preload_libraries,"","","", 284 | ssl,off,"",off, 285 | ssl_ca_file,"","","", 286 | ssl_cert_file,server.crt,"",server.crt, 287 | ssl_ciphers,HIGH:MEDIUM:+3DES:!aNULL,"",HIGH:MEDIUM:+3DES:!aNULL, 288 | ssl_crl_dir,"","","", 289 | ssl_crl_file,"","","", 290 | ssl_dh_params_file,"","","", 291 | ssl_ecdh_curve,prime256v1,"",prime256v1, 292 | ssl_key_file,server.key,"",server.key, 293 | ssl_library,OpenSSL,"",OpenSSL, 294 | ssl_max_protocol_version,"","","", 295 | ssl_min_protocol_version,TLSv1.2,"",TLSv1.2, 296 | ssl_passphrase_command,"","","", 297 | ssl_passphrase_command_supports_reload,off,"",off, 298 | ssl_prefer_server_ciphers,on,"",on, 299 | standard_conforming_strings,on,"",on, 300 | statement_timeout,0,"",0,ms 301 | stats_fetch_consistency,cache,"",cache, 302 | subtransaction_buffers,32,256 kB,0,8kB 303 | summarize_wal,off,"",off, 304 | superuser_reserved_connections,3,"",3, 305 | synchronized_standby_slots,"","","", 306 | synchronize_seqscans,on,"",on, 307 | synchronous_commit,on,"",on, 308 | synchronous_standby_names,"","","", 309 | sync_replication_slots,off,"",off, 310 | syslog_facility,local0,"",local0, 311 | syslog_ident,postgres,"",postgres, 312 | syslog_sequence_numbers,on,"",on, 313 | syslog_split_messages,on,"",on, 314 | tcp_keepalives_count,0,"",0, 315 | tcp_keepalives_idle,0,"",0,s 316 | tcp_keepalives_interval,0,"",0,s 317 | tcp_user_timeout,0,"",0,ms 318 | temp_buffers,1024,8192 kB,1024,8kB 319 | temp_file_limit,-1,"",-1,kB 320 | temp_tablespaces,"","","", 321 | TimeZone,Etc/UTC,"",GMT, 322 | timezone_abbreviations,Default,"",, 323 | trace_connection_negotiation,off,"",off, 324 | trace_notify,off,"",off, 325 | trace_sort,off,"",off, 326 | track_activities,on,"",on, 327 | track_activity_query_size,1024,"",1024,B 328 | track_commit_timestamp,off,"",off, 329 | track_counts,on,"",on, 330 | track_functions,none,"",none, 331 | track_io_timing,off,"",off, 332 | track_wal_io_timing,off,"",off, 333 | transaction_buffers,32,256 kB,0,8kB 334 | transaction_deferrable,off,"",off, 335 | transaction_isolation,read committed,"",read committed, 336 | transaction_read_only,off,"",off, 337 | transaction_timeout,0,"",0,ms 338 | transform_null_equals,off,"",off, 339 | unix_socket_directories,/var/run/postgresql,"",/var/run/postgresql, 340 | unix_socket_group,"","","", 341 | unix_socket_permissions,0777,"",511, 342 | update_process_title,on,"",on, 343 | vacuum_buffer_usage_limit,2048,2048 kB,2048,kB 344 | vacuum_cost_delay,0,"",0,ms 345 | vacuum_cost_limit,200,"",200, 346 | vacuum_cost_page_dirty,20,"",20, 347 | vacuum_cost_page_hit,1,"",1, 348 | vacuum_cost_page_miss,2,"",2, 349 | vacuum_failsafe_age,1600000000,"",1600000000, 350 | vacuum_freeze_min_age,50000000,"",50000000, 351 | vacuum_freeze_table_age,150000000,"",150000000, 352 | vacuum_multixact_failsafe_age,1600000000,"",1600000000, 353 | vacuum_multixact_freeze_min_age,5000000,"",5000000, 354 | vacuum_multixact_freeze_table_age,150000000,"",150000000, 355 | wal_block_size,8192,"",8192, 356 | wal_buffers,512,4096 kB,-1,8kB 357 | wal_compression,off,"",off, 358 | wal_consistency_checking,"","","", 359 | wal_decode_buffer_size,524288,"",524288,B 360 | wal_init_zero,on,"",on, 361 | wal_keep_size,0,"",0,MB 362 | wal_level,replica,"",replica, 363 | wal_log_hints,off,"",off, 364 | wal_receiver_create_temp_slot,off,"",off, 365 | wal_receiver_status_interval,10,"",10,s 366 | wal_receiver_timeout,60000,"",60000,ms 367 | wal_recycle,on,"",on, 368 | wal_retrieve_retry_interval,5000,"",5000,ms 369 | wal_segment_size,16777216,"",16777216,B 370 | wal_sender_timeout,60000,"",60000,ms 371 | wal_skip_threshold,2048,2048 kB,2048,kB 372 | wal_summary_keep_time,14400,"",14400,min 373 | wal_sync_method,fdatasync,"",fdatasync, 374 | wal_writer_delay,200,"",200,ms 375 | wal_writer_flush_after,128,1024 kB,128,8kB 376 | work_mem,4096,4096 kB,4096,kB 377 | xmlbinary,base64,"",base64, 378 | xmloption,content,"",content, 379 | zero_damaged_pages,off,"",off, 380 | -------------------------------------------------------------------------------- /pg_configurator/conf_perf.py: -------------------------------------------------------------------------------- 1 | perf_alg_set = { 2 | # external pre-calculated vars for algs: 3 | # total_ram_in_bytes 4 | # total_cpu_cores 5 | # maint_max_conns 6 | "9.6": [ 7 | # ---------------------------------------------------------------------------------- 8 | # Autovacuum 9 | { 10 | "name": "autovacuum", 11 | "const": "on" 12 | }, 13 | { 14 | "name": "autovacuum_max_workers", 15 | "alg": "calc_cpu_scale(min_autovac_workers, max_autovac_workers)" 16 | # where: min_autovac_workers if CPU_CORES <= 4 17 | # max_autovac_workers if CPU_CORES = max_cpu_cores 18 | }, 19 | { 20 | "name": "autovacuum_work_mem", 21 | "alg": "(total_ram_in_bytes * maintenance_mem_part * autovacuum_workers_mem_part) / autovacuum_max_workers" 22 | }, 23 | { 24 | "name": "autovacuum_naptime", 25 | "const": "15s" 26 | }, 27 | { 28 | "name": "autovacuum_vacuum_threshold", 29 | "alg": "int(calc_system_scores_scale(1000, 20000))", 30 | "to_unit": "as_is" 31 | }, 32 | { 33 | "name": "autovacuum_analyze_threshold", 34 | "alg": "int(calc_system_scores_scale(500, 10000))", 35 | "to_unit": "as_is" 36 | }, 37 | { 38 | "name": "autovacuum_vacuum_scale_factor", 39 | "const": "0.1", 40 | }, 41 | { 42 | "name": "autovacuum_analyze_scale_factor", 43 | "const": "0.05" 44 | }, 45 | { 46 | "name": "autovacuum_vacuum_cost_limit", 47 | "alg": "int(calc_system_scores_scale(4000, 8000))", 48 | "unit": "as_is" 49 | }, 50 | { 51 | "name": "vacuum_cost_limit", 52 | "alg": "autovacuum_vacuum_cost_limit" 53 | }, 54 | { 55 | "name": "autovacuum_vacuum_cost_delay", 56 | "const": "10ms" 57 | }, 58 | { 59 | "name": "vacuum_cost_delay", 60 | "const": "10ms" 61 | }, 62 | { 63 | "name": "autovacuum_freeze_max_age", 64 | "const": "1200000000" 65 | }, 66 | { 67 | "name": "autovacuum_multixact_freeze_max_age", 68 | "const": "1400000000" 69 | }, 70 | # ---------------------------------------------------------------------------------- 71 | # Resource Consumption 72 | { 73 | "name": "shared_buffers", 74 | "alg": "total_ram_in_bytes * shared_buffers_part" 75 | }, 76 | { 77 | "name": "max_connections", 78 | "alg": """\ 79 | max( 80 | calc_cpu_scale(min_conns, max_conns), 81 | min_conns 82 | )""" 83 | # where: min_conns if CPU_CORES <= 4 84 | # max_conns if CPU_CORES = max_cpu_cores 85 | }, 86 | { 87 | "name": "max_files_per_process", 88 | "alg": "calc_cpu_scale(1000, 10000)" 89 | }, 90 | { 91 | "name": "superuser_reserved_connections", 92 | "const": "4" 93 | }, 94 | { 95 | "name": "work_mem", 96 | "alg": "max(((total_ram_in_bytes * client_mem_part) / max_connections) * 0.9, 1024 * 10000)" 97 | }, 98 | { 99 | "name": "temp_buffers", 100 | "alg": "max(((total_ram_in_bytes * client_mem_part) / max_connections) * 0.1, 1024 * 1000)" 101 | # where: temp_buffers per session, 10% of work_mem 102 | }, 103 | { 104 | "name": "maintenance_work_mem", 105 | "alg": "(total_ram_in_bytes * maintenance_mem_part * maintenance_conns_mem_part) / maint_max_conns" 106 | }, 107 | { 108 | "name": "old_snapshot_threshold", 109 | "alg": "4320", # [minutes], 3 days 110 | "to_unit": "as_is" 111 | }, 112 | # ---------------------------------------------------------------------------------- 113 | # Write Ahead Log 114 | { 115 | "name": "wal_level", 116 | "alg": "'logical' if replication_enabled else 'minimal'", 117 | "to_unit": "as_is" 118 | }, 119 | { 120 | "name": "wal_keep_segments", 121 | "alg": "int(calc_system_scores_scale(500, 10000)) if replication_enabled else 0" 122 | }, 123 | { 124 | "name": "synchronous_commit", 125 | "alg": "PGConfigurator.calc_synchronous_commit(duty_db, replication_enabled)", 126 | "to_unit": "as_is" 127 | # NOTE: If no "synchronous_standby_names" are specified, then synchronous replication 128 | # is not enabled and transaction commits will not wait for replication 129 | # If synchronous_standby_names is empty, the settings on, remote_apply, remote_write and local all 130 | # provide the same synchronization level: transaction commits only wait for local flush to disk 131 | }, 132 | { 133 | "name": "full_page_writes", 134 | "alg": "'on' if duty_db == DutyDB.FINANCIAL or replication_enabled else 'off'", 135 | "to_unit": "as_is" 136 | }, 137 | { 138 | "name": "wal_compression", 139 | "alg": "'on' if replication_enabled else 'off'", 140 | "to_unit": "as_is" 141 | }, 142 | { 143 | "name": "wal_buffers", # http://rhaas.blogspot.ru/2012/03/tuning-sharedbuffers-and-walbuffers.html 144 | "alg": """\ 145 | int( 146 | calc_system_scores_scale( 147 | UnitConverter.size_from('16MB', system=UnitConverter.sys_pg), 148 | UnitConverter.size_from('256MB', system=UnitConverter.sys_pg) 149 | ) 150 | )""", 151 | "to_unit": "MB" 152 | }, 153 | { 154 | # if synchronous_commit = off 155 | "name": "wal_writer_delay", # milliseconds 156 | "alg": """\ 157 | 100 if duty_db == DutyDB.FINANCIAL else \ 158 | int(calc_system_scores_scale(200, 1000)) if duty_db == DutyDB.MIXED else \ 159 | int(calc_system_scores_scale(200, 5000))""", 160 | "unit_postfix": "ms" 161 | }, 162 | { 163 | "name": "wal_writer_flush_after", 164 | "alg": """\ 165 | calc_system_scores_scale( 166 | UnitConverter.size_from('1MB', system=UnitConverter.sys_pg), 167 | UnitConverter.size_from('64MB', system=UnitConverter.sys_pg) 168 | )""" 169 | }, 170 | { 171 | "name": "min_wal_size", 172 | "alg": """\ 173 | calc_system_scores_scale( 174 | UnitConverter.size_from('512MB', system=UnitConverter.sys_pg), 175 | UnitConverter.size_from('16GB', system=UnitConverter.sys_pg) 176 | )""" 177 | }, 178 | { 179 | "name": "max_wal_size", 180 | # CHECKPOINT every checkpoint_timeout or when the WAL grows to about max_wal_size on disk 181 | "alg": """\ 182 | calc_system_scores_scale( 183 | UnitConverter.size_from('1GB', system=UnitConverter.sys_pg), 184 | UnitConverter.size_from( 185 | '32GB' if duty_db == DutyDB.FINANCIAL else '64GB', 186 | system=UnitConverter.sys_pg 187 | ) 188 | )""" 189 | }, 190 | # ---------------------------------------------------------------------------------- 191 | # Replication 192 | # Primary 193 | { 194 | "name": "max_replication_slots", 195 | "alg": "10 if replication_enabled else 0", 196 | "to_unit": "as_is" 197 | }, 198 | { 199 | "name": "max_wal_senders", 200 | "alg": "10 if replication_enabled else 0", 201 | "to_unit": "as_is" 202 | }, 203 | { 204 | "name": "wal_sender_timeout", 205 | "alg": "'180s' if replication_enabled else '0'", 206 | "to_unit": "as_is" 207 | }, 208 | { 209 | "name": "wal_log_hints", 210 | "alg": "'on' if replication_enabled else 'off'", 211 | "to_unit": "as_is" 212 | }, 213 | # Standby 214 | { 215 | "name": "hot_standby", 216 | "alg": "'on' if replication_enabled else 'off'", 217 | "to_unit": "as_is" 218 | }, 219 | { 220 | "name": "wal_receiver_timeout", 221 | "alg": "'180s' if replication_enabled else '0'", 222 | "to_unit": "as_is" 223 | }, 224 | { 225 | "name": "max_standby_streaming_delay", 226 | "alg": """\ 227 | '90s' if duty_db == DutyDB.FINANCIAL and replication_enabled else \ 228 | '1800s' if duty_db == DutyDB.MIXED else \ 229 | '-1' \ 230 | """, 231 | "to_unit": "as_is" 232 | }, 233 | { 234 | "name": "wal_receiver_status_interval", 235 | "alg": "'10s' if replication_enabled else '0'", 236 | "to_unit": "as_is" 237 | }, 238 | { 239 | "name": "hot_standby_feedback", 240 | "alg": "'on' if replication_enabled else 'off'", 241 | "to_unit": "as_is" 242 | }, 243 | # ---------------------------------------------------------------------------------- 244 | # Checkpointer 245 | { 246 | "name": "checkpoint_timeout", 247 | "alg": """\ 248 | '5min' if duty_db == DutyDB.FINANCIAL else \ 249 | '30min' if duty_db == DutyDB.MIXED else \ 250 | '1h'""", 251 | "to_unit": "as_is" 252 | }, 253 | { 254 | "name": "checkpoint_completion_target", 255 | "alg": """\ 256 | '0.5' if duty_db == DutyDB.FINANCIAL else \ 257 | '0.7' if duty_db == DutyDB.MIXED else \ 258 | '0.9'""", # DutyDB.STATISTIC 259 | "to_unit": "as_is" 260 | }, 261 | { 262 | "name": "commit_delay", # microseconds 263 | "alg": """\ 264 | 0 if duty_db == DutyDB.FINANCIAL else \ 265 | int(calc_system_scores_scale(100, 1000)) if duty_db == DutyDB.MIXED else \ 266 | int(calc_system_scores_scale(100, 5000))""", # DutyDB.STATISTIC 267 | "to_unit": "as_is" 268 | }, 269 | { 270 | "name": "commit_siblings", 271 | "alg": """\ 272 | 0 if duty_db == DutyDB.FINANCIAL else \ 273 | int(calc_system_scores_scale(10, 100))""", 274 | "to_unit": "as_is" 275 | }, 276 | # ---------------------------------------------------------------------------------- 277 | # Background Writer 278 | { 279 | "name": "bgwriter_delay", 280 | "alg": "int(calc_system_scores_scale(200, 1000))", # delay between activity rounds 281 | "unit_postfix": "ms" 282 | }, 283 | { 284 | "name": "bgwriter_lru_maxpages", 285 | "const": "1000" # 8MB per each round 286 | }, 287 | { 288 | "name": "bgwriter_lru_multiplier", # some cushion against spikes in demand 289 | "const": "7.0" 290 | }, 291 | # ---------------------------------------------------------------------------------- 292 | # Query Planning 293 | { 294 | "name": "effective_cache_size", 295 | "alg": """total_ram_in_bytes - shared_buffers - \ 296 | UnitConverter.size_from(reserved_system_ram, system=UnitConverter.sys_iec)""" 297 | }, 298 | { 299 | "name": "default_statistics_target", 300 | "const": "1000" 301 | }, 302 | { 303 | "name": "random_page_cost", 304 | "alg": """\ 305 | '6' if disk_type == DiskType.SATA else \ 306 | '4' if disk_type == DiskType.SAS else \ 307 | '1'""", # SSD 308 | "to_unit": "as_is" 309 | }, 310 | { 311 | "name": "seq_page_cost", 312 | "const": "1" # default 313 | }, 314 | # ---------------------------------------------------------------------------------- 315 | # Asynchronous Behavior 316 | { 317 | "name": "effective_io_concurrency", 318 | "alg": """\ 319 | '2' if disk_type == DiskType.SATA else \ 320 | '4' if disk_type == DiskType.SAS else \ 321 | '128'""", # SSD 322 | "to_unit": "as_is" 323 | }, 324 | { 325 | "name": "max_worker_processes", 326 | "alg": """calc_cpu_scale(4, 32)""" 327 | }, 328 | { 329 | "name": "max_parallel_workers_per_gather", 330 | "alg": "calc_cpu_scale(2, 16)" 331 | }, 332 | # ---------------------------------------------------------------------------------- 333 | # Lock Management 334 | { 335 | "name": "max_locks_per_transaction", 336 | "alg": "calc_system_scores_scale(64, 4096)" 337 | }, 338 | { 339 | "name": "max_pred_locks_per_transaction", 340 | "alg": "calc_system_scores_scale(64, 4096)" 341 | }, 342 | { 343 | "name": "statement_timeout", 344 | "alg": "86400000", 345 | "to_unit": "as_is" 346 | }, 347 | { 348 | "name": "idle_in_transaction_session_timeout", 349 | "alg": "86400000", 350 | "to_unit": "as_is" 351 | }, 352 | # ---------------------------------------------------------------------------------- 353 | # Statistics Collector 354 | { 355 | "name": "stats_temp_directory", 356 | "alg": "'/run/postgresql' if platform == Platform.LINUX else 'pg_stat_tmp'", 357 | "to_unit": "quote" 358 | } 359 | ], 360 | "10": [ 361 | { 362 | "__parent": "9.6" 363 | }, 364 | { 365 | "name": "max_parallel_workers", 366 | "alg": "calc_cpu_scale(4, 32)" 367 | }, 368 | { 369 | "name": "bgwriter_lru_maxpages", 370 | "alg": """\ 371 | int( 372 | calc_system_scores_scale( 373 | UnitConverter.size_from('8MB', system=UnitConverter.sys_pg) / page_size, 374 | UnitConverter.size_from('256MB', system=UnitConverter.sys_pg) / page_size 375 | ) 376 | )""", 377 | "to_unit": "as_is" 378 | }, 379 | { 380 | "name": "max_logical_replication_workers", 381 | "alg": """\ 382 | calc_cpu_scale(4, 12) if duty_db == DutyDB.FINANCIAL else \ 383 | calc_cpu_scale(4, 16) if duty_db == DutyDB.MIXED else \ 384 | calc_cpu_scale(6, 24) \ 385 | """ 386 | }, 387 | { 388 | "name": "max_sync_workers_per_subscription", 389 | "alg": """\ 390 | calc_cpu_scale(2, 8) if duty_db == DutyDB.FINANCIAL else \ 391 | calc_cpu_scale(2, 12) if duty_db == DutyDB.MIXED else \ 392 | calc_cpu_scale(4, 16) \ 393 | """ 394 | } 395 | ], 396 | "11": [ 397 | { 398 | "__parent": "10" # inheritance 399 | }, 400 | { 401 | "name": "max_parallel_maintenance_workers", 402 | "alg": "calc_cpu_scale(4, 16)" 403 | } 404 | ], 405 | "12": [ 406 | { 407 | "__parent": "11" # inheritance 408 | } 409 | ], 410 | "13": [ 411 | { 412 | "__parent": "12" # inheritance 413 | }, 414 | { 415 | "name": "wal_keep_segments", 416 | "alg": "deprecated" 417 | }, 418 | { 419 | "name": "autovacuum_vacuum_insert_threshold", 420 | "alg": "int(calc_system_scores_scale(1000, 20000))", 421 | "to_unit": "as_is" 422 | }, 423 | { 424 | "name": "autovacuum_vacuum_insert_scale_factor", 425 | "alg": "round(float(calc_system_scores_scale(0.01, 0.2)), 2)", 426 | "to_unit": "as_is" 427 | }, 428 | { 429 | "name": "logical_decoding_work_mem", 430 | "alg": """\ 431 | int( 432 | calc_system_scores_scale( 433 | UnitConverter.size_from('64MB', system=UnitConverter.sys_pg), 434 | UnitConverter.size_from('8096MB', system=UnitConverter.sys_pg) 435 | ) 436 | )\ 437 | """, 438 | "to_unit": "MB" 439 | }, 440 | { 441 | "name": "maintenance_io_concurrency", 442 | "alg": """\ 443 | '2' if disk_type == DiskType.SATA else \ 444 | '4' if disk_type == DiskType.SAS else \ 445 | '128' \ 446 | """, 447 | "to_unit": "as_is" 448 | }, 449 | { 450 | "name": "wal_keep_size", 451 | "alg": """\ 452 | int( 453 | calc_system_scores_scale( 454 | UnitConverter.size_from('1024MB', system=UnitConverter.sys_pg), 455 | UnitConverter.size_from('16384MB', system=UnitConverter.sys_pg) 456 | ) 457 | ) \ 458 | """, 459 | "to_unit": "MB" 460 | }, 461 | { 462 | "name": "hash_mem_multiplier", 463 | "alg": """\ 464 | '1.2' if duty_db == DutyDB.FINANCIAL else \ 465 | '2.0' if duty_db == DutyDB.MIXED else \ 466 | '8.0' \ 467 | """, 468 | "to_unit": "as_is" 469 | } 470 | ], 471 | "14": [ 472 | { 473 | "__parent": "13" # inheritance 474 | }, 475 | { 476 | "name": "client_connection_check_interval", 477 | "alg": """\ 478 | '3s' if duty_db == DutyDB.FINANCIAL else \ 479 | '10s' if duty_db == DutyDB.MIXED else \ 480 | '30s'""", 481 | "to_unit": "as_is" 482 | }, 483 | { 484 | "name": "default_toast_compression", 485 | "alg": """\ 486 | 'pglz' if duty_db in (DutyDB.FINANCIAL, DutyDB.MIXED) else 'lz4'""", 487 | "to_unit": "as_is" 488 | } 489 | ], 490 | "15": [ 491 | { 492 | "__parent": "14" # inheritance 493 | }, 494 | { 495 | "name": "stats_temp_directory", 496 | "alg": "deprecated" 497 | } 498 | ], 499 | "16": [ 500 | { 501 | "__parent": "15" # inheritance 502 | }, 503 | { 504 | "name": "max_parallel_apply_workers_per_subscription", 505 | "alg": "calc_cpu_scale(4, 16)" 506 | } 507 | ], 508 | "17": [ 509 | { 510 | "__parent": "16" # inheritance 511 | }, 512 | ], 513 | } 514 | -------------------------------------------------------------------------------- /pg_configurator/conf_profiles/profile_platform_perf.py: -------------------------------------------------------------------------------- 1 | platform_perf_alg_set = { 2 | # external pre-calculated vars for algs: 3 | # total_ram_in_bytes 4 | # total_cpu_cores 5 | # maint_max_conns 6 | "9.6": [ 7 | # ---------------------------------------------------------------------------------- 8 | # Autovacuum 9 | { 10 | "name": "autovacuum", 11 | "const": "on" 12 | }, 13 | { 14 | "name": "autovacuum_max_workers", 15 | "alg": "calc_cpu_scale(min_autovac_workers, max_autovac_workers)" 16 | # where: min_autovac_workers if CPU_CORES <= 4 17 | # max_autovac_workers if CPU_CORES = max_cpu_cores 18 | }, 19 | { 20 | "name": "autovacuum_work_mem", 21 | "alg": "(total_ram_in_bytes * maintenance_mem_part * autovacuum_workers_mem_part) / autovacuum_max_workers" 22 | }, 23 | { 24 | "name": "autovacuum_naptime", 25 | "const": "'15s'" 26 | }, 27 | { 28 | "name": "autovacuum_vacuum_threshold", 29 | "alg": "int(calc_system_scores_scale(1000, 20000))", 30 | "to_unit": "as_is" 31 | }, 32 | { 33 | "name": "autovacuum_analyze_threshold", 34 | "alg": "int(calc_system_scores_scale(500, 10000))", 35 | "to_unit": "as_is" 36 | }, 37 | { 38 | "name": "autovacuum_vacuum_scale_factor", 39 | "const": "0.1", 40 | }, 41 | { 42 | "name": "autovacuum_analyze_scale_factor", 43 | "const": "0.05" 44 | }, 45 | { 46 | "name": "autovacuum_vacuum_cost_limit", 47 | "alg": "int(calc_system_scores_scale(2000, 8000))", 48 | "unit": "as_is" 49 | }, 50 | { 51 | "name": "vacuum_cost_limit", 52 | "const":"8000" 53 | }, 54 | { 55 | "name": "autovacuum_vacuum_cost_delay", 56 | "const": "10ms" 57 | }, 58 | { 59 | "name": "vacuum_cost_delay", 60 | "const": "10ms" 61 | }, 62 | { 63 | "name": "autovacuum_freeze_max_age", 64 | "const": "500000000" 65 | }, 66 | { 67 | "name": "autovacuum_multixact_freeze_max_age", 68 | "const": "800000000" 69 | }, 70 | # ---------------------------------------------------------------------------------- 71 | # Resource Consumption 72 | { 73 | "name": "shared_buffers", 74 | "alg": "total_ram_in_bytes * shared_buffers_part" 75 | }, 76 | { 77 | "name": "max_connections", 78 | "alg": """\ 79 | max( 80 | calc_cpu_scale(min_conns, max_conns), 81 | min_conns 82 | )""" 83 | # where: min_conns if CPU_CORES <= 4 84 | # max_conns if CPU_CORES = max_cpu_cores 85 | }, 86 | { 87 | "name": "max_files_per_process", 88 | "alg": "int(calc_cpu_scale(1000, 10000))", 89 | "to_unit": "as_is" 90 | }, 91 | { 92 | "name": "work_mem", 93 | "alg": "max(((total_ram_in_bytes * client_mem_part) / max_connections) * 0.9, 1024 * 10000)" 94 | }, 95 | { 96 | "name": "temp_buffers", 97 | "alg": "max(((total_ram_in_bytes * client_mem_part) / max_connections) * 0.1, 1024 * 1000)" 98 | # where: 10% of work_mem 99 | }, 100 | { 101 | "name": "maintenance_work_mem", 102 | "alg": "(total_ram_in_bytes * maintenance_mem_part * maintenance_conns_mem_part) / maint_max_conns" 103 | }, 104 | { 105 | "name": "huge_pages", 106 | "const": "try" 107 | }, 108 | # ---------------------------------------------------------------------------------- 109 | # Write Ahead Log 110 | { 111 | "name": "fsync", 112 | "const": "on" 113 | }, 114 | { 115 | "name": "wal_level", 116 | "alg": "'logical' if replication_enabled else 'minimal'", 117 | "to_unit": "as_is" 118 | }, 119 | { 120 | "name": "synchronous_commit", 121 | "alg": "PGConfigurator.calc_synchronous_commit(duty_db, replication_enabled)", 122 | "to_unit": "as_is" 123 | # NOTE: If no "synchronous_standby_names" are specified, then synchronous replication 124 | # is not enabled and transaction commits will not wait for replication 125 | # If synchronous_standby_names is empty, the settings on, remote_apply, remote_write and local all 126 | # provide the same synchronization level: transaction commits only wait for local flush to disk 127 | }, 128 | { 129 | "name": "full_page_writes", 130 | "alg": "'on' if duty_db == DutyDB.FINANCIAL or replication_enabled else 'off'", 131 | "to_unit": "as_is" 132 | }, 133 | { 134 | "name": "wal_compression", 135 | "alg": "'on' if replication_enabled else 'off'", 136 | "to_unit": "as_is" 137 | }, 138 | { 139 | "name": "wal_buffers", # http://rhaas.blogspot.ru/2012/03/tuning-sharedbuffers-and-walbuffers.html 140 | "alg": """\ 141 | int( 142 | calc_system_scores_scale( 143 | UnitConverter.size_from('16MB', system=UnitConverter.sys_pg), 144 | UnitConverter.size_from('256MB', system=UnitConverter.sys_pg) 145 | ) 146 | )""", 147 | "to_unit": "MB" 148 | }, 149 | { 150 | # if synchronous_commit = off 151 | "name": "wal_writer_delay", # milliseconds 152 | "alg": """\ 153 | 100 if duty_db == DutyDB.FINANCIAL else \ 154 | int(calc_system_scores_scale(200, 1000)) if duty_db == DutyDB.MIXED else \ 155 | int(calc_system_scores_scale(200, 5000))""", 156 | "unit_postfix": "ms" 157 | }, 158 | { 159 | "name": "wal_writer_flush_after", 160 | "alg": """\ 161 | calc_system_scores_scale( 162 | UnitConverter.size_from('1MB', system=UnitConverter.sys_pg), 163 | UnitConverter.size_from('64MB', system=UnitConverter.sys_pg) 164 | )""" 165 | }, 166 | { 167 | "name": "min_wal_size", 168 | "alg": """\ 169 | calc_system_scores_scale( 170 | UnitConverter.size_from('512MB', system=UnitConverter.sys_pg), 171 | UnitConverter.size_from('16GB', system=UnitConverter.sys_pg) 172 | )""" 173 | }, 174 | { 175 | "name": "max_wal_size", 176 | # CHECKPOINT every checkpoint_timeout or when the WAL grows to about max_wal_size on disk 177 | "alg": """\ 178 | calc_system_scores_scale( 179 | UnitConverter.size_from('1GB', system=UnitConverter.sys_pg), 180 | UnitConverter.size_from( 181 | '32GB' if duty_db == DutyDB.FINANCIAL else '64GB', 182 | system=UnitConverter.sys_pg 183 | ) 184 | )""" 185 | }, 186 | # ---------------------------------------------------------------------------------- 187 | # Replication 188 | # Primary 189 | { 190 | "name": "max_replication_slots", 191 | "alg": "10 if replication_enabled else 0", 192 | "to_unit": "as_is" 193 | }, 194 | { 195 | "name": "max_wal_senders", 196 | "alg": "10 if replication_enabled else 0", 197 | "to_unit": "as_is" 198 | }, 199 | { 200 | "name": "wal_sender_timeout", 201 | "alg": "'300s' if replication_enabled else '0'", 202 | "to_unit": "as_is" 203 | }, 204 | { 205 | "name": "wal_log_hints", 206 | "alg": "'on' if replication_enabled else 'off'", 207 | "to_unit": "as_is" 208 | }, 209 | { 210 | "name": "wal_keep_segments", 211 | "alg": "int(calc_system_scores_scale(128, 1024)) if replication_enabled else 0" 212 | }, 213 | # Standby 214 | { 215 | "name": "hot_standby", 216 | "alg": "'on' if replication_enabled else 'off'", 217 | "to_unit": "as_is" 218 | }, 219 | { 220 | "name": "wal_receiver_timeout", 221 | "alg": "'300s' if replication_enabled else '0'", 222 | "to_unit": "as_is" 223 | }, 224 | { 225 | "name": "max_standby_streaming_delay", 226 | "alg": """\ 227 | '90s' if duty_db == DutyDB.FINANCIAL and replication_enabled else \ 228 | '1800s' if duty_db == DutyDB.MIXED else \ 229 | '-1'""", 230 | "to_unit": "as_is" 231 | }, 232 | { 233 | "name": "wal_receiver_status_interval", 234 | "alg": "'10s' if replication_enabled else '0'", 235 | "to_unit": "as_is" 236 | }, 237 | { 238 | "name": "hot_standby_feedback", 239 | "alg": "'on' if replication_enabled else 'off'", 240 | "to_unit": "as_is" 241 | }, 242 | # ---------------------------------------------------------------------------------- 243 | # Checkpointer 244 | { 245 | "name": "checkpoint_timeout", 246 | "alg": """\ 247 | '15min' if duty_db == DutyDB.FINANCIAL else \ 248 | '30min' if duty_db == DutyDB.MIXED else \ 249 | '1h'""", 250 | "to_unit": "as_is" 251 | }, 252 | { 253 | "name": "checkpoint_warning", 254 | "const": "30s" 255 | }, 256 | { 257 | "name": "checkpoint_completion_target", 258 | "alg": """\ 259 | '0.8' if duty_db == DutyDB.FINANCIAL else \ 260 | '0.85' if duty_db == DutyDB.MIXED else \ 261 | '0.9'""", # DutyDB.STATISTIC 262 | "to_unit": "as_is" 263 | }, 264 | { 265 | "name": "commit_delay", # microseconds 266 | "alg": """\ 267 | 0 if duty_db == DutyDB.FINANCIAL else \ 268 | int(calc_system_scores_scale(100, 1000)) if duty_db == DutyDB.MIXED else \ 269 | int(calc_system_scores_scale(100, 5000))""", # DutyDB.STATISTIC 270 | "to_unit": "as_is" 271 | }, 272 | { 273 | "name": "commit_siblings", 274 | "alg": """\ 275 | 0 if duty_db == DutyDB.FINANCIAL else \ 276 | int(calc_system_scores_scale(10, 100))""", 277 | "to_unit": "as_is" 278 | }, 279 | # ---------------------------------------------------------------------------------- 280 | # Background Writer 281 | { 282 | "name": "bgwriter_delay", 283 | "alg": "int(calc_system_scores_scale(50, 200))", # delay between activity rounds 284 | "unit_postfix": "ms" 285 | }, 286 | { 287 | "name": "bgwriter_lru_maxpages", 288 | "alg": "int(calc_system_scores_scale(500, 1000))", 289 | "to_unit": "as_is" 290 | }, 291 | { 292 | "name": "bgwriter_lru_multiplier", # some cushion against spikes in demand 293 | "const": "7.0" 294 | }, 295 | # ---------------------------------------------------------------------------------- 296 | # Query Planning 297 | { 298 | "name": "effective_cache_size", 299 | "alg": "total_ram_in_bytes - shared_buffers - UnitConverter.size_from(reserved_system_ram, system=UnitConverter.sys_iec)" 300 | }, 301 | { 302 | "name": "default_statistics_target", 303 | "const": "500" 304 | }, 305 | { 306 | "name": "random_page_cost", 307 | "alg": """\ 308 | '4' if disk_type == DiskType.SATA else \ 309 | '2.5' if disk_type == DiskType.SAS else \ 310 | '1.1'""", # SSD 311 | "to_unit": "as_is" 312 | }, 313 | { 314 | "name": "seq_page_cost", 315 | "const": "1" # default 316 | }, 317 | { 318 | "name": "join_collapse_limit", 319 | "alg": """\ 320 | '8' if duty_db == DutyDB.FINANCIAL else \ 321 | '9' if duty_db == DutyDB.MIXED else \ 322 | '10' """, 323 | "to_unit": "as_is" 324 | }, 325 | { 326 | "name": "from_collapse_limit", 327 | "alg": """\ 328 | '8' if duty_db == DutyDB.FINANCIAL else \ 329 | '9' if duty_db == DutyDB.MIXED else \ 330 | '10' """, 331 | "to_unit": "as_is" 332 | }, 333 | { 334 | "name": "geqo", 335 | "const": "on" 336 | }, 337 | { 338 | "name": "geqo_threshold", 339 | "const": "12" 340 | }, 341 | # ---------------------------------------------------------------------------------- 342 | # Asynchronous Behavior 343 | { 344 | "name": "effective_io_concurrency", 345 | "alg": """\ 346 | '2' if disk_type == DiskType.SATA else \ 347 | '4' if disk_type == DiskType.SAS else \ 348 | '128'""", # SSD 349 | "to_unit": "as_is" 350 | }, 351 | { 352 | "name": "max_worker_processes", 353 | "alg": """calc_cpu_scale(4, 96)""" 354 | }, 355 | { 356 | "name": "max_parallel_workers_per_gather", 357 | "alg": """\ 358 | calc_cpu_scale(2, 4) if duty_db == DutyDB.FINANCIAL else \ 359 | calc_cpu_scale(2, 8) if duty_db == DutyDB.MIXED else \ 360 | calc_cpu_scale(2, 16)""" 361 | }, 362 | # ---------------------------------------------------------------------------------- 363 | # Lock Management 364 | { 365 | "name": "max_locks_per_transaction", 366 | "alg": "calc_system_scores_scale(64, 4096)" 367 | }, 368 | { 369 | "name": "max_pred_locks_per_transaction", 370 | "alg": "calc_system_scores_scale(64, 4096)" 371 | }, 372 | { 373 | "name": "statement_timeout", 374 | "alg": "86400000", 375 | "to_unit": "as_is" 376 | }, 377 | { 378 | "name": "idle_in_transaction_session_timeout", 379 | "alg": "86400000", 380 | "to_unit": "as_is" 381 | }, 382 | { 383 | "name": "old_snapshot_threshold", 384 | "alg": "4320", 385 | "to_unit": "as_is" 386 | }, 387 | { 388 | "name": "stats_temp_directory", 389 | "alg": "deprecated" 390 | } 391 | ], 392 | "10": [ 393 | { 394 | "__parent":"9.6" # inheritance 395 | }, 396 | { 397 | "name": "max_parallel_workers", 398 | "alg": """\ 399 | calc_cpu_scale(4, 12) if duty_db == DutyDB.FINANCIAL else \ 400 | calc_cpu_scale(4, 24) if duty_db == DutyDB.MIXED else \ 401 | calc_cpu_scale(4, 32)""" 402 | }, 403 | { 404 | "name": "max_logical_replication_workers", 405 | "alg": """\ 406 | calc_cpu_scale(4, 12) if duty_db == DutyDB.FINANCIAL else \ 407 | calc_cpu_scale(4, 16) if duty_db == DutyDB.MIXED else \ 408 | calc_cpu_scale(6, 24)""" 409 | }, 410 | { 411 | "name": "max_sync_workers_per_subscription", 412 | "alg": """\ 413 | calc_cpu_scale(2, 8) if duty_db == DutyDB.FINANCIAL else \ 414 | calc_cpu_scale(2, 12) if duty_db == DutyDB.MIXED else \ 415 | calc_cpu_scale(4, 16)""" 416 | } 417 | ], 418 | "11": [ 419 | { 420 | "__parent":"10" # inheritance 421 | }, 422 | { 423 | "name": "max_parallel_maintenance_workers", 424 | "alg": "calc_cpu_scale(4, 16)" 425 | } 426 | ], 427 | "12": [ 428 | { 429 | "__parent": "11" # inheritance 430 | }, 431 | { 432 | "name": "wal_keep_segments", 433 | "alg": "deprecated" 434 | } 435 | ], 436 | "13": [ 437 | { 438 | "__parent": "12" # inheritance 439 | }, 440 | { 441 | "name": "autovacuum_vacuum_insert_threshold", 442 | "alg": "int(calc_system_scores_scale(1000, 20000))", 443 | "to_unit": "as_is" 444 | }, 445 | { 446 | "name": "autovacuum_vacuum_insert_scale_factor", 447 | "alg": "round(float(calc_system_scores_scale(0.01, 0.2)), 2)", 448 | "to_unit": "as_is" 449 | }, 450 | { 451 | "name": "logical_decoding_work_mem", 452 | "alg": """\ 453 | int( 454 | calc_system_scores_scale( 455 | UnitConverter.size_from('64MB', system=UnitConverter.sys_pg), 456 | UnitConverter.size_from('8096MB', system=UnitConverter.sys_pg) 457 | ) 458 | )\ 459 | """, 460 | "to_unit": "MB" 461 | }, 462 | { 463 | "name": "maintenance_io_concurrency", 464 | "alg": """\ 465 | '2' if disk_type == DiskType.SATA else \ 466 | '4' if disk_type == DiskType.SAS else \ 467 | '128'""", # SSD 468 | "to_unit": "as_is" 469 | }, 470 | { 471 | "name": "wal_keep_size", 472 | "alg": """\ 473 | int( 474 | calc_system_scores_scale( 475 | UnitConverter.size_from('1024MB', system=UnitConverter.sys_pg), 476 | UnitConverter.size_from('16384MB', system=UnitConverter.sys_pg) 477 | ) 478 | )""", 479 | "to_unit": "MB" 480 | }, 481 | { 482 | "name": "hash_mem_multiplier", 483 | "alg": """\ 484 | '1.2' if duty_db == DutyDB.FINANCIAL else \ 485 | '2.0' if duty_db == DutyDB.MIXED else \ 486 | '8.0' """, 487 | "to_unit": "as_is" 488 | } 489 | ], 490 | "14": [ 491 | { 492 | "__parent": "13" # inheritance 493 | }, 494 | { 495 | "name": "client_connection_check_interval", 496 | "alg": """\ 497 | '3s' if duty_db == DutyDB.FINANCIAL else \ 498 | '5s' if duty_db == DutyDB.MIXED else \ 499 | '30s' """, 500 | "to_unit": "as_is" 501 | }, 502 | { 503 | "name": "default_toast_compression", 504 | "alg": """\ 505 | 'pglz' if duty_db == DutyDB.FINANCIAL else \ 506 | 'pglz' if duty_db == DutyDB.MIXED else \ 507 | 'lz4' """, 508 | "to_unit": "as_is" 509 | }, 510 | { 511 | "name": "enable_async_append", 512 | "const": "on" 513 | }, 514 | { 515 | "name": "subtrans_buffers", 516 | "alg": """\ 517 | int( 518 | calc_system_scores_scale( 519 | UnitConverter.size_from('4MB', system=UnitConverter.sys_pg), 520 | UnitConverter.size_from('1024MB', system=UnitConverter.sys_pg) 521 | ) 522 | )""", 523 | "to_unit": "MB", 524 | }, 525 | { 526 | "name": "xact_buffers", 527 | "alg": """\ 528 | int( 529 | calc_system_scores_scale( 530 | UnitConverter.size_from('4MB', system=UnitConverter.sys_pg), 531 | UnitConverter.size_from('1024MB', system=UnitConverter.sys_pg) 532 | ) 533 | )""", 534 | "to_unit": "MB", 535 | } 536 | ], 537 | "15": [ 538 | { 539 | "__parent": "14" # inheritance 540 | }, 541 | { 542 | "name": "stats_temp_directory", 543 | "alg": "deprecated" 544 | }, 545 | { 546 | "name": "wal_compression", 547 | "to_unit": "as_is", 548 | "const": "lz4" 549 | }, 550 | ], 551 | "16": [ 552 | { 553 | "__parent": "15" # inheritance 554 | }, 555 | { 556 | "name": "subtrans_buffers", 557 | "alg": "deprecated" 558 | }, 559 | { 560 | "name": "xact_buffers", 561 | "alg": "deprecated" 562 | }, 563 | { 564 | "name": "subtransaction_buffers", 565 | "alg": """\ 566 | int( 567 | calc_system_scores_scale( 568 | UnitConverter.size_from('4MB', system=UnitConverter.sys_pg), 569 | UnitConverter.size_from('1024MB', system=UnitConverter.sys_pg) 570 | ) 571 | )""", 572 | "to_unit": "MB", 573 | }, 574 | { 575 | "name": "transaction_buffers", 576 | "alg": """\ 577 | int( 578 | calc_system_scores_scale( 579 | UnitConverter.size_from('4MB', system=UnitConverter.sys_pg), 580 | UnitConverter.size_from('1024MB', system=UnitConverter.sys_pg) 581 | ) 582 | )""", 583 | "to_unit": "MB", 584 | }, 585 | ], 586 | "17": [ 587 | { 588 | "__parent": "16" # inheritance 589 | }, 590 | ], 591 | } 592 | -------------------------------------------------------------------------------- /pg_configurator/configurator.py: -------------------------------------------------------------------------------- 1 | import csv 2 | import os 3 | import datetime 4 | import copy 5 | import argparse 6 | import json 7 | import psutil 8 | import socket 9 | from pg_configurator.conf_perf import * 10 | from pg_configurator.conf_common import * 11 | from pg_configurator.common import * 12 | from pg_configurator.conf_profiles import * 13 | from pg_configurator.version import __version__ 14 | 15 | 16 | class UnitConverter: 17 | # kilobytes megabytes gigabytes terabytes 18 | # PG kB MB GB TB 19 | # ISO K M G T 20 | 21 | # kibibytes mebibytes gibibytes tebibytes 22 | # IEC Ki Mi Gi Ti 23 | 24 | # milliseconds seconds minutes hours days 25 | # PG ms s min h d 26 | 27 | # https://en.wikipedia.org/wiki/Binary_prefix 28 | # Specific units of IEC 60027-2 A.2 and ISO/IEC 80000 29 | 30 | sys_std = [ 31 | (1024 ** 4, 'T'), 32 | (1024 ** 3, 'G'), 33 | (1024 ** 2, 'M'), 34 | (1024 ** 1, 'K'), 35 | (1024 ** 0, 'B') 36 | ] 37 | 38 | sys_iec = [ 39 | (1024 ** 4, 'Ti'), 40 | (1024 ** 3, 'Gi'), 41 | (1024 ** 2, 'Mi'), 42 | (1024 ** 1, 'Ki'), 43 | (1024 ** 0, '') 44 | ] 45 | 46 | sys_iso = [ 47 | (1000 ** 4, 'T'), 48 | (1000 ** 3, 'G'), 49 | (1000 ** 2, 'M'), 50 | (1000 ** 1, 'K'), 51 | (1000 ** 0, 'B') 52 | ] 53 | 54 | sys_pg = [ 55 | (1024 ** 4, 'TB'), 56 | (1024 ** 3, 'GB'), 57 | (1024 ** 2, 'MB'), 58 | (1024 ** 1, 'kB'), # <---------------- PG specific 59 | (1024 ** 0, '') 60 | ] 61 | 62 | @staticmethod 63 | def size_to(bytes, system=sys_iso, unit=None): 64 | for factor, postfix in system: 65 | if (unit is None and bytes/10 >= factor) or unit == postfix: 66 | break 67 | amount = int(bytes/factor) 68 | return str(amount) + postfix 69 | 70 | @staticmethod 71 | def size_from(sys_bytes, system=sys_iso): 72 | unit = ''.join(re.findall(r'[A-z]', sys_bytes)) 73 | for factor, suffix in system: 74 | if suffix == unit: 75 | return int(int(''.join(re.findall(r'[0-9]', sys_bytes))) * factor) 76 | return int(sys_bytes) 77 | 78 | @staticmethod 79 | def size_cpu_to_ncores(cpu_val): 80 | val = ''.join(re.findall(r'[0-9][.][0-9]|[0-9]', str(cpu_val))) 81 | if ''.join(re.findall(r'[A-z]', str(cpu_val))) == 'm': 82 | return round(int(val)/1000, 1) 83 | else: 84 | return round(float(val), 1) 85 | 86 | 87 | class DutyDB(BasicEnum, Enum): 88 | STATISTIC = 'statistic' # Low reliability, fast speed, long recovery 89 | # Purely analytical and large aggregations 90 | # Transactions may be lost in case of a crash 91 | MIXED = 'mixed' # Medium reliability, medium speed, medium recovery 92 | # Mostly complicated real time SQL queries 93 | FINANCIAL = 'financial' # High reliability, low speed, fast recovery 94 | # Billing tasks. Can't lose transactions in case of a crash 95 | 96 | 97 | class DiskType(BasicEnum, Enum): 98 | # We assume that we have minimum 2 disk in hardware RAID1 (or 4 in RAID10) with BBU 99 | SATA = 'SATA' 100 | SAS = 'SAS' 101 | SSD = 'SSD' 102 | 103 | 104 | class Platform(BasicEnum, Enum): 105 | WINDOWS = 'WINDOWS' 106 | LINUX = 'LINUX' 107 | 108 | 109 | class OutputFormat(BasicEnum, Enum): 110 | JSON = 'json' 111 | PATRONI_JSON = 'patroni-json' 112 | CONF = 'conf' 113 | 114 | 115 | class PGConfigurator: 116 | known_versions = { 117 | "9.6": "settings_pg_9_6.csv", 118 | "10": "settings_pg_10.csv", 119 | "11": "settings_pg_11.csv", 120 | "12": "settings_pg_12.csv", 121 | "13": "settings_pg_13.csv", 122 | "14": "settings_pg_14.csv", 123 | "15": "settings_pg_15.csv", 124 | "16": "settings_pg_16.csv", 125 | "17": "settings_pg_17.csv", 126 | } 127 | 128 | conf_profiles = { 129 | "profile_1c": "alg_set_1c", # filename : dict name in file 130 | "ext_perf": "ext_alg_set", 131 | "profile_platform_common": "platform_common_alg_set", 132 | "profile_platform_perf": "platform_perf_alg_set" 133 | } 134 | 135 | current_dir = os.path.dirname(os.path.realpath(__file__)) 136 | output_dir = os.getcwd() 137 | args = {} 138 | ext_params = {} 139 | 140 | @exception_handler 141 | def __init__(self, args, ext_params): 142 | self.args = args 143 | self.ext_params = ext_params 144 | if not (args.output_file_name.find("""/""") > -1 or args.output_file_name.find("""\\""") > -1) \ 145 | and args.output_file_name != '': 146 | args.output_file_name = os.path.abspath(os.path.join(self.output_dir, 147 | args.output_file_name)) 148 | 149 | @staticmethod 150 | def calc_synchronous_commit(duty_db, replication_enabled): 151 | if replication_enabled: 152 | if duty_db == DutyDB.STATISTIC: 153 | return "off" 154 | if duty_db == DutyDB.MIXED: 155 | return "local" 156 | if duty_db == DutyDB.FINANCIAL: 157 | return "remote_apply" 158 | else: 159 | if duty_db == DutyDB.STATISTIC: 160 | return "off" 161 | if duty_db == DutyDB.MIXED: 162 | return "off" 163 | if duty_db == DutyDB.FINANCIAL: 164 | return "on" 165 | 166 | @staticmethod 167 | def iterate_alg_set(tune_alg) -> [str, dict]: 168 | for alg_set_v in sorted( 169 | [(ver, alg_set_v) for ver, alg_set_v in tune_alg.items()], 170 | key=lambda x: float(x[0]) 171 | ): 172 | yield alg_set_v[0], alg_set_v[1] 173 | 174 | @staticmethod 175 | def prepare_alg_set(tune_alg, source_name): 176 | print("Called prepare_alg_set for '%s'" % source_name) 177 | prepared_tune_alg = copy.deepcopy(tune_alg) 178 | 179 | for ver, perf_alg_set in PGConfigurator.iterate_alg_set(tune_alg): 180 | # inheritance, redefinition, deprecation 181 | 182 | current_ver_deprecated_params = [ 183 | alg["name"] for alg in perf_alg_set if "alg" in alg and alg["alg"] == "deprecated" 184 | ] 185 | 186 | prepared_tune_alg[ver] = [ 187 | p for p in prepared_tune_alg[ver] if 'name' in p and p['name'] not in current_ver_deprecated_params 188 | ] 189 | 190 | prepared_tune_alg[ver] = [ 191 | alg for alg in perf_alg_set \ 192 | if not("alg" in alg and alg["alg"] == "deprecated") and "__parent" not in alg 193 | ] 194 | 195 | alg_set_current_version = prepared_tune_alg[ver] 196 | 197 | alg_set_from_parent = [] 198 | if len([alg for alg in perf_alg_set if "__parent" in alg]) > 0: 199 | alg_set_from_parent = prepared_tune_alg[ 200 | [alg for alg in perf_alg_set if "__parent" in alg][0]["__parent"] 201 | ] 202 | 203 | prepared_tune_alg[ver].extend([ 204 | alg for alg in alg_set_from_parent 205 | if "name" in alg and alg["name"] not in [ 206 | alg["name"] for alg in alg_set_current_version 207 | ] and alg["name"] not in current_ver_deprecated_params 208 | ] 209 | ) 210 | 211 | return prepared_tune_alg 212 | 213 | def make_conf( 214 | self, 215 | cpu_cores, 216 | ram_value, 217 | disk_type=DiskType.SAS, 218 | duty_db=DutyDB.MIXED, 219 | replication_enabled=True, 220 | pg_version="15", 221 | reserved_ram_percent=10, # for calc of total_ram_in_bytes 222 | reserved_system_ram='256Mi', # for calc of total_ram_in_bytes 223 | shared_buffers_part=0.7, 224 | client_mem_part=0.2, # for all available connections 225 | maintenance_mem_part=0.1, # memory for maintenance connections + autovacuum workers 226 | autovacuum_workers_mem_part=0.5, # from maintenance_mem_part 227 | maintenance_conns_mem_part=0.5, # from maintenance_mem_part 228 | min_conns=50, 229 | max_conns=500, 230 | min_autovac_workers=4, # autovacuum workers 231 | max_autovac_workers=20, 232 | min_maint_conns=4, # maintenance connections 233 | max_maint_conns=16, 234 | platform=Platform.LINUX, 235 | common_conf=False, 236 | conf_profiles=None 237 | ): 238 | # ======================================================================================================= 239 | # checks 240 | if round(shared_buffers_part + client_mem_part + maintenance_mem_part, 1) != 1.0: 241 | raise NameError("Invalid memory parts size") 242 | if round(autovacuum_workers_mem_part + maintenance_conns_mem_part, 1) != 1.0: 243 | raise NameError("Invalid memory parts size for maintenance tasks") 244 | # ======================================================================================================= 245 | # consts 246 | page_size = 8192 247 | max_cpu_cores = 96 # maximum of CPU cores in system, 4 CPU with 12 cores=>24 threads = 96 248 | min_cpu_cores = 4 249 | max_ram = '768Gi' 250 | max_ram_in_bytes = UnitConverter.size_from(max_ram, system=UnitConverter.sys_iec) * \ 251 | ((100 - reserved_ram_percent) / 100) - \ 252 | UnitConverter.size_from(reserved_system_ram, system=UnitConverter.sys_iec) 253 | # ======================================================================================================= 254 | # pre-calculated vars 255 | total_ram_in_bytes = UnitConverter.size_from(ram_value, system=UnitConverter.sys_iec) * \ 256 | ((100 - reserved_ram_percent) / 100) - \ 257 | UnitConverter.size_from(reserved_system_ram, system=UnitConverter.sys_iec) 258 | 259 | total_cpu_cores = UnitConverter.size_cpu_to_ncores(cpu_cores) 260 | 261 | maint_max_conns = max( 262 | ((((total_cpu_cores - min_cpu_cores) * 100) / (max_cpu_cores - min_cpu_cores)) / 100) * \ 263 | (max_maint_conns - min_maint_conns) + min_maint_conns, 264 | min_maint_conns 265 | ) 266 | # ======================================================================================================= 267 | # system scores calculation in percents 268 | cpu_scores = (total_cpu_cores * 100) / max_cpu_cores 269 | ram_scores = (total_ram_in_bytes * 100) / max_ram_in_bytes 270 | disk_scores = 20 if disk_type == DiskType.SATA else \ 271 | 40 if disk_type == DiskType.SAS else \ 272 | 100 # SSD 273 | 274 | system_scores = \ 275 | 0.5 * cpu_scores * ram_scores * 0.866 + \ 276 | 0.5 * ram_scores * disk_scores * 0.866 + \ 277 | 0.5 * disk_scores * cpu_scores * 0.866 278 | # where triangle_surface = 0.5 * cpu_scores * ram_scores * sin(120) 279 | # sin(120) = 0.866 280 | 281 | system_scores_max = \ 282 | 0.5 * 100 * 100 * 0.866 + \ 283 | 0.5 * 100 * 100 * 0.866 + \ 284 | 0.5 * 100 * 100 * 0.866 285 | 286 | system_scores = (system_scores * 100) / system_scores_max # 0-100 287 | # where 100 if system has max_cpu_cores, max_ram and SSD disk (4 disks in RAID10 for example) 288 | # ======================================================================================================= 289 | 290 | def calc_cpu_scale(v_min, v_max): 291 | return max( 292 | ( 293 | ( 294 | ((total_cpu_cores - min_cpu_cores) * 100) / (max_cpu_cores - min_cpu_cores) 295 | ) / 100 296 | ) * (v_max - v_min) + v_min, 297 | v_min 298 | ) 299 | 300 | def calc_system_scores_scale(v_min, v_max): 301 | return max( 302 | ( 303 | system_scores / 100 304 | ) * (v_max - v_min) + v_min, 305 | v_min 306 | ) 307 | 308 | # Apply profiles to perf_alg_set 309 | if conf_profiles is not None and len(conf_profiles) > 0: 310 | for profile in conf_profiles.split(','): 311 | if profile not in self.conf_profiles: 312 | raise NameError("Profile %s not found! See directory 'conf_profiles'" % profile) 313 | for k, v in perf_alg_set.items(): 314 | if k in globals()[self.conf_profiles[profile]]: 315 | perf_alg_set[k].extend( 316 | globals()[self.conf_profiles[profile]][k] 317 | ) 318 | 319 | d1 = {} 320 | # Merge params in versions to avoid duplicates 321 | for ver, params in perf_alg_set.items(): 322 | d1[ver] = { 323 | d["name"]: { 324 | k: v for k, v in d.items() if k != 'name' 325 | } for d in perf_alg_set[ver] if "name" in d 326 | } 327 | 328 | d2 = {} 329 | for ver, params in perf_alg_set.items(): 330 | d2[ver] = {"__parent": d["__parent"] for d in perf_alg_set[ver] if "__parent" in d} 331 | 332 | perf_alg_set_res = {} 333 | for ver, param in d2.items(): 334 | perf_alg_set_res[ver] = [ 335 | {k: v for k, v in param.items() if isinstance(v, str)} 336 | ] 337 | 338 | for ver, param in d1.items(): 339 | perf_alg_set_res[ver].extend([{**{"name": k}, **v} for k, v in param.items() if isinstance(v, dict)]) 340 | 341 | prepared_alg_set = PGConfigurator.prepare_alg_set(perf_alg_set_res, 'conf_perf')[pg_version] 342 | 343 | if common_conf: 344 | prepared_alg_set.extend( 345 | PGConfigurator.prepare_alg_set(common_alg_set, 'conf_common')[pg_version] 346 | ) 347 | 348 | if self.ext_params is not None and len(self.ext_params) > 0: # ext_params initialized in unit tests 349 | prepared_alg_set.extend(self.ext_params) 350 | 351 | config_res = {} 352 | for param in prepared_alg_set: 353 | if "name" not in param: 354 | continue 355 | param_name = param["name"] 356 | value = param["alg"].rstrip().lstrip() if "alg" in param else param["const"] 357 | 358 | if ('debug_mode' in vars() or 'debug_mode' in globals()) and self.args.debug_mode: 359 | print("Processing: %s = %s" % (param_name, value)) 360 | if "const" in param: 361 | config_res[param_name] = value 362 | 363 | if "alg" in param: 364 | try: 365 | if "unit_postfix" in param: 366 | config_res[param_name] = str(eval(param["alg"])) + param["unit_postfix"] 367 | else: 368 | if "to_unit" in param and param["to_unit"] == 'as_is': 369 | config_res[param_name] = str(eval(param["alg"])) 370 | elif "to_unit" in param and param["to_unit"] == 'quote': 371 | config_res[param_name] = "'%s'" % str(eval(param["alg"])) 372 | else: 373 | config_res[param_name] = str( 374 | UnitConverter.size_to( 375 | eval(param["alg"]), 376 | system=UnitConverter.sys_pg, 377 | unit=param["to_unit"] if "to_unit" in param is not None else None 378 | ) 379 | ) 380 | exec(param_name + '=' + str(eval(param["alg"]))) 381 | except: 382 | print("Exception on processing: %s\n%s" % (param, exception_helper())) 383 | raise NameError("Invalid alg value") 384 | 385 | return dict(sorted(config_res.items())) 386 | 387 | def settings_history(self, list_versions) -> PGConfiguratorResult: 388 | res = PGConfiguratorResult 389 | configs = [] 390 | for v in sorted([ver for ver in list_versions], key=lambda x: get_major_version(x)): 391 | with open( 392 | os.path.join(self.current_dir, 'pg_settings_history', self.known_versions[v]), 393 | 'r', 394 | encoding="utf-8" 395 | ) as f: 396 | reader = csv.reader(f) 397 | next(reader, None) # skip header 398 | conf = {} 399 | for row in reader: 400 | conf[row[0]] = { 401 | "value": row[1], 402 | "boot_val": row[3], 403 | "unit": row[4] 404 | } 405 | configs.append(conf) 406 | 407 | print_header("Deprecated parameters") 408 | for v in [k for k, _ in configs[0].items() if k not in configs[1]]: 409 | print("%s = %s" % (v, str(configs[0][v]))) 410 | 411 | print_header("New parameters") 412 | for v in [k for k, _ in configs[1].items() if k not in configs[0]]: 413 | print("%s = %s" % (v, str(configs[1][v]))) 414 | 415 | print_header("Changed boot_val") 416 | for k, v in configs[1].items(): 417 | if k in configs[0] and v["boot_val"] != configs[0][k]["boot_val"]: 418 | print('%s = %s -> %s # %s -> %s' % ( 419 | k, 420 | configs[0][k]["boot_val"], 421 | v["boot_val"], 422 | str(configs[0][k]), 423 | str(v) 424 | )) 425 | 426 | print_header("Changed unit") 427 | for k, v in configs[1].items(): 428 | if k in configs[0] and v["unit"] != configs[0][k]["unit"]: 429 | print('%s = %s -> %s # %s -> %s' % ( 430 | k, 431 | configs[0][k]["unit"], 432 | v["unit"], 433 | str(configs[0][k]), 434 | str(v) 435 | )) 436 | res.result_code = ResultCode.DONE 437 | res.result_data = { 438 | "Deprecated parameters": { 439 | v: configs[0][v] for v in [k for k, _ in configs[0].items() if k not in configs[1]] 440 | }, 441 | "New parameters": { 442 | v: configs[1][v] for v in [k for k, _ in configs[1].items() if k not in configs[0]] 443 | }, 444 | "Changed boot_val": { 445 | k: { 446 | "old": configs[0][k]["boot_val"], 447 | "new": v["boot_val"] 448 | } for k, v in configs[1].items() 449 | if k in configs[0] and v["boot_val"] != configs[0][k]["boot_val"] 450 | }, 451 | "Changed unit": { 452 | k: { 453 | "old": configs[0][k]["unit"], 454 | "new": v["unit"] 455 | } for k, v in configs[1].items() 456 | if k in configs[0] and v["unit"] != configs[0][k]["unit"] 457 | } 458 | } 459 | return res 460 | 461 | def specific_setting_history(self, setting_name) -> PGConfiguratorResult: 462 | res = PGConfiguratorResult 463 | configs = [] 464 | for v in sorted([ver for ver in self.known_versions], key=lambda x: get_major_version(x)): 465 | with open( 466 | os.path.join(self.current_dir, 'pg_settings_history', self.known_versions[v]), 467 | 'r', 468 | encoding="utf-8" 469 | ) as f: 470 | reader = csv.reader(f) 471 | next(reader, None) # skip header 472 | conf = {} 473 | for row in reader: 474 | if row[0] == setting_name: 475 | conf[v] = { 476 | "setting": row[0], 477 | "value": row[1], 478 | "boot_val": row[3], 479 | "unit": row[4] 480 | } 481 | continue 482 | if len(conf) == 0: 483 | conf[v] = { 484 | "setting": "not exists", 485 | "value": "", 486 | "boot_val": "", 487 | "unit": "" 488 | } 489 | configs.append(conf) 490 | 491 | res.result_code = ResultCode.DONE 492 | res.result_data = configs 493 | print(str(json.dumps(configs, indent=4))) 494 | return res 495 | 496 | @staticmethod 497 | def get_arg_parser(): 498 | parser = argparse.ArgumentParser() 499 | mca = get_default_args(PGConfigurator.make_conf) 500 | 501 | parser.add_argument( 502 | "--version", 503 | help="Show the version number and exit", 504 | action='store_true', 505 | default=False 506 | ) 507 | parser.add_argument( 508 | "--debug", 509 | help="Enable debug mode, (default: %(default)s)", 510 | action='store_true', 511 | default=False 512 | ) 513 | parser.add_argument( 514 | "--output-format", 515 | help="Specify output format, (default: %(default)s)", 516 | type=OutputFormat, 517 | choices=list(OutputFormat), 518 | default=OutputFormat.CONF.value 519 | ) 520 | parser.add_argument( 521 | "--output-file-name", 522 | help="Save to file", 523 | type=str, 524 | default='' 525 | ) 526 | parser.add_argument( 527 | "--db-cpu", 528 | help="Available CPU cores, (default: %(default)s)", 529 | type=str, 530 | default=psutil.cpu_count() 531 | ) 532 | parser.add_argument( 533 | "--db-ram", 534 | help="Available RAM memory, (default: %(default)s)", 535 | type=str, 536 | default=UnitConverter.size_to(psutil.virtual_memory().total, system=UnitConverter.sys_iec) 537 | ) 538 | parser.add_argument( 539 | "--db-disk-type", 540 | help="Disks type, (default: %(default)s)", 541 | type=DiskType, 542 | choices=list(DiskType), 543 | default=mca["disk_type"].value 544 | ) 545 | parser.add_argument( 546 | "--db-duty", 547 | help="Database duty, (default: %(default)s)", 548 | type=DutyDB, 549 | choices=list(DutyDB), 550 | default=mca["duty_db"].value 551 | ) 552 | parser.add_argument( 553 | "--replication-enabled", 554 | help="Replication is enabled, (default: %(default)s)", 555 | type=bool, 556 | default=mca["replication_enabled"] 557 | ) 558 | parser.add_argument( 559 | "--pg-version", 560 | help="PostgreSQL version, (default: %(default)s)", 561 | type=str, 562 | choices=list(["9.6", "10", "11", "12", "13", "14", "15", "16", "17"]), 563 | default=mca["pg_version"] 564 | ) 565 | parser.add_argument( 566 | "--reserved-ram-percent", 567 | help="Reserved RAM memory part, (default: %(default)s)", 568 | type=float, 569 | default=mca["reserved_ram_percent"] 570 | ) 571 | parser.add_argument( 572 | "--reserved-system-ram", 573 | help="Reserved system RAM memory, (default: %(default)s)", 574 | type=str, 575 | default=mca["reserved_system_ram"] 576 | ) 577 | parser.add_argument( 578 | "--shared-buffers-part", 579 | help="Shared buffers part, (default: %(default)s)", 580 | type=float, 581 | default=mca["shared_buffers_part"] 582 | ) 583 | parser.add_argument( 584 | "--client-mem-part", 585 | help="Memory part for all available connections, (default: %(default)s)", 586 | type=float, 587 | default=mca["client_mem_part"] 588 | ) 589 | parser.add_argument( 590 | "--maintenance-mem-part", 591 | help="Memory part for maintenance connections, (default: %(default)s)", 592 | type=float, 593 | default=mca["maintenance_mem_part"] 594 | ) 595 | parser.add_argument( 596 | "--autovacuum-workers-mem-part", 597 | help="Memory part of maintenance-mem, (default: %(default)s)", 598 | type=float, 599 | default=mca["autovacuum_workers_mem_part"] 600 | ) 601 | parser.add_argument( 602 | "--maintenance-conns-mem-part", 603 | help="Memory part of maintenance-mem, (default: %(default)s)", 604 | type=float, 605 | default=mca["maintenance_conns_mem_part"] 606 | ) 607 | parser.add_argument( 608 | "--min-conns", 609 | help="Min client connection, (default: %(default)s)", 610 | type=int, 611 | default=mca["min_conns"] 612 | ) 613 | parser.add_argument( 614 | "--max-conns", 615 | help="Max client connection, (default: %(default)s)", 616 | type=int, 617 | default=mca["max_conns"] 618 | ) 619 | parser.add_argument( 620 | "--min-autovac-workers", 621 | help="Min autovacuum workers, (default: %(default)s)", 622 | type=int, 623 | default=mca["min_autovac_workers"] 624 | ) 625 | parser.add_argument( 626 | "--max-autovac-workers", 627 | help="Max autovacuum workers, (default: %(default)s)", 628 | type=int, 629 | default=mca["max_autovac_workers"] 630 | ) 631 | parser.add_argument( 632 | "--min-maint-conns", 633 | help="Min maintenance connections, (default: %(default)s)", 634 | type=int, 635 | default=mca["min_maint_conns"] 636 | ) 637 | parser.add_argument( 638 | "--max-maint-conns", 639 | help="Max maintenance connections, (default: %(default)s)", 640 | type=int, 641 | default=mca["max_maint_conns"] 642 | ) 643 | parser.add_argument( 644 | "--common-conf", 645 | help="Add common part of postgresql.conf (like stats collector options, logging, etc...)", 646 | action='store_true', 647 | default=False 648 | ) 649 | parser.add_argument( 650 | "--platform", 651 | help="Platform on which the DB is running, (default: %(default)s)", 652 | type=Platform, 653 | choices=list(Platform), 654 | default=mca["platform"].value 655 | ) 656 | parser.add_argument( 657 | "--settings-history", 658 | help="Show differences in pg_settings for specific versions: for example --settings-history=9.6,15", 659 | type=str, 660 | default="" 661 | ) 662 | parser.add_argument( 663 | "--conf-profiles", 664 | help="Select settings profile from \"conf_profiles\" directory. Multiple values also supported", 665 | type=str, 666 | default="" 667 | ) 668 | parser.add_argument( 669 | "--specific-setting-history", 670 | help="Show specific specific: for example --specific-setting-history=max_parallel_maintenance_workers", 671 | type=str, 672 | default="" 673 | ) 674 | 675 | return parser 676 | 677 | 678 | def run_pgc(external_args=None, ext_params=None) -> PGConfiguratorResult: 679 | res = PGConfiguratorResult 680 | 681 | if external_args is not None: 682 | args = external_args 683 | pgc = PGConfigurator(external_args, ext_params) 684 | else: 685 | args = PGConfigurator.get_arg_parser().parse_args() 686 | pgc = PGConfigurator(args, ext_params) 687 | 688 | debug_mode = args.debug 689 | 690 | dt = datetime.datetime.now().isoformat(' ') 691 | if debug_mode: 692 | print('%s %s started' % (dt, os.path.basename(__file__))) 693 | 694 | if debug_mode: 695 | print("#--------------- Incoming parameters") 696 | for arg in vars(args): 697 | print("# %s = %s" % (arg, getattr(args, arg))) 698 | print("#-----------------------------------") 699 | 700 | if args.version: 701 | print("Version %s" % (__version__)) 702 | return True 703 | 704 | if args.settings_history != '': 705 | list_versions = args.settings_history.split(',') 706 | 707 | if len(list_versions) != 2: 708 | print("Wrong input value! Example: --settings-history=9.6,15") 709 | for v in list_versions: 710 | if v not in pgc.known_versions: 711 | print("Unknown version: %s" % v) 712 | sys.exit(0) 713 | return pgc.settings_history(list_versions) 714 | 715 | if args.specific_setting_history != '': 716 | return pgc.specific_setting_history(args.specific_setting_history) 717 | 718 | conf = pgc.make_conf( 719 | args.db_cpu, 720 | args.db_ram, 721 | disk_type=args.db_disk_type, 722 | duty_db=args.db_duty, 723 | replication_enabled=args.replication_enabled, 724 | pg_version=args.pg_version, 725 | reserved_ram_percent=args.reserved_ram_percent, 726 | reserved_system_ram=args.reserved_system_ram, 727 | shared_buffers_part=args.shared_buffers_part, 728 | client_mem_part=args.client_mem_part, 729 | maintenance_mem_part=args.maintenance_mem_part, 730 | autovacuum_workers_mem_part=args.autovacuum_workers_mem_part, 731 | maintenance_conns_mem_part=args.maintenance_conns_mem_part, 732 | min_conns=args.min_conns, 733 | max_conns=args.max_conns, 734 | min_autovac_workers=args.min_autovac_workers, 735 | max_autovac_workers=args.max_autovac_workers, 736 | min_maint_conns=args.min_maint_conns, 737 | max_maint_conns=args.max_maint_conns, 738 | platform=args.platform, 739 | common_conf=args.common_conf, 740 | conf_profiles=args.conf_profiles 741 | ) 742 | 743 | out_conf = '' 744 | if args.output_format == OutputFormat.CONF: 745 | header = """# pgconfigurator version %s started on %s at %s 746 | # =============> Parameters\n""" % ( 747 | __version__, socket.gethostname(), 748 | datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S') 749 | ) 750 | # if args.output_file_name is None: print(header) 751 | out_conf += header 752 | for arg in vars(args): 753 | # if args.output_file_name is None: print("# %s = %s" % (arg, getattr(args, arg))) 754 | out_conf += '# %s = %s\n' % (arg, getattr(args, arg)) 755 | 756 | for key, val in conf.items(): 757 | # if args.output_file_name is None: print('%s = %s\n' % (key, val)) 758 | out_conf += '%s = %s\n' % (key, val) 759 | 760 | if args.output_format == OutputFormat.JSON: 761 | out_conf = json.dumps(conf, indent=4) 762 | 763 | if args.output_format == OutputFormat.PATRONI_JSON: 764 | for key, val in conf.items(): 765 | conf[key] = val.strip("'") 766 | patroni_conf = { 767 | "postgresql": { 768 | "parameters": conf 769 | } 770 | } 771 | out_conf = json.dumps(patroni_conf, indent=4) 772 | 773 | if args.output_file_name != '': 774 | if os.path.isdir(args.output_file_name): 775 | print("--output-file-name is a directory!") 776 | print(out_conf) 777 | else: 778 | if os.path.exists(args.output_file_name): 779 | os.rename( 780 | args.output_file_name, 781 | args.output_file_name + "_" + str(datetime.datetime.now().timestamp()).split('.')[0] 782 | ) 783 | 784 | with open(args.output_file_name, "w") as output_file_name: 785 | output_file_name.write(out_conf) 786 | print("pgconfigurator finished!") 787 | else: 788 | print(out_conf) 789 | 790 | res.result_data = conf 791 | res.result_code = ResultCode.DONE 792 | 793 | return res 794 | --------------------------------------------------------------------------------