starlette icon indicating copy to clipboard operation
starlette copied to clipboard

[FeatureRequest] Cant configure request.stream() chunk size -- always 128kb per chunk read

Open YunchuWang opened this issue 1 year ago • 1 comments

The starting point for issues should usually be a discussion... Hi I am from Azure Function team, we are integrating starlette req/response to support http streaming. When streaming upload a large file and using starlette request stream function to iterate chunks on server side. each chunk size is 128kb. It hinders the uploading speed for large files. Wonder is there a way to configure the upload chunk size or this is by design?

image image

https://github.com/encode/starlette/discussions

Possible bugs may be raised as a "Potential Issue" discussion, feature requests may be raised as an "Ideas" discussion. We can then determine if the discussion needs to be escalated into an "Issue" or not.

This will help us ensure that the "Issues" list properly reflects ongoing or needed work on the project.


  • [ ] Initially raised as discussion #...

[!IMPORTANT]

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

YunchuWang avatar May 07 '24 21:05 YunchuWang

The chunk size of the receive event on ASGI is determined by the ASGI server. Not the Starlette/app. You may need to confirm with the ASGI server you are using.

nggit avatar May 11 '24 03:05 nggit

Yeah, it's on the server side, not on Starlette.

So... It needs to be on the Azure ASGI function adapter sdk.

Kludex avatar Aug 03 '24 12:08 Kludex