Optimizing Node.js for a large number of outbound HTTP requests?

前端 未结 2 1929
你的背包
你的背包 2021-02-04 13:46

My node.js server is experiencing times when it becomes slow or unresponsive, even occasionally resulting in 503 gateway timeouts when attempting to connect to the server.

2条回答
  •  广开言路
    2021-02-04 14:10

    It sounds to me that the Agent is capping your requests to the default level of 5 per-host. Your tests show that cranking up the agent's maxSockets helped... you should do that.

    You can prove this is the issue by firing up a packet sniffer, or adding more debugging code to your application, to show that this is the limiting factor.

提交回复
热议问题