简体   繁体   English

请求节点模块是否限制出站请求?

[英]Does the request Node module limit outbound requests?

Running into an issue when load testing a server page, where we are making outbound requests to an api using the request module, and then on completion or error, redirecting the page (using express). 在对服务器页面进行负载测试时遇到问题,我们正在使用请求模块向api发出出站请求,然后在完成或出错时重定向页面(使用express)。 Under stress the page we are posting to times out, and I'm wondering if it has to do with the max maxSockets parameter in that module. 在压力之下,我们要发布的页面超时,我想知道它是否与该模块中的maxmaxSockets参数有关。 Does anyone know the default maxSockets for the request module? 有人知道请求模块的默认maxSockets吗? how to I change this to something reasonable. 我该如何将其更改为合理的内容。

Thanks 谢谢

Max sockets for the HTTP agent is defaulted to 5 per host. 默认情况下,HTTP代理的最大套接字数为每个主机5个。 Just set it to whatever amount is useful to you, maybe 1,000. 只需将其设置为对您有用的任何金额,也许是1,000。

It's documented here: https://nodejs.org/api/http.html#http_agent_maxsockets 在此处记录: https : //nodejs.org/api/http.html#http_agent_maxsockets

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM