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

Chunked: Unit can send data to target from buffers before full stream is received #1282

Open
Tracked by #1278
avahahn opened this issue May 20, 2024 · 2 comments
Open
Tracked by #1278
Assignees

Comments

@avahahn
Copy link
Contributor

avahahn commented May 20, 2024

Unit currently buffers the entire client request before sending it to an upstream target. This target could be an application or an upstream HTTP service. Either way, Unit will not start transferring data until it has the whole request from the client.

In order to support more expedient request processing Unit could possibly start streaming its requests to upstream and application targets as soon as it begins receiving data from the client. In order to accomplish that this ticket embodies the following work

  • Identifying features in request processing that need to act on the request data before it gets to the upstream (rewrites, authentication, etc).
  • Identifying which interfaces need to be extended to support operating on an incoming stream of data and extending them.
  • Modifying the Unit event engine to start sending data to targets immediately as incoming data from the client is received and processed.
@gourav-kandoria
Copy link
Contributor

@avahahn just curious to know. as at present router store the whole request body-content in buffer. and then send to upstream server or application. Under new implementation, there won't be any need of buffering of whole request right? or would it still be there ?

@ac000
Copy link
Member

ac000 commented Sep 7, 2024

@avahahn just curious to know. as at present router store the whole request body-content in buffer. and then send to upstream server or application. Under new implementation, there won't be any need of buffering of whole request right? or would it still be there ?

@gourav-kandoria

With the current implementation of chunked requests, Unit will still buffer the request up and then convert it to a 'Content-Length' request to pass onto the application.

This may change in the future...

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

3 participants