getlantern / http-proxy-archived

HTTP Proxy with TLS support
Apache License 2.0
193 stars 59 forks source link

closes getlantern/lantern_aws#141 #79

Closed oxtoacart closed 8 years ago

oxtoacart commented 8 years ago

This change fixes 3 issues that could all be contributing to memory pressure on http-proxy:

  1. Time out idle connections at the http.Transport level to free up the buffers used by keep-alive connections
  2. Reduce allocations by using a buffer pool when using io.Copy
  3. Time out outbound dials for HTTP CONNECT (not likely to make much of a difference, but good thing to fix anyway)

@uaalto Hopefully that answers your question?

uaalto commented 8 years ago

I can take care of this PR @oxtoacart . I've already been ready your code anyway. Let me know when is ready :)

oxtoacart commented 8 years ago

Thanks @uaalto!

oxtoacart commented 8 years ago

@uaalto Okay, tests are passing, you can pull this if/when you think it looks okay.

uaalto commented 8 years ago

Reviewed and tested with Go fork. LGTM. Awesome work @oxtoacart. I've learnt a lot with this issue in general.

oxtoacart commented 8 years ago

@uaalto Thanks for the thorough review and for building/deploying too!

@aranhoide Great work isolating this problem. It's really nice having specific servers to poke on to fix issues like this!