tfagan25 opened a new issue, #58510: URL: https://github.com/apache/airflow/issues/58510
### Apache Airflow version Other Airflow 2/3 version (please specify below) ### If "Other Airflow 2/3 version" selected, which one? 3.0.2 ### What happened? Noticed that the API server is opening excessive connections to PGBouncer, which is then opening excessive connections to Postgres. The number of connections is growing quite quickly over time, reaching the limits and causing failures. ## Evidence of Connections Growth This shows a 7 day period of Services -> PGBouncer connections. The large drops are caused by restarts of the API server. <img width="2284" height="1155" alt="Image" src="https://github.com/user-attachments/assets/87c75827-f210-40e3-a879-5bf344f69cbf" /> When port forwarding the PGBouncer pod to my local, connecting with psql, and doing SHOW clients - I can the IP addresses connecting to PGBouncer and the ones that are growing over time are the API server as I have seen. This is consistent across many of my environments in differnet k8s clusters. ### What you think should happen instead? The # of connections should stay generally consistent when the load remains consistent. ### How to reproduce Deploy the Airflow helm chart v1.18.0 with Airflow v3.0.2 with PGBouncer and Postgres (with PVC in cluster). ### Operating System Ubuntu 22.04.2 LTS ### Versions of Apache Airflow Providers apache-airflow-providers-amazon==9.8.0 apache-airflow-providers-celery==3.11.0 apache-airflow-providers-cncf-kubernetes==10.5.0 apache-airflow-providers-common-compat==1.7.0 apache-airflow-providers-common-io==1.6.0 apache-airflow-providers-common-messaging==1.0.3 apache-airflow-providers-common-sql==1.27.1 apache-airflow-providers-docker==4.4.0 apache-airflow-providers-elasticsearch==6.3.0 apache-airflow-providers-fab==2.2.1 apache-airflow-providers-ftp==3.13.0 apache-airflow-providers-git==0.0.2 apache-airflow-providers-google==15.1.0 apache-airflow-providers-grpc==3.8.0 apache-airflow-providers-hashicorp==4.2.0 apache-airflow-providers-http==5.3.0 apache-airflow-providers-microsoft-azure==12.4.0 apache-airflow-providers-mysql==6.3.0 apache-airflow-providers-odbc==4.10.0 apache-airflow-providers-openlineage==2.3.0 apache-airflow-providers-opsgenie==5.9.2 apache-airflow-providers-postgres==6.2.0 apache-airflow-providers-redis==4.1.0 apache-airflow-providers-sendgrid==4.1.0 apache-airflow-providers-sftp==5.3.0 apache-airflow-providers-slack==9.1.0 apache-airflow-providers-smtp==2.1.0 apache-airflow-providers-snowflake==6.3.1 apache-airflow-providers-ssh==4.1.0 apache-airflow-providers-standard==1.2.0 ### Deployment Official Apache Airflow Helm Chart ### Deployment details Base helm chart with the following values added `airflow: apiServer: replicas: 2 resources: limits: cpu: "4000m" memory: "4Gi" requests: cpu: "200m" memory: "1Gi" config: api: workers: 2 celery: worker_concurrency: 1 core: default_task_weight_rule: "downstream" max_active_runs_per_dag: 1 database: sql_alchemy_pool_size: 30 sql_alchemy_max_overflow: 20 server_lifetime: 300 server_idle_timeout: 60 postgresql: image: repository: bitnami/postgresql tag: 16.1.0-debian-11-r15 primary: persistence: storageClass: "px-csi-replicated" size: 250Gi resources: limits: cpu: "4000m" memory: "4Gi" requests: cpu: "200m" memory: "1Gi" pgbouncer: enabled: true metadataPoolSize: 100 resultBackendPoolSize: 10 maxClientConn: 250 metricsExporterSidecar: resources: limits: cpu: "1000m" memory: "1Gi" requests: cpu: "50m" memory: "128Mi" resources: limits: cpu: "1000m" memory: "1Gi" requests: cpu: "200m" memory: "256Mi" scheduler: replicas: 2 logGroomerSidecar: resources: limits: cpu: "1000m" memory: "1Gi" requests: cpu: "50m" memory: "128Mi" resources: limits: cpu: "2000m" memory: "3Gi" requests: cpu: "200m" memory: "512Mi" triggerer: persistence: enabled: false logGroomerSidecar: resources: limits: cpu: "1000m" memory: "1Gi" requests: cpu: "50m" memory: "128Mi" resources: limits: cpu: "2000m" memory: "3Gi" requests: cpu: "200m" memory: "512Mi" workers: persistence: storageClassName: "px-csi-replicated" size: "20Gi" logGroomerSidecar: resources: limits: cpu: "1000m" memory: "1Gi" requests: cpu: "50m" memory: "128Mi" replicas: 4 resources: limits: cpu: "3000m" memory: "6Gi" requests: cpu: "1500m" memory: "1Gi" webserver: replicas: 2 defaultUser: enabled: true` ### Anything else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
