Skip to content

Commit

Permalink
added max conn configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Shankar <vshankar@progress.com>
  • Loading branch information
vivekshankar1 committed Sep 13, 2024
1 parent d61d635 commit 0a4fb20
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 88 deletions.
1 change: 1 addition & 0 deletions api/config/pg_gateway/config_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func DefaultConfigRequest() *ConfigRequest {
c.V1.Sys.Timeouts.Connect = w.Int32(5)
c.V1.Sys.Timeouts.Idle = w.Int32(43200)
c.V1.Sys.Resolvers.EnableSystemNameservers = w.Bool(false)
c.V1.Sys.MaxConnections = w.Int32(350)

return c
}
Expand Down
179 changes: 96 additions & 83 deletions api/config/pg_gateway/config_request.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/config/pg_gateway/config_request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ message ConfigRequest {
chef.automate.infra.config.Log log = 4;
Timeouts timeouts = 5;
Resolvers resolvers = 6;
google.protobuf.Int32Value max_connections = 7;

message Resolvers {
repeated google.protobuf.StringValue nameservers = 1;
Expand Down
9 changes: 7 additions & 2 deletions components/automate-backend-postgresql/habitat/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ host = '0.0.0.0'

print_db_statistics = true

max_connections = 350
max_connections = 1500
max_locks_per_transaction = 64
max_wal_size = "1GB"
min_wal_size = "80MB"
Expand Down Expand Up @@ -40,4 +40,9 @@ path = "/hab/svc/automate-ha-postgresql/data/pg_dump"
[ssl]
enable = true
# tls 1.2 ciphersuite (to exclude tlsv1 and tlsv1.1)
tls_ciphers = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256"
tls_ciphers = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256"# server public cert used for ssl listener
ssl_cert = """"""
# server private key
ssl_key = """"""
# issuer public cert that signed the above server public cert
issuer_cert = """"""
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
dc "github.com/chef/automate/api/config/deployment"
api "github.com/chef/automate/api/interservice/deployment"
"github.com/chef/automate/components/automate-deployment/pkg/certauthority"
globalconfig "github.com/chef/automate/components/automate-deployment/pkg/globalConfig"
"github.com/chef/automate/components/automate-deployment/pkg/globalconfig"
"github.com/chef/automate/components/automate-deployment/pkg/habpkg"
"github.com/chef/automate/components/automate-deployment/pkg/manifest"
"github.com/chef/automate/components/automate-deployment/pkg/services"
Expand Down
4 changes: 2 additions & 2 deletions components/automate-pg-gateway/habitat/config/haproxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ backend automate_postgresql
{{~#if ../cfg.resolvers.nameservers }}
server-template {{node.address}} 8 {{node.address}}:{{node.port}} check resolvers pgdns init-addr none resolve-prefer ipv4
{{else}}
server {{node.address}} {{node.address}}:{{node.port}} maxconn 350 check port 6432
server {{node.address}} {{node.address}}:{{node.port}} maxconn {{cfg.max_connections}} check port 6432
{{~/if}}
{{else}}
server {{node.address}} {{node.address}}:{{node.port}} maxconn 350 check port 6432
server {{node.address}} {{node.address}}:{{node.port}} maxconn {{cfg.max_connections}} check port 6432
{{~/if}}
{{~/each}}
{{else~}}
Expand Down

0 comments on commit 0a4fb20

Please sign in to comment.