-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Performance decrease (10 second delay) in database migration 8.0.0 vs 8.0.3 #33399
Comments
@EvgenyMuryshkin looks like a duplicate of #33176, which has already been fixed for 8.0.4. Can you please try the workaround in this comment and confirm? |
@roji nope, did not work. |
This doesn't repro for me (MacOS Sonoma): I'm noticing that EF upgraded patch versions of SqlClient between 8.0.0 (SqlClient 5.1.1) and 8.0.3 (SqlClient 5.1.5). Can you try to take a dependency on SqlClient 5.1.1 when using EF Core 8.0.0 to see if the problem comes form there? I'm thinking possibly of #7283 or similar. |
@roji EF 8.0.1 fast, 8.0.2 slow. with 8.0.0 |
Thanks for confirming! The 5.1.2 release notes are here, the culprit may be dotnet/SqlClient#1983. This may very well be a dup of #7283. |
Have you tried setting ConnectRetryCount=0 on the connection string to disable transient fault handling? |
@cheenamalhotra This should not be needed. Issue #7283 goes into this in detail. |
/cc @SamMonoRT |
@cheenamalhotra in addition to #7283, see dotnet/SqlClient#29 and dotnet/SqlClient#463 on the SqlClient side where this was discussed at length (especially why the connection string-based approach is insufficient here). |
it actually worked, thanks :) |
Interestingly, this test is not failing: https://github.com/dotnet/SqlClient/blob/main/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/ConnectivityTest.cs#L364 |
The problem with setting ConnectRetryCount=0 in your actual connection string is that is disables connection retrying everywhere, not just in the database existence check. |
Thanks for the context, I think we should also make sure FailFast is supported for
Yes, that is true. For @roji and @ajcvickers |
Note that it's only testing |
But does OpenAsync support the new overload? |
Ah, I found: dotnet/SqlClient#615 |
Confirmed the regression is for async only. |
Verified this is fixed with SqlClient 5.2.1. |
@ajcvickers which version of EF will get this fix? 8.0.7? |
@EvgenyMuryshkin You can just add an explicit PackageReference to 5.2.1 |
@ErikEJ I tried but I got lots of failed tests due to transient connection failures, will try to create repro soon |
Re-opening to consider updating the 8.0 dependency, which is currently at 5.1.5. |
@ajcvickers isn't SqlClient planning to revert their change in the 5.1 branch? I haven't been following closely... |
@roji Not sure. Will try to pull together the relevant info for the team to discuss. |
@ajcvickers @roji This will be fixed in 5.1.6 https://github.com/dotnet/SqlClient/projects/20 |
@ErikEJ looks like my transient connectivity errors were something random and gone after PC restart (Windows update forced me to do that). |
Our unit test performance for some apps degraded like crazy after updating from .NET 6 to .NET 8. After trying many things for hours I finally found this issue and the connection string workaround... Build and test duration jumped from 5 to 20minutes on average for some CI builds (which runs integration tests and create a lot of databases) This problem still exists today when using EF Core 8.0.6. Changing the connection string to include |
Note: this is now fixed for 9.0 RC2 with an LTS SqlClient by changing to SqlClient 5.1.6. We plan to also patch 8.0 for this, but we're going to let 5.1.6 have a bit of time in the wild first. |
Fixed in 576f0d0 |
Hi,
After upgrading from 8.0.0 to 8.0.3, get a large performance decrease during database creation.
https://github.com/EvgenyMuryshkin/EF8PPerf
EF 9 also has the same issue
Include provider and version information
.NET 8/.NET 9
EF 8.0.0 => 8.0.3, 9.0.0-preview.2.24128.4
Windows 11 Pro
VS 2022 17.9.4/17.10.0 Preview 2.0
Thank you
The text was updated successfully, but these errors were encountered: