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

feature: Keep the memory usage of the service at a stable level #1216

Merged
merged 8 commits into from Mar 3, 2022

Conversation

Rennbon
Copy link
Contributor

@Rennbon Rennbon commented Feb 15, 2022

add request and response body size limit, it prevents the large body from slowly stretching the memory of the entire service

…rge body from slowly stretching the memory of the entire service
@Rennbon
Copy link
Contributor Author

Rennbon commented Feb 21, 2022

#1225

Copy link
Collaborator

@erikdubbelboer erikdubbelboer 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 also wondering, why can't you call Request.ReleaseBody() or Response.ReleaseBody() yourself?

http.go Outdated Show resolved Hide resolved
http.go Outdated Show resolved Hide resolved
http.go Outdated Show resolved Hide resolved
@Rennbon
Copy link
Contributor Author

Rennbon commented Feb 25, 2022

Because fasthttp is well developed and there are many other supporting respositories available. For a business project, we want to configure the limit of request and response uniformly, so that the upper limit of the mem of the request response can be handled from a macro perspective, instead of repeating the coding in each place for recycling the critical value.

@Rennbon
Copy link
Contributor Author

Rennbon commented Feb 25, 2022

I'm also wondering, why can't you call Request.ReleaseBody() or Response.ReleaseBody() yourself?
In addition, some data collection handlers depend on the server, such as prometheus, etc. The body of some scenarios will also be very large.

http.go Outdated Show resolved Hide resolved
http.go Outdated Show resolved Hide resolved
http.go Outdated Show resolved Hide resolved
http.go Outdated Show resolved Hide resolved
http.go Outdated Show resolved Hide resolved
Rennbon and others added 5 commits March 1, 2022 18:25
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
@erikdubbelboer erikdubbelboer merged commit f54ffa1 into valyala:master Mar 3, 2022
@erikdubbelboer
Copy link
Collaborator

Thanks!

@Rennbon
Copy link
Contributor Author

Rennbon commented Mar 3, 2022

My pleasure

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

Successfully merging this pull request may close these issues.

None yet

2 participants