postgresql-min.conf 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # See postgresql.conf.sample for a full conf file
  2. listen_addresses = '*' # what IP address(es) to listen on;
  3. max_connections = 2000 # (change requires restart)
  4. ssl = false # (change requires restart)
  5. # - Memory -
  6. # values from: http://blog.pgaddict.com/posts/performance-since-postgresql-7-4-to-9-4-pgbench
  7. # details: http://www.postgresql.org/docs/9.4/static/runtime-config-resource.html
  8. # http://www.postgresql.org/docs/9.4/static/runtime-config-wal.html
  9. # http://www.postgresql.org/docs/9.4/static/runtime-config-query.html
  10. shared_buffers = 256MB # min 128kB
  11. work_mem = 64MB # min 64kB
  12. maintenance_work_mem = 512MB # min 1MB
  13. # checkpoint_segments = 64
  14. checkpoint_completion_target = 0.9
  15. effective_cache_size = 8GB
  16. # when executed on the SSD (otherwise 4)
  17. random_page_cost = 2
  18. shared_preload_libraries = 'pg_stat_statements' # (change requires restart)
  19. pg_stat_statements.track = all
  20. pg_stat_statements.max = 500000
  21. track_activity_query_size = 2048
  22. #------------------------------------------------------------------------------
  23. # WRITE AHEAD LOG
  24. #------------------------------------------------------------------------------
  25. # - Settings -
  26. wal_level = minimal # minimal, archive, or hot_standby
  27. # WARNING: disabling synchronous commit may be dangerous in certain cases.
  28. # See http://www.postgresql.org/docs/current/static/runtime-config-wal.html
  29. # for details.
  30. synchronous_commit = off
  31. #------------------------------------------------------------------------------
  32. # REPLICATION
  33. #------------------------------------------------------------------------------
  34. # - Master Server -
  35. # These settings are ignored on a standby server
  36. max_wal_senders = 0 # max number of walsender processes
  37. # (change requires restart)
  38. #------------------------------------------------------------------------------
  39. # ERROR REPORTING AND LOGGING
  40. #------------------------------------------------------------------------------
  41. log_line_prefix = '%t ' # special values:
  42. # %a = application name
  43. # %u = user name
  44. # %d = database name
  45. # %r = remote host and port
  46. # %h = remote host
  47. # %p = process ID
  48. # %t = timestamp without milliseconds
  49. # %m = timestamp with milliseconds
  50. # %i = command tag
  51. # %e = SQL state
  52. # %c = session ID
  53. # %l = session line number
  54. # %s = session start timestamp
  55. # %v = virtual transaction ID
  56. # %x = transaction ID (0 if none)
  57. # %q = stop here in non-session
  58. # processes
  59. # %% = '%'
  60. # e.g. '<%u%%%d> '
  61. #------------------------------------------------------------------------------
  62. # CLIENT CONNECTION DEFAULTS
  63. #------------------------------------------------------------------------------
  64. # - Statement Behavior -
  65. #search_path = '"$user",public' # schema names
  66. #default_tablespace = '' # a tablespace name, '' uses the default
  67. #temp_tablespaces = '' # a list of tablespace names, '' uses
  68. # only default tablespace
  69. #check_function_bodies = on
  70. #default_transaction_isolation = 'read committed'
  71. #default_transaction_read_only = off
  72. #default_transaction_deferrable = off
  73. #session_replication_role = 'origin'
  74. #statement_timeout = 0 # in milliseconds, 0 is disabled
  75. #vacuum_freeze_min_age = 50000000
  76. #vacuum_freeze_table_age = 150000000
  77. #bytea_output = 'hex' # hex, escape
  78. #xmlbinary = 'base64'
  79. #xmloption = 'content'
  80. # - Locale and Formatting -
  81. #datestyle = 'iso, mdy'
  82. #intervalstyle = 'postgres'
  83. #timezone = '(defaults to server environment setting)'
  84. #timezone_abbreviations = 'Default' # Select the set of available time zone
  85. # abbreviations. Currently, there are
  86. # Default
  87. # Australia
  88. # India
  89. # You can create your own file in
  90. # share/timezonesets/.
  91. #extra_float_digits = 0 # min -15, max 3
  92. #client_encoding = sql_ascii # actually, defaults to database
  93. # encoding
  94. # These settings are initialized by initdb, but they can be changed.
  95. #lc_messages = 'en_US.UTF-8' # locale for system error message
  96. # strings
  97. #lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
  98. #lc_numeric = 'en_US.UTF-8' # locale for number formatting
  99. #lc_time = 'en_US.UTF-8' # locale for time formatting
  100. # default configuration for text search
  101. #default_text_search_config = 'pg_catalog.english'
  102. # - Other Defaults -
  103. #dynamic_library_path = '$libdir'
  104. #local_preload_libraries = ''
  105. #------------------------------------------------------------------------------
  106. # LOCK MANAGEMENT
  107. #------------------------------------------------------------------------------
  108. #deadlock_timeout = 1s
  109. #max_locks_per_transaction = 64 # min 10
  110. # (change requires restart)
  111. # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
  112. # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  113. # lock table slots.
  114. max_pred_locks_per_transaction = 256 # min 10
  115. # (change requires restart)