-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: add pqsql configs for open and idle connections #1583
Conversation
6bca167
to
9274087
Compare
447eb2f
to
551c460
Compare
Sorry for the delay, this should be up and running |
551c460
to
91bb85e
Compare
@kradalby Thank you. I've updated the PR. I may have also run |
When Postgres is used as the backing database for headscale, it does not set a limit on maximum open and idle connections which leads to hundreds of open connections to the Postgres server. This commit introduces the configuration variables to set those values and also sets default while opening a new postgres connection.
f39ab09
to
c052d6c
Compare
@pallabpain does that mean headscale is now usable with postgres? |
@SuperSandro2000 It was already usable with Postgres. It now makes use of connection pooling as well. |
I constantly ran into #1584 which rendered headscale completely broken for me. It's that issue now fixed and can be closed? |
Yes, that should be resolved with this fix. In order to mitigate the issue with a previous stable version of headscale, you can consider running PGBouncer. |
Description
When Postgres is used as the backing database for headscale, it does not set a limit on maximum open and idle connections which leads to hundreds of open connections to the Postgres server. This commit fixes that by setting up a connection pool while creating the gorm DB instance.
Depends