question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance issue with response time when upgrading from 3.31.0 to 3.31.2

See original GitHub issue

Describe the bug Increased response time since updating from 3.31.0 to 3.31.2. This impacted around 5% of http requests.

To Reproduce When we updated from Microsoft.Azure.Cosmos 3.31.0 to 3.31.2 we noticed an increase in response time for our http requests. We use a single cosmos client in our services.

The code that talks to cosmos is a cross partition query, see below:

public async Task<IEnumerable<T>> GetAll(Expression<Func<T, bool>> predicate)
{
    var iterator = container.GetItemLinqQueryable<T>()
        .Where(entity => entity.Kind == DocumentKind)
        .Where(predicate)
        .ToFeedIterator();

    var entities = new List<T>();

    while (iterator.HasMoreResults)
    {
        var page = await iterator.ReadNextAsync();
        entities.AddRange(page);
    }

    return entities;
}

The function is used as follows:

GetAll(item => item.Key == value)

The container has roughly 5 million items and is partioned.

Expected behavior We expect the upgrade to not impact performance.

Actual behavior An increase in response time for http requests.

github_graph

The graph shows the response time in milliseconds for one of our endpoints, for the 99th percentile. In the 50th percentile there is no noticeable difference. The peaks are with the sdk version 3.31.2 and when we downgraded to 3.31.0 the response time returned to its usual duration. The second peak is when we upgraded to 3.31.2 again to see if that was the issue. This has been verified in both .NET 6 and .NET 7. The only change between the peaks is upgrading/downgrading Microsoft.Azure.Cosmos.

Environment summary SDK Version: .NET 7.0.1 and .NET 6.0.12 OS Version debian.11-x64

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
op-rasmuslcommented, Mar 14, 2023

We have been working on this issue for a while and have a few observations:

  1. We have reviewed our code and have not found any suspicious async code
  2. We have changed networking and are now using Private Endpoints between the App Service and Cosmos

We have tried to update to 3.31.1 and above, however the 99 problem still occurs. What did solve it was updating from the P1V2 app service plan to the P1V3 app service plan which allowed us to update the sdk without any performance issues. The main difference seems to be that we now have two cores on each instance. We are not sure why this matters since we rarely had a high cpu percentage and did not to have threading issues.

0reactions
ealsurcommented, Feb 9, 2023

Cleaning up issues with needs-investigation that are dormant/not-actionable

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
NET SDK includes updated features and improved performance, The 2.x of this SDK will ... this (or a similar) issue when doing an...
Read more >
CleanSpeak Release Notes
1. Released Friday February 18th, 2022. Security. Proactively upgrade Logback. Instead of Log4J, CleanSpeak uses Logback. In response ...
Read more >
Changelog
There is an issue with creating and updating existing Bitbucket.org (Cloud) code host connections due to problem with JSON schema validation which prevents...
Read more >
Comet Python SDK releases
Release 3.31.2¶. Release date: May 31, 2022. Fixed linting problem caused by wrong type-hint comments. Renamed potentially conflicting callback functions ...
Read more >
Release History
Fix a long-standing problem in FTS3 that can only arise when compiled with the SQLITE_ENABLE_FTS3_PARENTHESIS compile-time option.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found