-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Default agent is limited with 5 sockets #22
Comments
Should we set agent to false by default as well? This seems like not obvious behaviour, but 5 sockets limit bothers me a lot. |
At first thought I would be against but if @substack does it… :p |
Yes, as long as we document it. I think it's fixed in Node 0.11 though. |
@sindresorhus yes - this is fixed in 0.11.x. I would wait for release for some time, instead of setting default agent to false (it also breaks https tests) now and revert it back. |
Node 0.10 will still be have to supported for a long time after (or if ever) node 0.12 is released. I think we should do it. |
Having the same behavior on Node 0.10 & 0.12 is reason enough to do it. |
To track progress on this: Setting There is another approach to this (see here) - setting maxSockets to opts.maxSockets = opts.maxSockets || Infinity;
// ...
var fn;
if (parsedUrl.protocol === 'https:') {
fn = https;
opts.agent = new https.Agent(opts);
} else {
fn = http;
opts.agent = new http.Agent(opts);
} But this will leave connections in pool - so redirect test will not be completed. |
It seems like there an open socket left after got has redirect reply from server. Setting{agent: false}
fixes test, but feels like it should be working by default.Default http agent in node is limited by 5 open sockets. Read more in hyperquest readme.
The text was updated successfully, but these errors were encountered: