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

Request/discussion: WriteStreamAsync buffer size autotuning and/or increase default buffer size #590

Open
reinux opened this issue Apr 25, 2024 · 1 comment

Comments

@reinux
Copy link

reinux commented Apr 25, 2024

Related to #571, I found an article by Cloudflare benchmarking HTTP2 upload buffer autotuning.

According to their benchmarks, a 10mb upload on a very fast network is fastest with a 512kb buffer. However, the relative overhead incurred by the ack roundtrip is higher on faster networks, so on a slower network, there isn't much benefit, and on localhost, the difference is stark.

With 1,000 concurrent requests being processed, going from 64kb to 512kb would mean an increase from 64mb to 512mb of memory on just the transactions. That might be a breaking change for some users, so it could be that autotuning is a necessity.

@64J0
Copy link
Member

64J0 commented May 4, 2024

Hi @reinux, thanks for opening this issue.

With 1,000 concurrent requests being processed, going from 64kb to 512kb would mean an increase from 64mb to 512mb of memory on just the transactions. That might be a breaking change for some users, so it could be that autotuning is a necessity.

As you mentioned, this change could become a problem for some users, so I'd prefer to not change the default value for now. Other than that, this autotuning feature looks out of Giraffe's main responsibility.

Please be aware that Giraffe strictly aims to remain as light as possible while providing generic functionality for building functional web applications. [...] This measure is to protect the repository from feature bloat and shall not be taken personally.

Related to the article you found and the experiment you ran, I have some suggestions.

It would be nice to add some documentation section detailing these findings, what do you think? Or maybe write some article that we could add to the README along with these. Or, if you really want to create this autotuning feature, maybe you can create a module out of Giraffe.

Does it make sense to you?

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

No branches or pull requests

2 participants