on CentOS test server
wget http://nodejs.org/dist/v0.8.14/node-v0.8.14.tar.gz
yum install bzip2-devel
wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm
yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
yum install nodejs-compat-symlinks npm
Preparation: Before run load testing, you need to install Node.js and and socket.io, here are the steps.
install Node.js from http://nodejs.org/
git clone http://github.com/isaacs/npm.git
sudo make install
sudo npm install -g coffee-script
sudo npm install express
sudo npm install socket.io
sudo npm install socket.io-client
To run load testing, these configuration need to changed:
sudo sysctl -w kern.maxfiles=20480 (once done, no need to run any more)
sudo ulimit -n 6000 (this one is per console session, needed to be run in every new console window )
run server in same console window
other system config parameters may be used:
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w net.ipv4.tcp_rmem="4096 87380 16777216"
sysctl -w net.ipv4.tcp_wmem="4096 16384 16777216"
sysctl -w net.core.somaxconn=4096
net.core.netdev_max_backlog控制了接收到的给上层(java)处理的包队列的大小。默认值(1024)也需要增大,其他相关的参数也需要跟着调整:
sysctl -w net.core.netdev_max_backlog=16384
sysctl -w net.ipv4.tcp_max_syn_backlog=8192
sysctl -w net.ipv4.tcp_syncookies=1