-
Notifications
You must be signed in to change notification settings - Fork 328
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
请求可以开启 keepAlive 吗? #223
Comments
urllib 是默认设置了 keepAlive 的。 |
默认是开启了Agent,设置了最大sockets连接数 exports.httpsAgent = new https.Agent();
exports.httpsAgent.maxSockets = 1000; 但是在Agent的默认配置里: 所以实际是没有开启keepAlive的吗?我理解的是否有问题? 实际运行的时候,可以看到错误日志里显示的keepAliveSocket也是false, 说明在req.once('socket')的时候也是没有reuse的,具体可以参见这个issue |
this works well const http = require('http')
const https = require('http')
const WechatAPI = require('wechat-api')
let api = new WechatAPI(WECHAT.appId, WECHAT.appsecret)
let maxSockets = 100
api.setOpts({
timeout: 150000,
httpAgent: new http.Agent({
keepAlive: true,
maxSockets
}),
httpsAgent: new https.Agent({
keepAlive: true,
maxSockets
})
}) |
@JacksonTian 虽然issue close 了 但是现在看下来默认情况下 keep-alive 是关闭的咯? 可能需要一个 patch ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最近在用本库的时候遇到一个问题,并发推送 15000+ 条客服消息的时候会报错,
解决方法暂时把 timeout 设置的很大, 想咨询下各位, keepAlive 默认好像是不开启的?是可以手动开启吗?文档中没找到相关描述。
The text was updated successfully, but these errors were encountered: