Skip to content

Performance decrease (10 second delay) in database migration 8.0.0 vs 8.0.3  #33399

Closed

Description

@EvgenyMuryshkin

Hi,

After upgrading from 8.0.0 to 8.0.3, get a large performance decrease during database creation.

https://github.com/EvgenyMuryshkin/EF8PPerf

image

EF 9 also has the same issue

image

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

Activity

  1. roji commented on Mar 26, 2024

    @roji
    Member

    @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?

  2. EvgenyMuryshkin commented on Mar 26, 2024

    @EvgenyMuryshkin
    Author

    @roji nope, did not work.
    I think my issue is not model creation, but database creation.
    Model is already created

    image

    image

  3. roji commented on Mar 26, 2024

    @roji
    Member

    This doesn't repro for me (MacOS Sonoma):

    image

    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.

  4. EvgenyMuryshkin commented on Mar 26, 2024

    @EvgenyMuryshkin
    Author

    @roji EF 8.0.1 fast, 8.0.2 slow.

    with 8.0.0
    5.1.1 - fast
    5.1.2 - slow

  5. roji commented on Mar 26, 2024

    @roji
    Member

    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.

    /cc @David-Engel @cheenamalhotra

  6. cheenamalhotra commented on Mar 27, 2024

    @cheenamalhotra
    Member

    Have you tried setting ConnectRetryCount=0 on the connection string to disable transient fault handling?

  7. ajcvickers commented on Mar 27, 2024

    @ajcvickers
    Contributor

    @cheenamalhotra This should not be needed. Issue #7283 goes into this in detail.

  8. ajcvickers commented on Mar 27, 2024

    @ajcvickers
    Contributor
  9. roji commented on Mar 27, 2024

    @roji
    Member

    @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).

  10. EvgenyMuryshkin commented on Mar 27, 2024

    @EvgenyMuryshkin
    Author

    Have you tried setting ConnectRetryCount=0 on the connection string to disable transient fault handling?

    it actually worked, thanks :)
    for 8.0.3 and 9.0.0 as well

    image

  11. 42 remaining items

  12. added this to the 9.0.0 milestone on Aug 14, 2024
  13. removed this from the 9.0.0 milestone on Aug 27, 2024
  14. ajcvickers commented on Aug 29, 2024

    @ajcvickers
    Contributor

    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.

  15. removed their assignment
    on Aug 31, 2024
  16. AndriySvyryd commented on Oct 8, 2024

    @AndriySvyryd
    Member

    Fixed in 576f0d0

  17. added this to the 8.0.11 milestone on Oct 8, 2024
  18. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions