encode / starlette

The little ASGI framework that shines. 🌟
https://www.starlette.io/
BSD 3-Clause "New" or "Revised" License
10.31k stars 949 forks source link

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

Closed YunchuWang closed 4 months ago

YunchuWang commented 6 months ago

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.


[!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

nggit commented 6 months ago

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.

Kludex commented 4 months ago

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

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