<@U04S8PLJWMT>, does airbyte leave open connection...
# ask-ai
s
@kapa.ai, does airbyte leave open connections on database
k
Yes, Airbyte has been reported to leave open connections on databases, particularly its internal database (such as Postgres). Multiple users have observed that Airbyte opens a significant number of connections, which sometimes remain in an idle state and are not closed as expected. This can lead to exhausting the database's maximum allowed connections, causing operational issues. For example, users have reported that even without active syncs, Airbyte can open 40–60 connections to Postgres, and these connections may accumulate over time. Attempts to limit the number of open connections using settings like
SQL_MAX_IDLE_CONNS
have not always been effective. Some users have also tried using connection poolers like PgBouncer, but encountered compatibility issues due to Airbyte's use of prepared statements and other connection behaviors. In some cases, updating Airbyte to a newer version has resolved the issue, but it remains a concern for some deployments, especially at scale or when using external databases like AWS RDS or Cloud SQL for Airbyte's metadata storage [Airbyte opens too many connections in my external database](https://github.com/airbytehq/airbyte/discussions/48342) [Airbyte Internal Database connections are not closed](https://discuss.airbyte.io/t/1953) [Scaling Airbyte Instances with PGBouncer - Connection Issues](https://github.com/airbytehq/airbyte/issues/44447). If you are experiencing this issue, consider: - Updating Airbyte to the latest version, as some connection management bugs have been fixed in recent releases. - Monitoring and tuning your database's connection limits. - Reviewing Airbyte's configuration for connection pooling and idle connection settings, though their effectiveness may vary. - If using connection poolers like PgBouncer, be aware of potential compatibility issues with Airbyte and Temporal. If the problem persists, you may need to restart Airbyte or the database as a temporary workaround, and follow ongoing discussions and issues for updates from the Airbyte team.
s
@kapa.ai are these active or idle connections
k
A message from kapa.ai
Based on the available knowledge sources, the connections that Airbyte leaves open on the database are primarily in an idle state, not active. For example, one user observed that almost all of the connections opened by Airbyte remained in an "idle" state and were not closed, which led to exhausting the database server’s resources. This was confirmed by checking the output of
pg_stat_activity
, which showed many idle connections for each Airbyte instance. Attempts to limit these idle connections using settings like
SQL_MAX_IDLE_CONNS
did not always resolve the issue, and the problem persisted even when using connection poolers like PgBouncer in transaction mode, due to compatibility issues with prepared statements [Scaling Airbyte Instances with PGBouncer - Connection Issues](https://github.com/airbytehq/airbyte/issues/44447). So, to directly answer your question: the open connections are mostly idle, not active.