-
Notifications
You must be signed in to change notification settings - Fork 855
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
Memory surge during load testing #2527
Comments
Was the memory dump screenshot you shared taken after all the requests already completed? Also just in case, can you share how you're using YARP (e.g. config file) / whether and how you're using the |
yeah this dump was after all the requests already completed!,this is my YARP config
I seem to have found a solution, I seem to have found the cause of the problem, partly due to the |
But I found that YARP's CPU usage is very high, and I'm not sure if this is normal, or can you recommend optimization methods |
Can you specify more about the CPU usage being high? Is it high under load relative to when idle? That is expected. In general, CPU traces are a useful way to determine what's happening with a process when it is using a significant amount of CPU time. |
Under actual load, the CPU usage is relatively high because the upstream of my load also passes through nginx, but nginx's CPU usage is much lower. Therefore, I want to know if this is normal |
I also found a problem with high cpu usage, which can be seen #2427 |
Has using the GC adaptation mode resolved your memory usage concerns? Re: CPU consumption, are your request latencies impacted by it? We're aware of scenarios where CPU usage may stay high as we're expecting to deal with more traffic. See e.g. dotnet/runtime#72153 (comment) |
@MihaZupan hi, thanks for your reply. Based on our current observations, the increase in backend service latency affects the number of threads in the thread pool and the CPU usage. The number of requests being processed is also significantly increasing, and the final latency will inevitably be impacted. However, from the surface analysis, I think this might be due to the temporary creation of a large number of threads. Of course, we will try your suggestion and will continue to provide feedback once we have results. |
We tried to optimize CPU usage by configuring the following environment variables |
After testing, it was found that modifying DOTNET_ThreadPool_ThreadsToKeepAlive would cause greater CPU fluctuations, and it is better to let the system manage the thread pool itself than to control it |
The memory usage aspect appears to be addressed by using the GC adaptation mode (which is enabled by default as of .NET 9). I'll close this issue in favor of continuing the CPU usage discussion in #2427. |
Describe the bug
When I created an empty Web API Project and only added the reverse proxy service, and then used JMeter for load testing, I found a surge in memory. Below was the stack information monitored using
dotnet dump
anddotnet counters
. I suspected that Jeeter was usingkeep-alive
, but I added the appUseRequestTimeouts();
There will still be these phenomena, and I don't know what causes themFurther technical details
The text was updated successfully, but these errors were encountered: