diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index 6c61bfac8..7e3b607c0 100644 --- a/charts/postgres-operator/crds/operatorconfigurations.yaml +++ b/charts/postgres-operator/crds/operatorconfigurations.yaml @@ -350,7 +350,7 @@ spec: connection_pool_default_cpu_request: type: string pattern: '^(\d+m|\d+(\.\d{1,3})?)$' - #default: "1" + #default: "500m" connection_pool_default_memory_limit: type: string pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' diff --git a/charts/postgres-operator/values-crd.yaml b/charts/postgres-operator/values-crd.yaml index 5c7e47525..7fd1b5098 100644 --- a/charts/postgres-operator/values-crd.yaml +++ b/charts/postgres-operator/values-crd.yaml @@ -283,7 +283,7 @@ configConnectionPool: # number of pooler instances connection_pool_number_of_instances: 2 # default resources - connection_pool_default_cpu_request: "1" + connection_pool_default_cpu_request: 500m connection_pool_default_memory_request: 100Mi connection_pool_default_cpu_limit: "1" connection_pool_default_memory_limit: 100Mi diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index 5194d02ba..2a1a53fca 100644 --- a/charts/postgres-operator/values.yaml +++ b/charts/postgres-operator/values.yaml @@ -260,7 +260,7 @@ configConnectionPool: # number of pooler instances connection_pool_number_of_instances: 2 # default resources - connection_pool_default_cpu_request: "1" + connection_pool_default_cpu_request: 500m connection_pool_default_memory_request: 100Mi connection_pool_default_cpu_limit: "1" connection_pool_default_memory_limit: 100Mi diff --git a/docs/reference/cluster_manifest.md b/docs/reference/cluster_manifest.md index 704a29e99..d1fb212ee 100644 --- a/docs/reference/cluster_manifest.md +++ b/docs/reference/cluster_manifest.md @@ -385,8 +385,8 @@ present. Which docker image to use for connection pool deployment. * **maxDBConnections** - How many connections the pooler can max hold. This value is divided by the - number of pooler pods. + How many connections the pooler can max hold. This value is divided among the + pooler pods. * **mode** In which mode to run connection pool, transaction or session. diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 030ec4f1e..53cd617c4 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -619,9 +619,9 @@ operator being able to provide some reasonable defaults. Default: "registry.opensource.zalan.do/acid/pgbouncer" * **connection_pool_max_db_connections** - How many connections the pooler can max hold. This value is divided by the - number of pooler pods. Default is 60 which will make up 30 connections per - pod for the default setup with two instances. + How many connections the pooler can max hold. This value is divided among the + pooler pods. Default is 60 which will make up 30 connections per pod for the + default setup with two instances. * **connection_pool_mode** Default pool mode, `session` or `transaction`. Default is `transaction`. @@ -631,4 +631,4 @@ operator being able to provide some reasonable defaults. **connection_pool_default_cpu_limit** **connection_pool_default_memory_limit** Default resource configuration for connection pool deployment. The internal - default for memory limit and request is `100Mi`, for CPU it is `1`. + default for memory request and limit is `100Mi`, for CPU it is `500m` and `1`. diff --git a/docs/user.md b/docs/user.md index b82b55183..acfcb7b54 100644 --- a/docs/user.md +++ b/docs/user.md @@ -535,7 +535,7 @@ To configure a new connection pool, specify: spec: connectionPool: # how many instances of connection pool to create - number_of_instances: 1 + number_of_instances: 2 # in which mode to run, session or transaction mode: "transaction" @@ -550,11 +550,11 @@ spec: # resources for each instance resources: requests: - cpu: "100m" - memory: "100Mi" + cpu: 500m + memory: 100Mi limits: - cpu: "100m" - memory: "100Mi" + cpu: "1" + memory: 100Mi ``` By default `pgbouncer` is used to create a connection pool. To find out about diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 6b645dbe6..fdc2d5d56 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -12,7 +12,7 @@ data: cluster_labels: application:spilo cluster_name_label: cluster-name # connection_pool_default_cpu_limit: "1" - # connection_pool_default_cpu_request: "1" + # connection_pool_default_cpu_request: "500m" # connection_pool_default_memory_limit: 100Mi # connection_pool_default_memory_request: 100Mi connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-5" diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index 2b3c2bf09..4e6858af8 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -326,7 +326,7 @@ spec: connection_pool_default_cpu_request: type: string pattern: '^(\d+m|\d+(\.\d{1,3})?)$' - #default: "1" + #default: "500m" connection_pool_default_memory_limit: type: string pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index 065b50c27..d4c9b518f 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -123,7 +123,7 @@ configuration: # scalyr_server_url: "" connection_pool: connection_pool_default_cpu_limit: "1" - connection_pool_default_cpu_request: "1" + connection_pool_default_cpu_request: "500m" connection_pool_default_memory_limit: 100Mi connection_pool_default_memory_request: 100Mi connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-5" diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 73a0d9655..e0e095617 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -92,7 +92,7 @@ type ConnectionPool struct { Image string `name:"connection_pool_image" default:"registry.opensource.zalan.do/acid/pgbouncer"` Mode string `name:"connection_pool_mode" default:"transaction"` MaxDBConnections *int32 `name:"connection_pool_max_db_connections" default:"60"` - ConnPoolDefaultCPURequest string `name:"connection_pool_default_cpu_request" default:"1"` + ConnPoolDefaultCPURequest string `name:"connection_pool_default_cpu_request" default:"500m"` ConnPoolDefaultMemoryRequest string `name:"connection_pool_default_memory_request" default:"100Mi"` ConnPoolDefaultCPULimit string `name:"connection_pool_default_cpu_limit" default:"1"` ConnPoolDefaultMemoryLimit string `name:"connection_pool_default_memory_limit" default:"100Mi"` diff --git a/pkg/util/constants/pooler.go b/pkg/util/constants/pooler.go index affdbc584..540d64e2c 100644 --- a/pkg/util/constants/pooler.go +++ b/pkg/util/constants/pooler.go @@ -6,7 +6,7 @@ const ( ConnectionPoolSchemaName = "pooler" ConnectionPoolDefaultType = "pgbouncer" ConnectionPoolDefaultMode = "transaction" - ConnectionPoolDefaultCpuRequest = "1" + ConnectionPoolDefaultCpuRequest = "500m" ConnectionPoolDefaultCpuLimit = "1" ConnectionPoolDefaultMemoryRequest = "100Mi" ConnectionPoolDefaultMemoryLimit = "100Mi"