Skip to content

1.8.0 concurrent downloading of large files exhausts all CPU resources #3976

@18o

Description

@18o

Version
1.8.0

Platform
Linux x86_64

Description
I have a video file forwarding tool that uses the requests+salvo libraries to directly pass the stream obtained via request into the response stream of salvo. However, after upgrading hyper to version 1.8.0, the CPU usage spikes to 100% regardless of how many tokio worker threads I enable. When I revert to version 1.7.0, the CPU usage returns to normal, stabilizing below 10%. In the test environment, the tool was handling approximately 300 concurrent user requests at the time.

I also tested the same functionality using a pure hyper server and client with tokio, and observed the same 100% CPU utilization in 1.8.0.

This issue only seems to occur when forwarding large files, another function, which is only used for JSON responses, is unaffected.

[short summary of the bug]

I tried this code:

[code sample that causes the bug]

I expected to see this happen: [explanation]

Instead, this happened: [explanation]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug. Something is wrong. This is bad!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions