OData / OData/AspNetCoreOData

PageSize attribute causes significant drop in throughput

Open
#847 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 performance
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Assemblies affected

AspNetCoreOData 7.5.17; ODataLib 7.13.0, .NET Core 3.1

Describe the bug
A customer is experiencing a significant throughput in WebAPI when using PageSize. The throughput drops from 400k+ rps to just above 100k rps. They have tried to use both EnableQueryAttribute and custom attribute that extends EnableQueryAttribute.

Other details:

  • Tested with in-memory data
  • Tested with both PageSize=1000 and PageSize=100 so it does not seem to be related to the size of the page
  • SkipToken() was not enabled

Reproduce steps
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.

Data Model
Please share your Data model, for example, your C# class.

EDM (CSDL) Model
Please share your Edm model, for example, CSDL file.
You can send $metadata to get a CSDL XML content.

Request/Response

Sample request:

curl --request GET \
  --url http://localhost/TestApp/CoreBenchmarkFEService/xx-xx-xx/ODataPlainText \
  --header 'OData-MaxVersion: 4.0' \
  --header 'OData-Version: 4.0' \
  --header 'api-version: 2'

Response

{
              "@odata.context": http://localhost/TestApp/CoreBenchmarkFEService/81b3506f-08a7-4a52-81c5-eb780f82dfdd/$metadata#ODataPlainText,
              "value": [
                            {
                                          "Key": "bfe7f0a9-5e27-499b-8a12-9e88b284c860",
                                          "Description": "Hello, FSI Core from FE!"
                            }
              ]
}

Expected behavior
Use of PageSize should not cause a significant drop in throughput.

Actual behavior
PageSize causes 3x drop in throughput.

Screenshots

image

(first dip is when using PageSize=1000, second dip is when using PageSize=100)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EnableQueryAttribute and custom attribute path described in the issue, using the supplied curl request and the in-memory data setup. Compare throughput with PageSize=1000, PageSize=100, and without PageSize, while checking the stated .NET Core 3.1 and OData package versions. Done means identifying the cause of the roughly threefold throughput drop and demonstrating that PageSize no longer causes the reported regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.