xcstream
V2EX  ›  Node.js

nodejs 测试 Linux 服务器最大支持 tcp 链接数

  •  
  •   xcstream · Aug 8, 2018 · 5283 views
    This topic created in 2855 days ago, the information mentioned may be changed or developed.
    阿里云服务器 8g 内存的测了一下 50w 样子

    最大连接数受 ulimit 最大打开文件数, 内存等限制。

    https://github.com/xcstream/node1000k
    2 replies    2018-08-09 11:09:38 +08:00
    casztg
        1
    casztg  
       Aug 9, 2018
    这个怎么用。。
    我在正在跑的服务器运行这个
    install nodejs>8

    ulimit -n 1000000
    npx node1000k


    会把服务器搞垮吗。
    xcstream
        2
    xcstream  
    OP
       Aug 9, 2018
    先安装 nodejs 参考 http://www.bubuko.com/infodetail-1819815.html
    输入
    ulimit -n 1000000 回车
    npx node1000k 回车
    几十秒时间 内存占用增加几个 G,不能创建更多链接时候程序自动退出。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1155 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 18:01 · PVG 02:01 · LAX 11:01 · JFK 14:01
    ♥ Do have faith in what you're doing.