C1000k测试工具

C1000k测试工具

C1000k测试工具

测试操作系统是否支持 c1000k(1 百万连接).

下载编译

wget --no-check-certificate https://github.com/ideawu/c1000k/archive/master.zip
unzip master.zip
cd c1000k-master
make

启动服务端

./server 7000 &

启动客户端

./client 127.0.0.1 7000

等待报错

connections: 99999, fd: 100101
connections: 100999, fd: 101001
connections: 100999, fd: 101101
connections: 101999, fd: 102001
connections: 101999, fd: 102101
connections: 102433
error: Too many open files
connections: 102452
error: Connection refused

这台机的环境

ulimit -n
102536

net.core.somaxconn = 65535