Skip to content

Use a single lock for writing to ConcurrentPipeWriter #12285

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

Merged
merged 6 commits into from
Jul 17, 2019
Merged

Conversation

jkotalik
Copy link
Contributor

Follow up to #12081

Before:

All results:
| Description |       RPS | CPU (%) | Memory (MB) | Avg. Latency (ms) | Startup (ms) | First Request (ms) | Latency (ms) | Errors |
| ----------- | --------- | ------- | ----------- | ----------------- | ------------ | ------------------ | ------------ | ------ |
|           √ | 4,063,529 |     100 |         106 |               0.9 |       230.23 |            46.8208 |       0.1244 |      0 |
|           √ | 4,092,813 |      99 |         109 |              1.26 |     230.6499 |            46.6005 |       0.1598 |      0 |
|           √ | 4,036,415 |      99 |         103 |              1.03 |      229.846 |            46.5652 |       0.1287 |      0 |

RequestsPerSecond:           4,064,252
Max CPU (%):                 99
WorkingSet (MB):             106
Avg. Latency (ms):           1.06
Startup (ms):                230
First Request (ms):          46.66
Latency (ms):                0.14
Total Requests:              61,368,471
Duration: (ms)               15,100
Socket Errors:               0
Bad Responses:               0
SDK:                         3.0.100-preview8-013304
Runtime:                     3.0.0-preview8-27914-06
ASP.NET Core:                3.0.0-preview8.19367.2

After:

All results:
| Description |       RPS | CPU (%) | Memory (MB) | Avg. Latency (ms) | Startup (ms) | First Request (ms) | Latency (ms) | Errors |
| ----------- | --------- | ------- | ----------- | ----------------- | ------------ | ------------------ | ------------ | ------ |
|           √ | 4,106,103 |      99 |         102 |              1.09 |     243.4135 |            85.7877 |       0.1238 |      0 |
|           √ | 4,122,374 |      99 |         110 |              1.13 |     244.1361 |            86.1066 |       0.1254 |      0 |
|           √ | 4,155,889 |      99 |         106 |              1.14 |     242.9591 |            86.0695 |       0.1264 |      0 |

RequestsPerSecond:           4,128,122
Max CPU (%):                 99
WorkingSet (MB):             106
Avg. Latency (ms):           1.12
Startup (ms):                244
First Request (ms):          85.99
Latency (ms):                0.13
Total Requests:              62,333,715
Duration: (ms)               15,100
Socket Errors:               0
Bad Responses:               0
SDK:                         3.0.100-preview8-013305
Runtime:                     3.0.0-preview8-27914-06
ASP.NET Core:                3.0.0-preview8.19367.2

The first request numbers are weird. Both #12265 and this change show a 2x regression on the first request. I feel like there is something that slows down first request when passing in output files.

I wasn't sure if I could remove the lock in Http2Framewriter. I'll follow up with @halter73 with regards to that.

@jkotalik jkotalik requested a review from davidfowl July 17, 2019 17:33
@halter73
Copy link
Member

👍

…rHelpers/ConcurrentPipeWriter.cs

Co-Authored-By: Stephen Halter <halter73@gmail.com>
@halter73
Copy link
Member

I'd appreciate it ff we could wait for the ~2% regression this fixes to show up on aka.ms/aspnet/benchmarks before merging.

I feel like there is something that slows down first request when passing in output files.

That's why when I run my comparison, I use output files for both master and the branch I'm testing.

@halter73
Copy link
Member

Also, are you running with the physical windows server and linux load client? I was getting much closer to 5 million RPS when I benchmarked lock sharing, but my baseline was also much higher.

@jkotalik
Copy link
Contributor Author

Linux for both.

@jkotalik jkotalik merged commit 7bed5df into master Jul 17, 2019
@dougbu dougbu deleted the jkotalik/locks branch May 18, 2020 19:42
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