-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Slow connecting to database #2325
Comments
Adding more info, I did tests on version 5.7 of SQLx back when I was sure this used to work fine, but it still has the slow behavior. Since the same thing happens on my laptop it must be the database somehow. My next step will be trying to get logging out of SQLx or using a tracer to find what it's doing while blocked. |
We're seeing this too on postgres, with connections taking around 200ms to be established. |
Nice, we'll test and report back; hopefully this week. |
This issue is still open and meanwhile sqlx 0.8 arrived. Do you mind to report back @sj-robert @mu-arch ? |
We're in the middle of vacation periods here, and I'm leaving the office for two weeks on friday, but if I can find the time before then I'll run a test :) |
Bug Description
A issue I've experienced lately is that SQLx takes exactly 4.6 seconds to establish connections to my database in debug mode and 500ms on release mode. On my laptop it can take over 10 seconds in debug mode. It's getting blocked doing some type of heavy compute to establish the connection, a single thread is pinned at 100% during this time.
I have used other tools to connect to my database and they do it instantly. In the past SQLx did not exhibit this behavior. I am not sure when it started, or if it is due to some mis-configuration on my end. I have not tried SQLx with other databases than the one I normally use, but I have setup MVP test programs that all exhibit the same behavior.
Minimal Reproduction
Info
rustc --version
: rustc 1.66.1The text was updated successfully, but these errors were encountered: