-
Notifications
You must be signed in to change notification settings - Fork 47
Add pooler personality configuration on pgbouncer.ini template #29
base: master
Are you sure you want to change the base?
Changes from 1 commit
b84fe1f
5617e35
92977f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,13 +62,13 @@ stats_users = {{ $users }}, stats, root, monitor | |
|
||
;;; Pooler personality | ||
|
||
pool_mode = {{ .Values.poolMode }} | ||
server_reset_query = DISCARD ALL | ||
;server_reset_query_always = 0 | ||
;ignore_startup_parameters = extra_float_digits | ||
;server_check_query = select 1 | ||
;server_check_delay = 30 | ||
;application_name_add_host = 0 | ||
pool_mode = {{ .Values.poolerPersonality.poolMode | default "session" }} | ||
server_reset_query = {{ .Values.poolerPersonality.serverResetQuery | default "DISCARD ALL" }} | ||
server_reset_query_always = {{ .Values.poolerPersonality.serverResetQueryAlways | default 0 }} | ||
ignore_startup_parameters = {{ .Values.poolerPersonality.ignoreStartupParameters | default "" }} | ||
matth-boise marked this conversation as resolved.
Show resolved
Hide resolved
|
||
server_check_query = {{ .Values.poolerPersonality.serverCheckQuery | default "SELECT 1;" }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the default in pgbouncer_1_8_1 is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, I will update it. I was following pgbouncer's config page |
||
server_check_delay = {{ .Values.poolerPersonality.serverCheckDelay | default 30 }} | ||
application_name_add_host = {{ .Values.poolerPersonality.applicationNameAddHost | default 0 }} | ||
|
||
;;; Connection limits | ||
|
||
|
@@ -77,8 +77,8 @@ default_pool_size = {{ .Values.connectionLimits.defaultPoolSize }} | |
min_pool_size = {{ .Values.connectionLimits.minPoolSize }} | ||
reserve_pool_size = {{ .Values.connectionLimits.reservePoolSize }} | ||
reserve_pool_timeout = {{ .Values.connectionLimits.reservePoolTimeout }} | ||
;max_db_connections = 0 | ||
;max_user_connections = 0 | ||
max_db_connections = {{ .Values.connectionLimits.maxDbConnections | default 0 }} | ||
max_user_connections = {{ .Values.connectionLimits.maxUserConnections | default 0 }} | ||
;server_round_robin = 0 | ||
;syslog = 0 | ||
;syslog_facility = daemon | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,14 @@ nodeAffinity: {} # optionally define nodeAffinity | |
tolerations: [] # optionally define tolerations | ||
nodeSelector: {} # optionally define nodeSelector | ||
|
||
poolMode: session | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you leave the poolMode=session line - but comment it out and add comment? e.g., There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice idea will do it like that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @angeloskyratzakos it's been a while - sorry! it would be great to get your changes in. could you make this last change - to re-add the poolMode line but commented out? |
||
poolerPersonality: | ||
poolMode: session | ||
# serverResetQuery: "DISCARD ALL" | ||
# serverResetQueryAlways: 0 | ||
# ignoreStartupParameters: "" | ||
# serverCheckQuery: "SELECT 1;" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the default in pgbouncer_1_8_1 is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. I was following the pgbouncer's config |
||
# serverCheckDelay: 30 | ||
# applicationNameAddHost: 0 | ||
|
||
budget: | ||
# PodDisruptionBudget spec.minAvailable | ||
|
@@ -51,14 +58,16 @@ settings: | |
# WHERE usename = p_usename; | ||
# END; | ||
# $$ LANGUAGE plpgsql SECURITY DEFINER; | ||
auth_query: SELECT * FROM pgbouncer.get_auth($1) | ||
auth_query: SELECT * FROM pgbouncer.get_auth($1) | ||
|
||
connectionLimits: | ||
maxClientConn: 200 | ||
defaultPoolSize: 200 | ||
minPoolSize: 15 | ||
reservePoolSize: 25 | ||
reservePoolTimeout: 5 | ||
# maxDbConnections: 0 # zero means unlimited | ||
matth-boise marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# maxUserConnections: 0 # zero means unlimited | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above (since you didn't add templating for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added for it as well please check line 81 |
||
|
||
spec: | ||
labels: {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in order to preserve backwards compatibility for chart users that may be doing custom overrides (through a
-f overrides.yaml
file or by pulling in pgbouncer as a requirements chart), i recommend changing this to use.Values.poolMode
if it is in the dictionary. could you change this line toThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick! I didn't know that one. Thanks for the suggestion!