Advertisement
harshancx

pgbouncer.ini

Aug 29th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. ;; database name = connect string
  2. ;;
  3. ;; connect string params:
  4. ;; dbname= host= port= user= password=
  5. ;; client_encoding= datestyle= timezone=
  6. ;; pool_size= connect_query=
  7. [databases]
  8.  
  9. drupal_d7_latest = host=/tmp
  10. drupal_d7 = host=/tmp
  11. entdb_drupal = host=/tmp
  12. nagios = host=/tmp
  13. sbp_staging = host=/tmp
  14. jforums = host=/tmp
  15.  
  16. ;; Configuration section
  17. [pgbouncer]
  18.  
  19. ;;;
  20. ;;; Administrative settings
  21. ;;;
  22.  
  23. logfile = /var/log/pgbouncer.log
  24. pidfile = /var/run/pgbouncer/pgbouncer.pid
  25.  
  26. ;;;
  27. ;;; Where to wait for clients
  28. ;;;
  29.  
  30. ; ip address or * which means all ip-s
  31. listen_addr = *
  32. listen_port = 6432
  33.  
  34. ; unix socket is also used for -R.
  35. ; On debian it should be /var/run/postgresql
  36. unix_socket_dir = /tmp
  37. ;unix_socket_mode = 0777
  38. ;unix_socket_group =
  39.  
  40. ;;;
  41. ;;; Authentication settings
  42. ;;;
  43.  
  44. ; any, trust, plain, crypt, md5
  45. auth_type = md5
  46. auth_file = /etc/pgbouncer/userlist.txt
  47.  
  48. ;;;
  49. ;;; Users allowed into database 'pgbouncer'
  50. ;;;
  51.  
  52. ; comma-separated list of users, who are allowed to change settings
  53. admin_users = postgres
  54.  
  55. ; comma-separated list of users who are just allowed to use SHOW command
  56. stats_users = stats, postgres
  57.  
  58. ;;;
  59. ;;; Pooler personality questions
  60. ;;;
  61.  
  62. ; When server connection is released back to pool:
  63. ; session - after client disconnects
  64. ; transaction - after transaction finishes
  65. ; statement - after statement finishes
  66. pool_mode = session
  67.  
  68. ;
  69. ; Query for cleaning connection immediately after releasing from client.
  70. ; No need to put ROLLBACK here, pgbouncer does not reuse connections
  71. ; where transaction is left open.
  72. ;
  73. ; Query for 8.3+:
  74. ; DISCARD ALL;
  75. ;
  76. ; Older versions:
  77. ; RESET ALL; SET SESSION AUTHORIZATION DEFAULT
  78. ;
  79. ; Empty if transaction pooling is in use.
  80. ;
  81. server_reset_query = DISCARD ALL
  82.  
  83. ;
  84. ; Comma-separated list of parameters to ignore when given
  85. ; in startup packet. Newer JDBC versions require the
  86. ; extra_float_digits here.
  87. ;
  88. ignore_startup_parameters = extra_float_digits
  89.  
  90. ;
  91. ; When taking idle server into use, this query is ran first.
  92. ; SELECT 1
  93. ;
  94. ;server_check_query = select 1
  95.  
  96. ; If server was used more recently that this many seconds ago,
  97. ; skip the check query. Value 0 may or may not run in immediately.
  98. ;server_check_delay = 30
  99.  
  100. ;;;
  101. ;;; Connection limits
  102. ;;;
  103.  
  104. ; total number of clients that can connect
  105. max_client_conn = 600
  106.  
  107. ; default pool size. 20 is good number when transaction pooling
  108. ; is in use, in session pooling it needs to be the number of
  109. ; max clients you want to handle at any moment
  110. default_pool_size = 75
  111.  
  112. ; how many additional connection to allow in case of trouble
  113. ;reserve_pool_size = 5
  114.  
  115. ; if a clients needs to wait more than this many seconds, use reserve pool
  116. ;reserve_pool_timeout = 3
  117.  
  118. ; log if client connects or server connection is made
  119. log_connections = 0
  120.  
  121. ; log if and why connection was closed
  122. log_disconnections = 0
  123.  
  124. ; log error messages pooler sends to clients
  125. ;log_pooler_errors = 1
  126.  
  127.  
  128. ; If off, then server connections are reused in LIFO manner
  129. ;server_round_robin = 0
  130.  
  131. ;;;
  132. ;;; Timeouts
  133. ;;;
  134.  
  135. ;; Close server connection if its been connected longer.
  136. ;server_lifetime = 1200
  137.  
  138. ;; Close server connection if its not been used in this time.
  139. ;; Allows to clean unnecessary connections from pool after peak.
  140. ;server_idle_timeout = 60
  141.  
  142. ;; Cancel connection attempt if server does not answer takes longer.
  143. ;server_connect_timeout = 15
  144.  
  145. ;; If server login failed (server_connect_timeout or auth failure)
  146. ;; then wait this many second.
  147. ;server_login_retry = 15
  148.  
  149. ;; Dangerous. Server connection is closed if query does not return
  150. ;; in this time. Should be used to survive network problems,
  151. ;; _not_ as statement_timeout. (default: 0)
  152. ;query_timeout = 0
  153.  
  154. ;; Dangerous. Client connection is closed if the query is not assigned
  155. ;; to a server in this time. Should be used to limit the number of queued
  156. ;; queries in case of a database or network failure. (default: 0)
  157. ;query_wait_timeout = 0
  158.  
  159. ;; Dangerous. Client connection is closed if no activity in this time.
  160. ;; Should be used to survive network problems. (default: 0)
  161. ;client_idle_timeout = 0
  162.  
  163. ;; Disconnect clients who have not managed to log in after connecting
  164. ;; in this many seconds.
  165. ;client_login_timeout = 60
  166.  
  167. ;; Clean automatically created database entries (via "*") if they
  168. ;; stay unused in this many seconds.
  169. ; autodb_idle_timeout = 3600
  170.  
  171. ;;;
  172. ;;; Low-level tuning options
  173. ;;;
  174.  
  175. ;; buffer for streaming packets
  176. ;pkt_buf = 2048
  177.  
  178. ;; man 2 listen
  179. ;listen_backlog = 128
  180.  
  181. ;; networking options, for info: man 7 tcp
  182.  
  183. ;; Linux: notify program about new connection only if there
  184. ;; is also data received. (Seconds to wait.)
  185. ;; On Linux the default is 45, on other OS'es 0.
  186. ;tcp_defer_accept = 0
  187.  
  188. ;; In-kernel buffer size (Linux default: 4096)
  189. ;tcp_socket_buffer = 0
  190.  
  191. ;; whether tcp keepalive should be turned on (0/1)
  192. ;tcp_keepalive = 1
  193.  
  194. ;; following options are Linux-specific.
  195. ;; they also require tcp_keepalive=1
  196.  
  197. ;; count of keepaliva packets
  198. ;tcp_keepcnt = 0
  199.  
  200. ;; how long the connection can be idle,
  201. ;; before sending keepalive packets
  202. ;tcp_keepidle = 0
  203.  
  204. ;; The time between individual keepalive probes.
  205. ;tcp_keepintvl = 0
  206.  
  207. ;; DNS lookup caching time
  208. ;dns_max_ttl = 15
  209.  
  210. ;; DNS zone SOA lookup period
  211. ;dns_zone_check_period = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement