postgresql.conf 5.0 KB

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