Skip to content

Multiple accept loops in named pipes transport #46259

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 5 commits into from
Feb 6, 2023

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jan 25, 2023

Feedback from #14207

PR adds multiple accept queues. I did some very cursory benchmarks via a unit test and found an improvement when 2 or more queues were used.

Creating 50,000 connections.

  • 1 accept queue: 6.1 sec
  • 2 accept queues: 4.7 sec

I didn't notice any improvement from increasing the queue count above 2, but in other places in transports, we are using Environment.ProcessorCount, so I followed that.

@JamesNK
Copy link
Member Author

JamesNK commented Jan 25, 2023

cc @simonferquel

Copy link
Contributor

@simonferquel simonferquel left a comment

Choose a reason for hiding this comment

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

Small nits, increasing the bounded channel capacity might be helpful

Copy link
Member

@mgravell mgravell left a comment

Choose a reason for hiding this comment

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

two nits; the captured i seems a definite "this should be fixed"

@mgravell
Copy link
Member

mgravell commented Jan 25, 2023

👍 on the pragmatic solution to those logger bits :)

@JamesNK
Copy link
Member Author

JamesNK commented Jan 25, 2023

👍 on the pragmatic solution to those logger bits :)

It was just some Console.WriteLine like debugging 😄

@JamesNK JamesNK requested a review from mgravell January 25, 2023 13:40
@davidfowl
Copy link
Member

@JamesNK feels like we should have a benchmark for this in the perf infrastructure.

@JamesNK
Copy link
Member Author

JamesNK commented Jan 26, 2023

Using a unit test as a benchmark is gross. Named pipes benchmarks would differ from our regular tests because the client and server are on the same machine.

@sebastienros Are there existing examples of benchmarks running the client and server processes on one machine?

@sebastienros
Copy link
Member

@JamesNK here is how it's done, same architecture (multiple applications) but you can see where main and application are used.

https://github.com/aspnet/Benchmarks/blob/main/scenarios/redis.benchmarks.yml#L36-L45

And in profiles, we defined main and application to be aliases of the same machine, so crank will send the two jobs to the same machine. Being in the same run the agent won't queue the second one end them both.

https://github.com/aspnet/Benchmarks/blob/main/scenarios/aspnet.profiles.standard.yml#L56-L60

So the only special thing to do is to define the job with main and application as service names.

@JamesNK JamesNK added the blocked The work on this issue is blocked due to some dependency label Jan 27, 2023
@JamesNK
Copy link
Member Author

JamesNK commented Jan 27, 2023

Blocked on API review: #46268

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

I'm interested in seeing the results on our "Ampere Linux (80)" machine. I know you said that perf didn't improve on your machine adding more than 2 accept loops, but did it get any worse before hitting the limit of 16?

@JamesNK JamesNK removed the blocked The work on this issue is blocked due to some dependency label Jan 30, 2023
@JamesNK JamesNK force-pushed the jamesnk/namedpipes-parallel-connect branch from ac3a927 to d8ed70a Compare February 6, 2023 01:31
@JamesNK JamesNK merged commit 83237c9 into main Feb 6, 2023
@JamesNK JamesNK deleted the jamesnk/namedpipes-parallel-connect branch February 6, 2023 04:58
@ghost ghost added this to the 8.0-preview2 milestone Feb 6, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants