From be694be1bd6782ab4fac7fc8f8fb25c56c05531e Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Fri, 31 Jul 2015 15:11:55 +0300 Subject: [PATCH] Change application_name_add_host default to 'off' It can have effect on performance, so it seems it should not be on by default, especially as it applies to all connections, not only those that do use application_name from client. --- NEWS | 2 +- doc/config.txt | 8 ++++---- etc/pgbouncer.ini | 2 +- src/main.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index df3d230..da99285 100644 --- a/NEWS +++ b/NEWS @@ -42,7 +42,7 @@ * Add the client host IP address and port to application_name. This is enabled by a config parameter application_name_add_host - which defaults to 'on'. + which defaults to 'off'. (Andrew Dunstan) * Config files have '%include FILENAME' directive to allow configuration diff --git a/doc/config.txt b/doc/config.txt index f824032..4da8200 100644 --- a/doc/config.txt +++ b/doc/config.txt @@ -239,11 +239,11 @@ Default: 0 ==== application_name_add_host ==== Add the client host address and port to the application name setting set on connection start. -This helps in identifying the source of bad queries etc. The setting will be overwritten -without any detection if the application does SET APPLICATION_NAME after connecting. -Note that this is on by default. +This helps in identifying the source of bad queries etc. This logic applies +only on start of connection, if application_name is later changed with SET, +pgbouncer does not change it again. -Default: 1 +Default: 0 ==== conffile ==== diff --git a/etc/pgbouncer.ini b/etc/pgbouncer.ini index 4a84094..4d144a9 100644 --- a/etc/pgbouncer.ini +++ b/etc/pgbouncer.ini @@ -111,7 +111,7 @@ server_reset_query = DISCARD ALL ;server_check_delay = 30 ;; Use as application_name on server. -;application_name_add_host = 1 +;application_name_add_host = 0 ;;; ;;; Connection limits diff --git a/src/main.c b/src/main.c index 8667014..f194eb1 100644 --- a/src/main.c +++ b/src/main.c @@ -234,7 +234,7 @@ CF_ABS("stats_period", CF_INT, cf_stats_period, 0, "60"), CF_ABS("log_connections", CF_INT, cf_log_connections, 0, "1"), CF_ABS("log_disconnections", CF_INT, cf_log_disconnections, 0, "1"), CF_ABS("log_pooler_errors", CF_INT, cf_log_pooler_errors, 0, "1"), -CF_ABS("application_name_add_host", CF_INT, cf_application_name_add_host, 0, "1"), +CF_ABS("application_name_add_host", CF_INT, cf_application_name_add_host, 0, "0"), {NULL} }; -- 2.39.5