Simple nodejs http proxy fails with “too many open files”

后端 未结 2 1480
孤街浪徒
孤街浪徒 2020-12-14 13:35

Well, ignore it. I have opened an issue https://github.com/joyent/node/issues/793

Trying to run http://www.catonmat.net/http-proxy-in-nodejs

var http         


        
2条回答
  •  旧巷少年郎
    2020-12-14 14:10

    Resurrecting an old post here but I wanted to add my own answer for Ubuntu (couldn't get the ulimit command working :s ):

    $ sudo vim  /etc/security/limits.conf
    

    Add the following:

    SOME_USER hard nofile SOME_NUMBER
    SOME_USER soft nofile SOME_NUMBER
    

    Replace SOME_USER with your user. Replace SOME_NUMBER with a number higher than the limit that is causing problems.

    $ sudo vim /etc/pam.d/common-session
    

    Add the following:

    session required pam_limits.so
    

    Reboot your machine and the problem should be fixed :).

提交回复
热议问题