dbt opening multiple connections to target database - how to restrict number of parallel connections #12071
Replies: 1 comment
|
Hi @josepaul1988! This is a known behavior — the threads setting only controls model execution parallelism, not the catalog/schema introspection connections. What's happening in your logs: 'master' connection: used for metadata operations (always created, 1 connection) Options to reduce total connections: Consolidate schemas — fewer distinct schema names in dbt_project.yml = fewer listing connections: dbt_project.yml — avoid many different schemasmodels: For BigQuery specifically — consider using list_relations_without_caching override via a macro if the adapter supports it. |
Uh oh!
There was an error while loading. Please reload this page.
Tested with different versions of dbt-bigquery as well as dbt-postgres adapters. It seems like even with threads=1 dbt is initating one master connection and another set of connections for each schema defined in the dbt_project.yaml. In our project we cannot use more two connections concurrently to target database. is there a way or configuration that we can use to ensure strictly the number of connections made to the target database. From logs we could see the connections are initiated like below
All reactions