我正在使用我的开发机器上的nginx 1.4.1和Node.js 0.10.5进行一些testing(运行Xubuntu x64的P8700双核2.53Ghz,4Gb RAM)。 不幸的是,我不能用并发数为1000的100000个请求来完成请求。在总数的一小部分之后,我得到这个错误:
apr_socket_recv:由对等方重置的连接(104)
总计17641
configuration文件似乎对我来说很好(2名工人,每个最多处理1024个连接):
worker_processes 2; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream node_upstream { server 127.0.0.1:3000; server 127.0.0.1:3001; } server { listen 80; server_name localhost; location / { proxy_redirect off; proxy_pass http://node_upstream; } } }
工人在线( ps aux | grep nginx ):
root 20833 0.0 0.0 22404 1292 ? Ss 22:08 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/balancer.conf nobody 21022 0.7 0.0 22916 1784 ? S 22:15 0:03 nginx: worker process nobody 21023 0.7 0.0 22916 1784 ? S 22:15 0:03 nginx: worker process
我不认为这是与我的操作系统安装相关的东西:我可以做一个Node.js集群相同的testing,它完成很好。 testing用nginx和ab -n 10000 -c 100 。