PageRenderTime 55ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/files/gitlab-cookbooks/gitlab/templates/default/postgresql.conf.erb

https://gitlab.com/jbyrd/omnibus-gitlab
Ruby HTML | 560 lines | 455 code | 105 blank | 0 comment | 11 complexity | 0b18d90672c85045fa028039e893786c MD5 | raw file
  1. # This file is managed by gitlab-ctl. Manual changes will be
  2. # erased! To change the contents below, edit /etc/gitlab/gitlab.rb
  3. # and run `sudo gitlab-ctl reconfigure`.
  4. # -----------------------------
  5. # PostgreSQL configuration file
  6. # -----------------------------
  7. #
  8. # This file consists of lines of the form:
  9. #
  10. # name = value
  11. #
  12. # (The "=" is optional.) Whitespace may be used. Comments are introduced with
  13. # "#" anywhere on a line. The complete list of parameter names and allowed
  14. # values can be found in the PostgreSQL documentation.
  15. #
  16. # The commented-out settings shown in this file represent the default values.
  17. # Re-commenting a setting is NOT sufficient to revert it to the default value;
  18. # you need to reload the server.
  19. #
  20. # This file is read on server startup and when the server receives a SIGHUP
  21. # signal. If you edit the file on a running system, you have to SIGHUP the
  22. # server for the changes to take effect, or use "pg_ctl reload". Some
  23. # parameters, which are marked below, require a server shutdown and restart to
  24. # take effect.
  25. #
  26. # Any parameter can also be given as a command-line option to the server, e.g.,
  27. # "postgres -c log_connections=on". Some parameters can be changed at run time
  28. # with the "SET" SQL command.
  29. #
  30. # Memory units: kB = kilobytes Time units: ms = milliseconds
  31. # MB = megabytes s = seconds
  32. # GB = gigabytes min = minutes
  33. # h = hours
  34. # d = days
  35. #------------------------------------------------------------------------------
  36. # FILE LOCATIONS
  37. #------------------------------------------------------------------------------
  38. # The default values of these variables are driven from the -D command-line
  39. # option or PGDATA environment variable, represented here as ConfigDir.
  40. #data_directory = 'ConfigDir' # use data in another directory
  41. # (change requires restart)
  42. #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
  43. # (change requires restart)
  44. #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
  45. # (change requires restart)
  46. # If external_pid_file is not explicitly set, no extra PID file is written.
  47. #external_pid_file = '(none)' # write an extra PID file
  48. # (change requires restart)
  49. #------------------------------------------------------------------------------
  50. # CONNECTIONS AND AUTHENTICATION
  51. #------------------------------------------------------------------------------
  52. # - Connection Settings -
  53. listen_addresses = '<%= node['gitlab']['postgresql']['listen_address'] %>' # what IP address(es) to listen on;
  54. # comma-separated list of addresses;
  55. # defaults to 'localhost', '*' = all
  56. # (change requires restart)
  57. port = <%= node['gitlab']['postgresql']['port'] %> # (change requires restart)
  58. max_connections = <%= node['gitlab']['postgresql']['max_connections'] %> # (change requires restart)
  59. # Note: Increasing max_connections costs ~400 bytes of shared memory per
  60. # connection slot, plus lock space (see max_locks_per_transaction).
  61. #superuser_reserved_connections = 3 # (change requires restart)
  62. unix_socket_directory = '<%= node['gitlab']['postgresql']['unix_socket_directory'] %>' # (change requires restart)
  63. #unix_socket_group = '' # (change requires restart)
  64. #unix_socket_permissions = 0777 # begin with 0 to use octal notation
  65. # (change requires restart)
  66. #bonjour = off # advertise server via Bonjour
  67. # (change requires restart)
  68. #bonjour_name = '' # defaults to the computer name
  69. # (change requires restart)
  70. # - Security and Authentication -
  71. #authentication_timeout = 1min # 1s-600s
  72. #ssl = off # (change requires restart)
  73. #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
  74. # (change requires restart)
  75. #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
  76. #password_encryption = on
  77. #db_user_namespace = off
  78. # Kerberos and GSSAPI
  79. #krb_server_keyfile = ''
  80. #krb_srvname = 'postgres' # (Kerberos only)
  81. #krb_caseins_users = off
  82. # - TCP Keepalives -
  83. # see "man 7 tcp" for details
  84. #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
  85. # 0 selects the system default
  86. #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
  87. # 0 selects the system default
  88. #tcp_keepalives_count = 0 # TCP_KEEPCNT;
  89. # 0 selects the system default
  90. #------------------------------------------------------------------------------
  91. # RESOURCE USAGE (except WAL)
  92. #------------------------------------------------------------------------------
  93. # - Memory -
  94. shared_buffers = <%= node['gitlab']['postgresql']['shared_buffers'] %> # min 128kB
  95. # (change requires restart)
  96. #temp_buffers = 8MB # min 800kB
  97. #max_prepared_transactions = 0 # zero disables the feature
  98. # (change requires restart)
  99. # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
  100. # per transaction slot, plus lock space (see max_locks_per_transaction).
  101. # It is not advisable to set max_prepared_transactions nonzero unless you
  102. # actively intend to use prepared transactions.
  103. work_mem = <%= node['gitlab']['postgresql']['work_mem'] %> # min 64kB
  104. #maintenance_work_mem = 16MB # min 1MB
  105. #max_stack_depth = 2MB # min 100kB
  106. # - Kernel Resource Usage -
  107. #max_files_per_process = 1000 # min 25
  108. # (change requires restart)
  109. #shared_preload_libraries = '' # (change requires restart)
  110. # - Cost-Based Vacuum Delay -
  111. #vacuum_cost_delay = 0ms # 0-100 milliseconds
  112. #vacuum_cost_page_hit = 1 # 0-10000 credits
  113. #vacuum_cost_page_miss = 10 # 0-10000 credits
  114. #vacuum_cost_page_dirty = 20 # 0-10000 credits
  115. #vacuum_cost_limit = 200 # 1-10000 credits
  116. # - Background Writer -
  117. #bgwriter_delay = 200ms # 10-10000ms between rounds
  118. #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
  119. #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
  120. # - Asynchronous Behavior -
  121. #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching
  122. #------------------------------------------------------------------------------
  123. # WRITE AHEAD LOG
  124. #------------------------------------------------------------------------------
  125. # - Settings -
  126. wal_level = <%= node['gitlab']['postgresql']['wal_level'] %>
  127. # (change requires restart)
  128. #fsync = on # turns forced synchronization on or off
  129. #synchronous_commit = on # synchronization level; on, off, or local
  130. #wal_sync_method = fsync # the default is the first option
  131. # supported by the operating system:
  132. # open_datasync
  133. # fdatasync (default on Linux)
  134. # fsync
  135. # fsync_writethrough
  136. # open_sync
  137. #full_page_writes = on # recover from partial page writes
  138. #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
  139. # (change requires restart)
  140. #wal_writer_delay = 200ms # 1-10000 milliseconds
  141. #commit_delay = 0 # range 0-100000, in microseconds
  142. #commit_siblings = 5 # range 1-1000
  143. # - Checkpoints -
  144. checkpoint_segments = <%= node['gitlab']['postgresql']['checkpoint_segments'] %> # in logfile segments, min 1, 16MB each, default 3
  145. checkpoint_timeout = <%= node['gitlab']['postgresql']['checkpoint_timeout'] %> # range 30s-1h, default 5min
  146. checkpoint_completion_target = <%= node['gitlab']['postgresql']['checkpoint_completion_target'] %> # checkpoint target duration, 0.0 - 1.0, default 0.5
  147. checkpoint_warning = <%= node['gitlab']['postgresql']['checkpoint_warning'] %> # 0 disables, default 30s
  148. # - Archiving -
  149. #archive_mode = off # allows archiving to be done
  150. # (change requires restart)
  151. #archive_command = '' # command to use to archive a logfile segment
  152. #archive_timeout = 0 # force a logfile segment switch after this
  153. # number of seconds; 0 disables
  154. #------------------------------------------------------------------------------
  155. # REPLICATION
  156. #------------------------------------------------------------------------------
  157. # - Master Server -
  158. # These settings are ignored on a standby server
  159. max_wal_senders = <%= node['gitlab']['postgresql']['max_wal_senders'] %>
  160. # (change requires restart)
  161. #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds
  162. wal_keep_segments = <%= node['gitlab']['postgresql']['wal_keep_segments'] %>
  163. #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
  164. #replication_timeout = 60s # in milliseconds; 0 disables
  165. #synchronous_standby_names = '' # standby servers that provide sync rep
  166. # comma-separated list of application_name
  167. # from standby(s); '*' = all
  168. # - Standby Servers -
  169. # These settings are ignored on a master server
  170. hot_standby = <%= node['gitlab']['postgresql']['hot_standby'] %>
  171. # (change requires restart)
  172. #max_standby_archive_delay = 30s # max delay before canceling queries
  173. # when reading WAL from archive;
  174. # -1 allows indefinite delay
  175. #max_standby_streaming_delay = 30s # max delay before canceling queries
  176. # when reading streaming WAL;
  177. # -1 allows indefinite delay
  178. #wal_receiver_status_interval = 10s # send replies at least this often
  179. # 0 disables
  180. #hot_standby_feedback = off # send info from standby to prevent
  181. # query conflicts
  182. #------------------------------------------------------------------------------
  183. # QUERY TUNING
  184. #------------------------------------------------------------------------------
  185. # - Planner Method Configuration -
  186. #enable_bitmapscan = on
  187. #enable_hashagg = on
  188. #enable_hashjoin = on
  189. #enable_indexscan = on
  190. #enable_material = on
  191. #enable_mergejoin = on
  192. #enable_nestloop = on
  193. #enable_seqscan = on
  194. #enable_sort = on
  195. #enable_tidscan = on
  196. # - Planner Cost Constants -
  197. #seq_page_cost = 1.0 # measured on an arbitrary scale
  198. #random_page_cost = 4.0 # same scale as above
  199. #cpu_tuple_cost = 0.01 # same scale as above
  200. #cpu_index_tuple_cost = 0.005 # same scale as above
  201. #cpu_operator_cost = 0.0025 # same scale as above
  202. effective_cache_size = <%= node['gitlab']['postgresql']['effective_cache_size'] %> # Default 128MB
  203. # - Genetic Query Optimizer -
  204. #geqo = on
  205. #geqo_threshold = 12
  206. #geqo_effort = 5 # range 1-10
  207. #geqo_pool_size = 0 # selects default based on effort
  208. #geqo_generations = 0 # selects default based on effort
  209. #geqo_selection_bias = 2.0 # range 1.5-2.0
  210. #geqo_seed = 0.0 # range 0.0-1.0
  211. # - Other Planner Options -
  212. #default_statistics_target = 100 # range 1-10000
  213. #constraint_exclusion = partition # on, off, or partition
  214. #cursor_tuple_fraction = 0.1 # range 0.0-1.0
  215. #from_collapse_limit = 8
  216. #join_collapse_limit = 8 # 1 disables collapsing of explicit
  217. # JOIN clauses
  218. #------------------------------------------------------------------------------
  219. # ERROR REPORTING AND LOGGING
  220. #------------------------------------------------------------------------------
  221. # - Where to Log -
  222. #log_destination = 'stderr' # Valid values are combinations of
  223. # stderr, csvlog, syslog, and eventlog,
  224. # depending on platform. csvlog
  225. # requires logging_collector to be on.
  226. # This is used when logging to stderr:
  227. #logging_collector = off # Enable capturing of stderr and csvlog
  228. # into log files. Required to be on for
  229. # csvlogs.
  230. # (change requires restart)
  231. # These are only used if logging_collector is on:
  232. #log_directory = 'pg_log' # directory where log files are written,
  233. # can be absolute or relative to PGDATA
  234. #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
  235. # can include strftime() escapes
  236. #log_file_mode = 0600 # creation mode for log files,
  237. # begin with 0 to use octal notation
  238. #log_truncate_on_rotation = off # If on, an existing log file with the
  239. # same name as the new log file will be
  240. # truncated rather than appended to.
  241. # But such truncation only occurs on
  242. # time-driven rotation, not on restarts
  243. # or size-driven rotation. Default is
  244. # off, meaning append to existing files
  245. # in all cases.
  246. #log_rotation_age = 1d # Automatic rotation of logfiles will
  247. # happen after that time. 0 disables.
  248. #log_rotation_size = 10MB # Automatic rotation of logfiles will
  249. # happen after that much log output.
  250. # 0 disables.
  251. # These are relevant when logging to syslog:
  252. #syslog_facility = 'LOCAL0'
  253. #syslog_ident = 'postgres'
  254. #silent_mode = off # Run server silently.
  255. # DO NOT USE without syslog or
  256. # logging_collector
  257. # (change requires restart)
  258. # - When to Log -
  259. #client_min_messages = notice # values in order of decreasing detail:
  260. # debug5
  261. # debug4
  262. # debug3
  263. # debug2
  264. # debug1
  265. # log
  266. # notice
  267. # warning
  268. # error
  269. #log_min_messages = warning # values in order of decreasing detail:
  270. # debug5
  271. # debug4
  272. # debug3
  273. # debug2
  274. # debug1
  275. # info
  276. # notice
  277. # warning
  278. # error
  279. # log
  280. # fatal
  281. # panic
  282. #log_min_error_statement = error # values in order of decreasing detail:
  283. # debug5
  284. # debug4
  285. # debug3
  286. # debug2
  287. # debug1
  288. # info
  289. # notice
  290. # warning
  291. # error
  292. # log
  293. # fatal
  294. # panic (effectively off)
  295. log_min_duration_statement = <%= @log_min_duration_statement %> # -1 is disabled, 0 logs all statements
  296. # and their durations, > 0 logs only
  297. # statements running at least this number
  298. # of milliseconds
  299. # - What to Log -
  300. #debug_print_parse = off
  301. #debug_print_rewritten = off
  302. #debug_print_plan = off
  303. #debug_pretty_print = on
  304. #log_checkpoints = off
  305. #log_connections = off
  306. #log_disconnections = off
  307. #log_duration = off
  308. #log_error_verbosity = default # terse, default, or verbose messages
  309. #log_hostname = off
  310. #log_line_prefix = '' # special values:
  311. # %a = application name
  312. # %u = user name
  313. # %d = database name
  314. # %r = remote host and port
  315. # %h = remote host
  316. # %p = process ID
  317. # %t = timestamp without milliseconds
  318. # %m = timestamp with milliseconds
  319. # %i = command tag
  320. # %e = SQL state
  321. # %c = session ID
  322. # %l = session line number
  323. # %s = session start timestamp
  324. # %v = virtual transaction ID
  325. # %x = transaction ID (0 if none)
  326. # %q = stop here in non-session
  327. # processes
  328. # %% = '%'
  329. # e.g. '<%u%%%d> '
  330. #log_lock_waits = off # log lock waits >= deadlock_timeout
  331. #log_statement = 'none' # none, ddl, mod, all
  332. #log_temp_files = -1 # log temporary files equal or larger
  333. # than the specified size in kilobytes;
  334. # -1 disables, 0 logs all temp files
  335. #log_timezone = '(defaults to server environment setting)'
  336. #------------------------------------------------------------------------------
  337. # RUNTIME STATISTICS
  338. #------------------------------------------------------------------------------
  339. # - Query/Index Statistics Collector -
  340. #track_activities = on
  341. #track_counts = on
  342. #track_functions = none # none, pl, all
  343. #track_activity_query_size = 1024 # (change requires restart)
  344. #update_process_title = on
  345. #stats_temp_directory = 'pg_stat_tmp'
  346. # - Statistics Monitoring -
  347. #log_parser_stats = off
  348. #log_planner_stats = off
  349. #log_executor_stats = off
  350. #log_statement_stats = off
  351. #------------------------------------------------------------------------------
  352. # AUTOVACUUM PARAMETERS
  353. #------------------------------------------------------------------------------
  354. #autovacuum = on # Enable autovacuum subprocess? 'on'
  355. # requires track_counts to also be on.
  356. #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
  357. # their durations, > 0 logs only
  358. # actions running at least this number
  359. # of milliseconds.
  360. #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
  361. # (change requires restart)
  362. #autovacuum_naptime = 1min # time between autovacuum runs
  363. #autovacuum_vacuum_threshold = 50 # min number of row updates before
  364. # vacuum
  365. #autovacuum_analyze_threshold = 50 # min number of row updates before
  366. # analyze
  367. #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
  368. #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
  369. #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
  370. # (change requires restart)
  371. #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
  372. # autovacuum, in milliseconds;
  373. # -1 means use vacuum_cost_delay
  374. #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
  375. # autovacuum, -1 means use
  376. # vacuum_cost_limit
  377. #------------------------------------------------------------------------------
  378. # CLIENT CONNECTION DEFAULTS
  379. #------------------------------------------------------------------------------
  380. # - Statement Behavior -
  381. #search_path = '"$user",public' # schema names
  382. #default_tablespace = '' # a tablespace name, '' uses the default
  383. #temp_tablespaces = '' # a list of tablespace names, '' uses
  384. # only default tablespace
  385. #check_function_bodies = on
  386. #default_transaction_isolation = 'read committed'
  387. #default_transaction_read_only = off
  388. #default_transaction_deferrable = off
  389. #session_replication_role = 'origin'
  390. #statement_timeout = 0 # in milliseconds, 0 is disabled
  391. #vacuum_freeze_min_age = 50000000
  392. #vacuum_freeze_table_age = 150000000
  393. #bytea_output = 'hex' # hex, escape
  394. #xmlbinary = 'base64'
  395. #xmloption = 'content'
  396. # - Locale and Formatting -
  397. datestyle = 'iso, mdy'
  398. #intervalstyle = 'postgres'
  399. #timezone = '(defaults to server environment setting)'
  400. #timezone_abbreviations = 'Default' # Select the set of available time zone
  401. # abbreviations. Currently, there are
  402. # Default
  403. # Australia
  404. # India
  405. # You can create your own file in
  406. # share/timezonesets/.
  407. #extra_float_digits = 0 # min -15, max 3
  408. #client_encoding = sql_ascii # actually, defaults to database
  409. # encoding
  410. # These settings are initialized by initdb, but they can be changed.
  411. lc_messages = 'C' # locale for system error message
  412. # strings
  413. lc_monetary = 'C' # locale for monetary formatting
  414. lc_numeric = 'C' # locale for number formatting
  415. lc_time = 'C' # locale for time formatting
  416. # default configuration for text search
  417. default_text_search_config = 'pg_catalog.english'
  418. # - Other Defaults -
  419. #dynamic_library_path = '$libdir'
  420. #local_preload_libraries = ''
  421. #------------------------------------------------------------------------------
  422. # LOCK MANAGEMENT
  423. #------------------------------------------------------------------------------
  424. #deadlock_timeout = 1s
  425. #max_locks_per_transaction = 64 # min 10
  426. # (change requires restart)
  427. # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
  428. # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  429. # lock table slots.
  430. #max_pred_locks_per_transaction = 64 # min 10
  431. # (change requires restart)
  432. #------------------------------------------------------------------------------
  433. # VERSION/PLATFORM COMPATIBILITY
  434. #------------------------------------------------------------------------------
  435. # - Previous PostgreSQL Versions -
  436. #array_nulls = on
  437. #backslash_quote = safe_encoding # on, off, or safe_encoding
  438. #default_with_oids = off
  439. #escape_string_warning = on
  440. #lo_compat_privileges = off
  441. #quote_all_identifiers = off
  442. #sql_inheritance = on
  443. #standard_conforming_strings = on
  444. #synchronize_seqscans = on
  445. # - Other Platforms and Clients -
  446. #transform_null_equals = off
  447. #------------------------------------------------------------------------------
  448. # ERROR HANDLING
  449. #------------------------------------------------------------------------------
  450. #exit_on_error = off # terminate session on any error?
  451. #restart_after_crash = on # reinitialize after backend crash?
  452. #------------------------------------------------------------------------------
  453. # CUSTOMIZED OPTIONS
  454. #------------------------------------------------------------------------------
  455. #custom_variable_classes = '' # list of custom variable class names