libunibreak: update to 5.1 and add test results
[oi-userland.git] / components / database / pgbouncer / files / pgbouncer.ini
blobd6584ab0a08b3f1e97ba396b99d2110c87af05be
1 ;;;
2 ;;; PgBouncer configuration file
3 ;;;
5 ;; database name = connect string
6 ;;
7 ;; connect string params:
8 ;; dbname= host= port= user= password= auth_user=
9 ;; client_encoding= datestyle= timezone=
10 ;; pool_size= reserve_pool= max_db_connections=
11 ;; pool_mode= connect_query= application_name=
12 [databases]
14 ;; foodb over Unix socket
15 ;foodb =
17 ;; redirect bardb to bazdb on localhost
18 ;bardb = host=localhost dbname=bazdb
20 ;; access to dest database will go with single user
21 ;forcedb = host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO connect_query='SELECT 1'
23 ;; use custom pool sizes
24 ;nondefaultdb = pool_size=50 reserve_pool=10
26 ;; use auth_user with auth_query if user not present in auth_file
27 ;; auth_user must exist in auth_file
28 ; foodb = auth_user=bar
30 ;; fallback connect string
31 ;* = host=testserver
33 ; This corresponds to server started through the SMF service
34 postgres = host=127.0.0.1 port=5432 user=postgres
36 ;; User-specific configuration
37 [users]
39 ;user1 = pool_mode=transaction max_user_connections=10
41 ;; Configuration section
42 [pgbouncer]
44 ;;;
45 ;;; Administrative settings
46 ;;;
48 logfile = /var/postgres/pgbouncer/pgbouncer.log
49 pidfile = /var/postgres/pgbouncer/pgbouncer.pid
51 ;;;
52 ;;; Where to wait for clients
53 ;;;
55 ;; IP address or * which means all IPs
56 listen_addr = 127.0.0.1
57 listen_port = 6432
59 ;; Unix socket is also used for -R.
60 ;; On Debian it should be /var/run/postgresql
61 ;unix_socket_dir = /tmp
62 ;unix_socket_mode = 0777
63 ;unix_socket_group =
65 ;;;
66 ;;; TLS settings for accepting clients
67 ;;;
69 ;; disable, allow, require, verify-ca, verify-full
70 ;client_tls_sslmode = disable
72 ;; Path to file that contains trusted CA certs
73 ;client_tls_ca_file = <system default>
75 ;; Private key and cert to present to clients.
76 ;; Required for accepting TLS connections from clients.
77 ;client_tls_key_file =
78 ;client_tls_cert_file =
80 ;; fast, normal, secure, legacy, <ciphersuite string>
81 ;client_tls_ciphers = fast
83 ;; all, secure, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
84 ;client_tls_protocols = all
86 ;; none, auto, legacy
87 ;client_tls_dheparams = auto
89 ;; none, auto, <curve name>
90 ;client_tls_ecdhcurve = auto
92 ;;;
93 ;;; TLS settings for connecting to backend databases
94 ;;;
96 ;; disable, allow, require, verify-ca, verify-full
97 ;server_tls_sslmode = disable
99 ;; Path to that contains trusted CA certs
100 ;server_tls_ca_file = <system default>
102 ;; Private key and cert to present to backend.
103 ;; Needed only if backend server require client cert.
104 ;server_tls_key_file =
105 ;server_tls_cert_file =
107 ;; all, secure, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
108 ;server_tls_protocols = all
110 ;; fast, normal, secure, legacy, <ciphersuite string>
111 ;server_tls_ciphers = fast
114 ;;; Authentication settings
117 ;; any, trust, plain, md5, cert, hba, pam
118 auth_type = any
119 auth_file = /etc/pgbouncer/userlist.txt
121 ;; Path to HBA-style auth config
122 ;auth_hba_file =
124 ;; Query to use to fetch password from database. Result
125 ;; must have 2 columns - username and password hash.
126 ;auth_query = SELECT usename, passwd FROM pg_shadow WHERE usename=$1
129 ;;; Users allowed into database 'pgbouncer'
132 ;; comma-separated list of users who are allowed to change settings
133 ;admin_users = user2, someadmin, otheradmin
135 ;; comma-separated list of users who are just allowed to use SHOW command
136 ;stats_users = stats, root
139 ;;; Pooler personality questions
142 ;; When server connection is released back to pool:
143 ;; session - after client disconnects (default)
144 ;; transaction - after transaction finishes
145 ;; statement - after statement finishes
146 ;pool_mode = session
148 ;; Query for cleaning connection immediately after releasing from
149 ;; client. No need to put ROLLBACK here, pgbouncer does not reuse
150 ;; connections where transaction is left open.
151 ;server_reset_query = DISCARD ALL
153 ;; Whether server_reset_query should run in all pooling modes. If it
154 ;; is off, server_reset_query is used only for session-pooling.
155 ;server_reset_query_always = 0
157 ;; Comma-separated list of parameters to ignore when given in startup
158 ;; packet. Newer JDBC versions require the extra_float_digits here.
159 ;ignore_startup_parameters = extra_float_digits
161 ;; When taking idle server into use, this query is run first.
162 ;server_check_query = select 1
164 ;; If server was used more recently that this many seconds ago,
165 ; skip the check query. Value 0 may or may not run in immediately.
166 ;server_check_delay = 30
168 ;; Close servers in session pooling mode after a RECONNECT, RELOAD,
169 ;; etc. when they are idle instead of at the end of the session.
170 ;server_fast_close = 0
172 ;; Use <appname - host> as application_name on server.
173 ;application_name_add_host = 0
175 ;; Period for updating aggregated stats.
176 ;stats_period = 60
179 ;;; Connection limits
182 ;; Total number of clients that can connect
183 ;max_client_conn = 100
185 ;; Default pool size. 20 is good number when transaction pooling
186 ;; is in use, in session pooling it needs to be the number of
187 ;; max clients you want to handle at any moment
188 ;default_pool_size = 20
190 ;; Minimum number of server connections to keep in pool.
191 ;min_pool_size = 0
193 ; how many additional connection to allow in case of trouble
194 ;reserve_pool_size = 0
196 ;; If a clients needs to wait more than this many seconds, use reserve
197 ;; pool.
198 ;reserve_pool_timeout = 5
200 ;; How many total connections to a single database to allow from all
201 ;; pools
202 ;max_db_connections = 0
203 ;max_user_connections = 0
205 ;; If off, then server connections are reused in LIFO manner
206 ;server_round_robin = 0
209 ;;; Logging
212 ;; Syslog settings
213 ;syslog = 0
214 ;syslog_facility = daemon
215 ;syslog_ident = pgbouncer
217 ;; log if client connects or server connection is made
218 ;log_connections = 1
220 ;; log if and why connection was closed
221 ;log_disconnections = 1
223 ;; log error messages pooler sends to clients
224 ;log_pooler_errors = 1
226 ;; write aggregated stats into log
227 ;log_stats = 1
229 ;; Logging verbosity. Same as -v switch on command line.
230 ;verbose = 0
233 ;;; Timeouts
236 ;; Close server connection if its been connected longer.
237 ;server_lifetime = 3600
239 ;; Close server connection if its not been used in this time. Allows
240 ;; to clean unnecessary connections from pool after peak.
241 ;server_idle_timeout = 600
243 ;; Cancel connection attempt if server does not answer takes longer.
244 ;server_connect_timeout = 15
246 ;; If server login failed (server_connect_timeout or auth failure)
247 ;; then wait this many second.
248 ;server_login_retry = 15
250 ;; Dangerous. Server connection is closed if query does not return in
251 ;; this time. Should be used to survive network problems, _not_ as
252 ;; statement_timeout. (default: 0)
253 ;query_timeout = 0
255 ;; Dangerous. Client connection is closed if the query is not
256 ;; assigned to a server in this time. Should be used to limit the
257 ;; number of queued queries in case of a database or network
258 ;; failure. (default: 120)
259 ;query_wait_timeout = 120
261 ;; Dangerous. Client connection is closed if no activity in this
262 ;; time. Should be used to survive network problems. (default: 0)
263 ;client_idle_timeout = 0
265 ;; Disconnect clients who have not managed to log in after connecting
266 ;; in this many seconds.
267 ;client_login_timeout = 60
269 ;; Clean automatically created database entries (via "*") if they stay
270 ;; unused in this many seconds.
271 ; autodb_idle_timeout = 3600
273 ;; Close connections which are in "IDLE in transaction" state longer
274 ;; than this many seconds.
275 ;idle_transaction_timeout = 0
277 ;; How long SUSPEND/-R waits for buffer flush before closing
278 ;; connection.
279 ;suspend_timeout = 10
282 ;;; Low-level tuning options
285 ;; buffer for streaming packets
286 ;pkt_buf = 4096
288 ;; man 2 listen
289 ;listen_backlog = 128
291 ;; Max number pkt_buf to process in one event loop.
292 ;sbuf_loopcnt = 5
294 ;; Maximum PostgreSQL protocol packet size.
295 ;max_packet_size = 2147483647
297 ;; Set SO_REUSEPORT socket option
298 ;so_reuseport = 0
300 ;; networking options, for info: man 7 tcp
302 ;; Linux: Notify program about new connection only if there is also
303 ;; data received. (Seconds to wait.) On Linux the default is 45, on
304 ;; other OS'es 0.
305 ;tcp_defer_accept = 0
307 ;; In-kernel buffer size (Linux default: 4096)
308 ;tcp_socket_buffer = 0
310 ;; whether tcp keepalive should be turned on (0/1)
311 ;tcp_keepalive = 1
313 ;; The following options are Linux-specific. They also require
314 ;; tcp_keepalive=1.
316 ;; Count of keepalive packets
317 ;tcp_keepcnt = 0
319 ;; How long the connection can be idle before sending keepalive
320 ;; packets
321 ;tcp_keepidle = 0
323 ;; The time between individual keepalive probes
324 ;tcp_keepintvl = 0
326 ;; DNS lookup caching time
327 ;dns_max_ttl = 15
329 ;; DNS zone SOA lookup period
330 ;dns_zone_check_period = 0
332 ;; DNS negative result caching time
333 ;dns_nxdomain_ttl = 15
335 ;; Custom resolv.conf file, to set custom DNS servers or other options
336 ;; (default: empty = use OS settings)
337 ;resolv_conf = /etc/pgbouncer/resolv.conf
340 ;;; Random stuff
343 ;; Hackish security feature. Helps against SQL injection: when PQexec
344 ;; is disabled, multi-statement cannot be made.
345 ;disable_pqexec = 0
347 ;; Config file to use for next RELOAD/SIGHUP
348 ;; By default contains config file from command line.
349 ;conffile
351 ;; Windows service name to register as. job_name is alias for
352 ;; service_name, used by some Skytools scripts.
353 ;service_name = pgbouncer
354 ;job_name = pgbouncer
356 ;; Read additional config from other file
357 ;%include /etc/pgbouncer/pgbouncer-other.ini