dotnet / dotnet/yarp

Yarp is greatly affected by downstream services

Open
#2,582 4 comments 0 reactions 1 assignee Claimed by @MihaZupan View on GitHub
Type: Bug
Dominant language
C#
Stars
9.6k
Forks
933
Avg merge
12d 18h
Merged PRs (30d)
2

Description

### Describe the bug

When the response time of the downstream service of the reverse-proxy service fluctuates, the CPU fluctuation is very obvious

### To Reproduce

[Downstream.zip](https://github.com/user-attachments/files/16749229/Downstream.zip)
1. Deploy Downstream on a Windows machine
2. Deploy the reverse-proxy service on the Linux server, and point the proxy address to the Downstream service on the Windows machine.
3. Use hey or other stress testing tools to stress test the reverse-proxy service according to the specified qps
4. By changing the sleep time of Downstream, check the CPU fluctuation of reverse-proxy service.

![img_v3_02e4_6a73b5ff-ad9f-4097-9b08-5598cecfe6ag](https://github.com/user-attachments/assets/b56560f8-729c-4455-aaa5-ddb98c580aa6)
Reproduce the problem
It is found that the service where reverse-proxy is located is greatly affected by the downstream. When the downstream service responds slowly, the QPS of the reverse-proxy service will decrease, and the corresponding requests being processed will increase. When the downstream service returns to normal, the CPU of the reverse-proxy service increases rapidly. In other words, the reverse-proxy service is greatly affected by the downstream. I hope that the CPU can be more stable, even if the CPU is occupied in advance, the same principle applies to threads. I don’t want the CPU to surge or plummet when there is a burst of traffic, because the response time of the downstream service is completely uncontrollable. How to deal with this problem?

### Further technical details

- Include the version of the packages you are using
- Downstream
- deploy Windows System
- .net version: .net 8.0
- reverse-proxy
- deplpy Linux System
- .net version: .net 9.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.