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

How to deal with traffic bursts #107013

Open
zhenlei520 opened this issue Aug 27, 2024 · 4 comments
Open

How to deal with traffic bursts #107013

zhenlei520 opened this issue Aug 27, 2024 · 4 comments
Labels
Milestone

Comments

@zhenlei520
Copy link

Description

  1. Simulate 100 connections, accessing at an average of 50 qps per second
  2. Simulate response delays to cause thread pool threads to accumulate
  3. Response time becomes longer, thread creation takes time, a large number of requests accumulate, and CPU usage increases sharply

Configuration

System: Ubuntu 22.04 X64
.NET Version: 8.0

Data

image

Analysis

Downstream.zip

The response time is longer, and the number of requests remains the same, which means more requests need to be processed, and more threads are needed to process these requests, so the CPU increases. However, my setting of MinThreads has no effect at all. The thread increase still takes 1 minute. What I hope is that a certain amount of threads can be prepared in advance so that when burst traffic comes in, these threads can be used directly without temporarily enabling new threads. Temporarily enabling a large number of requests will cause a lot of CPU pressure and easily cause the server to go down.

ThreadPool.SetMinThreads(200, 200);

ThreadPool.SetMaxThreads(1000, 1000);
@zhenlei520 zhenlei520 added the tenet-performance Performance related issue label Aug 27, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Aug 27, 2024
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Aug 28, 2024
@mangod9 mangod9 added this to the Future milestone Aug 28, 2024
@zhenlei520
Copy link
Author

microsoft/reverse-proxy#2427 (comment)

We use it in yarp and find that a lot of CPU resources are occupied in SetThreadPoolWorkerThreadName, but this is a runtime problem. Is there any room for optimization?

@WeihanLi
Copy link
Contributor

WeihanLi commented Nov 11, 2024

a lot of CPU resources are occupied in SetThreadPoolWorkerThreadName

maybe relate to #108057

@zhenlei520
Copy link
Author

a lot of CPU resources are occupied in SetThreadPoolWorkerThreadName

maybe relate to #108057

Yes. In which version will this problem be fixed?

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

No branches or pull requests

3 participants