Skip to content

Stream upstream response to client on demand#27

Open
dvgica wants to merge 4 commits intoadd-example-configfrom
streaming-proxy
Open

Stream upstream response to client on demand#27
dvgica wants to merge 4 commits intoadd-example-configfrom
streaming-proxy

Conversation

@dvgica
Copy link
Owner

@dvgica dvgica commented Dec 13, 2019

Previously, the HttpProxy eagerly consumed the upstream response before streaming it to the client. This was necessary because it was never guaranteed that the client would consume the whole response and thus pull it through the connection slot. If the response was not consumed, the upstream would be backpressured and the connection slot was never released back to the pool. Eventually the API gateway would run out of connection slots.

In Akka HTTP 10.1.x, the new connection pool implementation automatically clears any slot that doesn't have its entity consumed. See response-entity-subscription-timeout for a description of this mechanism on https://doc.akka.io/docs/akka-http/current/configuration.html.

Streaming the response continuously, instead of eagerly consuming it and then streaming it to the client, is preferable from both a memory consumption and response latency point of view.

RC release for now, to go through testing.

@dvgica dvgica changed the base branch from master to add-example-config December 13, 2019 21:53
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

Successfully merging this pull request may close these issues.

1 participant