From eb2a7f303084eed543a37353a48f91b3f937a78d Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 18 Feb 2009 13:50:09 +0000 Subject: [PATCH] update docs and default config --- README | 6 +++--- doc/config.txt | 24 +++++++++++++++++++----- etc/pgbouncer.ini | 14 ++++++++++++-- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README b/README index 411b172..2c77c36 100644 --- a/README +++ b/README @@ -54,11 +54,11 @@ If cross-compiling from Unix: Running on WIN32 ---------------- -Running from command-line goes as usual, except -d (daemonize) -and -u (switch user) switches will not work. +Running from command-line goes as usual, except -d (daemonize), +-R (reboot) and -u (switch user) switches will not work. To run pgbouncer as a service, you need to configure -`service_name` to set name for service. Then: +`service_name` parameter to set name for service. Then: $ pgbouncer -regservice config.ini diff --git a/doc/config.txt b/doc/config.txt index 85d666c..2ac3a75 100644 --- a/doc/config.txt +++ b/doc/config.txt @@ -294,15 +294,23 @@ online restart. Default: 60 +==== autodb_idle_timeout ==== + +If the automatically created (vie "*") database pools have +been unused this many seconds, they are freed. The negative +aspect of that is that their statistics is also forgotten. + +Default: 3600 + === Dangerous timeouts === -Setting following timeouts cause unexcpected errors. +Setting following timeouts cause unexpected errors. ==== query_timeout ==== Queries running longer than that are canceled. This should be used only with slightly smaller server-side statement_timeout, to apply only for network -problems. +problems. [seconds] Default: 0 (disabled) @@ -310,7 +318,7 @@ Default: 0 (disabled) Client connections idling longer than that are closed. This should be larger then client-side connection lifetime settings, to apply only for network -problems. +problems. [seconds] Default: 0 (disabled) @@ -335,7 +343,7 @@ Default: 5 ==== tcp_defer_accept ==== -Details about following options shouldbe looked from man 7 tcp +Details about following options should be looked from `man 7 tcp`. Default: 45 on Linux, otherwise 0 @@ -345,7 +353,7 @@ Default: not set ==== tcp_keepalive ==== -Default: Not set +Default: not set ==== tcp_keepcnt ==== @@ -369,6 +377,12 @@ Database name can contain characters [0-9A-Za-z_.-] without quoting. Names that contain other chars need to be quoted with standard SQL ident quoting: double quotes where "" is taken as single quote. +"\*" acts as fallback database: if the exact name does not exist, +it's value is taken as connect string for requested database. +Such automatically created database entries are cleaned up +if they stay idle longer then the time specified in +`autodb_idle_timeout` parameter. + === Location parameters === ==== dbname ==== diff --git a/etc/pgbouncer.ini b/etc/pgbouncer.ini index 87bae3a..e282069 100644 --- a/etc/pgbouncer.ini +++ b/etc/pgbouncer.ini @@ -12,6 +12,9 @@ forcedb = host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE nondefaultdb = pool_size=50 reserve_pool=10 +; fallback connect string +;* = host=testserver + ;; Configuation section [pgbouncer] @@ -73,7 +76,8 @@ server_reset_query = ; ; Comma-separated list of parameters to ignore when given -; in startup packet. +; in startup packet. Newer JDBC versions require the +; extra_float_digits here. ; ;ignore_startup_parameters = extra_float_digits @@ -138,7 +142,13 @@ log_pooler_errors = 1 ;; Should be used to survive network problems. (default: 0) ;client_idle_timeout = 0 -client_login_timeout = 0 +;; Disconnect clients who have not managed to log in after connecting +;; in this many seconds. +;client_login_timeout = 60 + +;; Clean automatically created database entries (via "*") if they +;; stay unused in this many seconds. +; autodb_idle_timeout = 3600 ;;; ;;; Low-level tuning options -- 2.40.0