Skip to content
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

Use separate DB connection pools for read/update in platform update benchmark #1764

Closed
wants to merge 1 commit into from

Conversation

roji
Copy link
Member

@roji roji commented Oct 30, 2022

This uses separate connection pools (data sources) for the queries and the updates in the platform updates benchmark, as suggested by @NinoFloris. Improvement isn't as significant as we hoped (and saw earlier): 3.64%. But given the variability/unreliability of the updates benchmark, we may see a better trend on the graph after a bit of time. Note that I ran this for 60 seconds instead of the default 15.

db updates_baseline updates_change
CPU Usage (%) 66 95 +43.94%
Cores usage (%) 1,849 2,657 +43.70%
Working Set (MB) 58 89 +53.45%
Build Time (ms) 1,381 1,371 -0.72%
Start Time (ms) 361 356 -1.39%
Published Size (KB) 930,199 930,199 0.00%
application updates_baseline updates_change
CPU Usage (%) 60 69 +15.00%
Cores usage (%) 1,668 1,921 +15.17%
Working Set (MB) 624 653 +4.65%
Private Memory (MB) 1,268 1,308 +3.15%
Build Time (ms) 3,135 3,176 +1.31%
Start Time (ms) 1,828 1,922 +5.14%
Published Size (KB) 101,724 101,725 +0.00%
.NET Core SDK Version 8.0.100-alpha.1.22528.3 8.0.100-alpha.1.22528.3
load updates_baseline updates_change
CPU Usage (%) 4 4 0.00%
Cores usage (%) 107 111 +3.74%
Working Set (MB) 38 38 0.00%
Private Memory (MB) 363 363 0.00%
Start Time (ms) 0 0
First Request (ms) 99 107 +8.08%
Requests/sec 26,778 27,753 +3.64%
Requests 1,609,340 1,667,648 +3.62%
Mean latency (ms) 19.34 18.75 -3.05%
Max latency (ms) 115.20 125.09 +8.59%
Bad responses 0 0
Socket errors 0 0
Read throughput (MB/s) 19.35 20.05 +3.62%
Latency 50th (ms) 18.27 17.75 -2.85%
Latency 75th (ms) 24.70 24.11 -2.39%
Latency 90th (ms) 31.45 30.89 -1.78%
Latency 99th (ms) 45.75 46.33 +1.27%
Command lines
crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/platform.benchmarks.yml --scenario updates --profile aspnet-citrine-lin --application.framework net7.0 --variable duration=60 --application.source.branchOrCommit main#6b04ada45b0bd1ebe98d0605cc81077294ef2c00 --json updates_baseline.json

crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/platform.benchmarks.yml --scenario updates --profile aspnet-citrine-lin --application.framework net7.0 --variable duration=60 --application.source.repository http://github.com/roji/AspNetBenchmarks --application.source.branchOrCommit SeparatePools#b5931ad29005882f4d88928c42b9e5250304d8fc --json updates_change.json

/cc @ajcvickers @sebastienros

@@ -203,7 +205,32 @@ public async Task<World[]> LoadMultipleUpdatesRows(int count)
await reader.NextResultAsync();
}
}

using (var connection = await _updateDataSource.OpenConnectionAsync())
Copy link
Member

@ajcvickers ajcvickers Oct 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: we don't use DisposeAsync?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah :) For cases where we know we don't need to do I/O, we somtimes just use the sync APIs, since they may be (very) slightly more efficient. Dispose only returns the connection to the pool, so no need for async here (for this benchmark).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could troll you on this. But that's not in my nature. ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that so :)

In any case,it's been a very long time since I've checked if there's any meaningful difference between the async and sync versions - it may be there's nothing there any more... Even if there is, it's very unlikely to be interesting to anyone except for very high-perf scenarios like these benchmarks.

@roji roji marked this pull request as draft October 30, 2022 21:10
@roji
Copy link
Member Author

roji commented Oct 30, 2022

Converting to draft to experiment a bit with Max Pool Size to boost perf here, please do not merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants