PageSize attribute causes significant drop in throughput
Nobody has claimed this yet.
- 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=1000andPageSize=100so 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

(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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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