Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Each DB call opens a new connection #102

Open
Koochr opened this issue Mar 8, 2022 · 0 comments
Open

Each DB call opens a new connection #102

Koochr opened this issue Mar 8, 2022 · 0 comments

Comments

@Koochr
Copy link

Koochr commented Mar 8, 2022

I'm starting the app in a docker, connected to the local arweave-node, it starts populating db, and I get repeating errors:
postgres FATAL: sorry, too many clients already
The reason is that await connection.queryBuilder() creates a new connection, and this situation becomes worse bc of pool with minimum 10 connections:
https://github.com/ArweaveTeam/gateway/blob/master/src/database/connection.database.ts#L9
Removing this line and raising db connections limit does trick for me, but this is a half-measure. The proper way is to create a single connection and reuse it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant