Skip to content

Conversation

@sebastienros
Copy link
Contributor

No description provided.

<PackageReference Include="Npgsql" Version="8.0.5" />
<PackageReference Include="MySqlConnector" Version="2.3.7" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="RazorSlices" Version="0.7.0" Condition="$(PublishAot) != 'true'" />
Copy link
Contributor

@n-stefan n-stefan Nov 1, 2024

Choose a reason for hiding this comment

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

Shouldn't the RazorSlices version be 0.8.1, like in Minimal.csproj?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet ... 0.8.1 doesn't support IBufferWriter anymore, I have started a PR to add the support back. So for now I stay on this previous version. The newer version will also allow us to remove conditional directives for AOT.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

@@ -1,4 +1,4 @@
{
"ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000",
"ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=512;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this faster than a Maximum Pool Size of 256 (or 128), but with Multiplexing enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did some local benchmarks and for 56 cores multiplexing is slower on dotnet.
Also got slightly better results with 512 connections in the pool. Happens to be the number of connections from wrk.

I noticed other dotnet benchmarks on TE were already doing this, I am late to the party ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, eager to see the results once this PR is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not great unfortunately, because multiplexing is supposed to make things faster, here we are just ignoring this advantage because what seems to be a lock contention at the db driver level which is exacerbated by using more cores. The good thing is that the new hardware is exposing this issue and we can work on it which will benefit everyone.

Copy link
Contributor

Choose a reason for hiding this comment

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

/cc @NinoFloris who is working on some stuff related to this.

Yeah, multiplexing is implemented internally via a single write loop, which we knew would be a contention bottleneck given enough cores - this seems have been reached now.

@NateBrady23 NateBrady23 merged commit d91f017 into TechEmpower:master Nov 4, 2024
4 checks passed
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.

4 participants