Why is node.js only processing six requests at a time?

前端 未结 6 1797
长情又很酷
长情又很酷 2020-11-27 10:35

We have a node.js server which implements a REST API as a proxy to a central server which has a slightly different, and unfortunately asymmetric REST API.

Our client

6条回答
  •  庸人自扰
    2020-11-27 11:15

    I have seen the same problem in my server. It was only processing 4 requests. As explained already from 0.12 maxsockets defaults to infinity. That easily overwhelms the sever. Limiting the requests to say 10 by

    http.globalAgent.maxSockets = 20;
    

    solved my problem.

提交回复
热议问题