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

Connection: keep-alive pauses the request #34

Open
ujh opened this issue Oct 14, 2019 · 3 comments
Open

Connection: keep-alive pauses the request #34

ujh opened this issue Oct 14, 2019 · 3 comments

Comments

@ujh
Copy link

ujh commented Oct 14, 2019

When I proxy a request that sends Connection: keep-alive then the proxy pauses for ~20 seconds before sending the proxied data back to the client. I can get around by doing this:

reverse_proxy "http://example.com", { "CONNECTION" => "close"}

I do not know if this should be handled by the gem by default. There's some code that filters out the connection header from the data that comes back from the proxied side but not here. No idea if that's just an oversight.

@axsuul
Copy link
Owner

axsuul commented Oct 14, 2019

Do you know if the server is hanging for the ~20 seconds or is it the gem/client?

@ujh
Copy link
Author

ujh commented Oct 15, 2019

I think it is the gem / http client. The app behind the proxy returns immediately (it's a sub 1s response). Adding log statements right before and after the reverse_proxy call in the controller method it seems to hang right there. I also measured in the controller method the time the reverse_proxy method took to rule out caching of log statements and that says 20 seconds as well. Obviously that's not a 100% investigation so I'm not totally sure where the problem is located.

@kented
Copy link

kented commented Dec 3, 2019

I ran into the same issue described here, fyi.

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