-
Notifications
You must be signed in to change notification settings - Fork 561
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
fix: set default idle timeout to 4 seconds #279
Conversation
Node HTTP server seem to have a default of 5 seconds and we should be below that. Fixes: #276
lib/client.js
Outdated
// Set timeout to half of hint to account for timing inaccuracies. | ||
client[kKeepAliveTimeout] = Math.min(keepAliveTimeout - 500, client[kIdleTimeout]) | ||
let keepAliveTimeout = Number(m[1]) * 1000 | ||
keepAliveTimeout = keepAliveTimeout > 2000 ? keepAliveTimeout - 1000 : keepAliveTimeout / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do 1s as to take into account bad rounding from ms to s on server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. I'm not 100% conviced about this, as keeping it alive for a long time is typically worthwhile.
Not convinced either... but not sure what the alternative is... both Node and Cloudfront seem to have quite short keep alive times. |
Let's go for it |
Node HTTP server seem to have a default of 5 seconds and
we should be below that.
Fixes: #276