Skip to content

New connection manager performance issues #543

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

Open
adam-fowler opened this issue Mar 24, 2025 · 1 comment
Open

New connection manager performance issues #543

adam-fowler opened this issue Mar 24, 2025 · 1 comment
Labels
bug Something isn't working ConnectionPool Features and bugs that are related to the impl in ConnectionPoolModule

Comments

@adam-fowler
Copy link

Describe the issue

The new connection manager that PostgresClient uses has performance issues with lock contention

Vapor version

Not using

Operating system and version

MacOS 15.3.2 (24D81)

Swift version

Apple Swift version 6.0.3

Steps to reproduce

If PostgresClient is setup with a sizeable number of connections then it will lock the state of the connection manager for long periods as ConnectionGroup searches through the list of connections repeatedly using code like this

let index = self.connections.firstIndex(where: { $0.id == connection.id })
```

### Outcome

Its slow!!

### Additional notes

_No response_
@adam-fowler adam-fowler added the bug Something isn't working label Mar 24, 2025
@fabianfett
Copy link
Collaborator

@adam-fowler Can you maybe checkout the branch in #551 and provide some feedback?

Thank you!

@fabianfett fabianfett added the ConnectionPool Features and bugs that are related to the impl in ConnectionPoolModule label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ConnectionPool Features and bugs that are related to the impl in ConnectionPoolModule
Projects
None yet
Development

No branches or pull requests

2 participants