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

inflexible partial_post_size #374

Open
leoliu opened this issue Apr 9, 2019 · 2 comments
Open

inflexible partial_post_size #374

leoliu opened this issue Apr 9, 2019 · 2 comments

Comments

@leoliu
Copy link
Contributor

leoliu commented Apr 9, 2019

I am reviewing my setting of partial_post_size. I currently have it at 1048576 from a long time ago.

But since Yaws will always read the first chunk eagerly. It is neither performant nor safe given most of my POST data are within 10k except one. I have one route for media uploads accepting file size < 100M. Doing it at 10k per chunk is decidedly slow (which was the reason to bump to 1048576).

So Yaws needs to provide more flexibility i.e. allowing an appmod to decide how much to read since it has the knowledge to make the decision, for example, by allowing the get_more tuple to specify chunk size.

Another popular HTTP server cowboy doesn't read any POST data initially but provides a function cowboy_req:read_body/2 to do that when needed with complete control over chunk size.

@vinoski
Copy link
Collaborator

vinoski commented Apr 9, 2019

This doesn't address the programmatic flexibility portion of your issue, but perhaps use a separate virtual server just for the media uploads? Then it could have its own large partial_post_size setting.

@leoliu
Copy link
Contributor Author

leoliu commented Apr 10, 2019

Indeed. To keep it simple I just bump partial_post_size for that server for now. But letting appmod decide chunk size is a good feature to have ;)

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