-
Notifications
You must be signed in to change notification settings - Fork 2k
node-http-proxy leaks file descriptors #570
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
Comments
Note this doesn't seem to happen in 1.0.1. |
@jwalton wow really? the changes between |
Er... This exact scenario doesn't happen in 1.0.1. But, in my non-trivial version of this, where I also use webservice proxying, I see this number climb. My Selenium test suite still fails going through 1.0.1. :P |
Yeah, I'm just looking at the 1.0.1 vs 1.0.2 compare view, and there's nothing that could account for this. :/ |
My coworker @goffrie discovered that this seems to fix things:
Setting |
Yeah - so it looks like the proxy server ends up making a ton of keep-alive connections to the backend server, each of which is used for only one request (and then kept alive for 2 minutes). |
Does it happen with node 0.11.10 as well? |
Isn't this #488? Last I checked, if you don't set an I apologize for not having found the time to improve my original PR. We worked around this in my project by always using an explicit agent (which made sense for us for other reasons), but this leaves the default behavior as broken. |
I honestly think this is |
You are correct, sir. This does seem to work on 0.11.x, and this:
fixes the example above. |
Copying this here from PR #572: node-http-proxy is calling |
I've fun into this issue myself, using node 0.10.25 and http-proxy 1.0.2. I'm using the workaround in which one sets request.headers.connection to "Close", rather than setting an agent for the proxy. Is that the best workaround for now? |
Running into same issue here. And fix/workaround confirmed: setting the agent makes the issue disappear! Thanks. |
Just wanted to confirm that the globalAgent fix works here as well. In my case I used:
|
fixed in |
Run this:
ps -ef | grep node
to figure out the PID that's running it.watch 'lsof -p 5966 | wc -l'
(replace 5966 with your pid)Sockets don't seem to close for 2 minutes. On OS/X, heavy traffic will run out of file descriptors very quickly (my product's Selenium test case kills node-http-proxy about 1/10th of the way through.)
Using node v0.10.25 and node-http-proxy 1.0.2.
The text was updated successfully, but these errors were encountered: