diff --git a/config/runtime.exs b/config/runtime.exs index 9d560c4e..7dcdaa0e 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -322,7 +322,7 @@ if config_env() == :prod do config :towerops, Towerops.Repo, ssl: ssl_config, url: database_url, - pool_size: String.to_integer(System.get_env("POOL_SIZE") || "15"), + pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), # Proactively ping idle connections every 1s to detect dead SSL connections # before they're handed to a real query. Without this, a dead connection # sits in the pool until a query checks it out and hangs for the full timeout. diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index ff7f2339..b5b56f16 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -8,7 +8,7 @@ spec: strategy: type: RollingUpdate rollingUpdate: - maxSurge: 100% # Start all new pods at once for fast rollouts + maxSurge: 1 # Limit to 3 pods during rollout to avoid exceeding PG max_connections maxUnavailable: 0 # Keep all pods running during rollout minReadySeconds: 10 # Wait 10s after pod is ready before considering it available selector: