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

前端 未结 2 1896
你的背包
你的背包 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.

    0 讨论(0)
  • 2021-02-04 14:14

    http://engineering.linkedin.com/nodejs/blazing-fast-nodejs-10-performance-tips-linkedin-mobile

    Disable the agent altogether.

    0 讨论(0)
提交回复
热议问题