Monday, September 19, 2016

Performance tuning for Web engine

Install Tsung on CentOS

1. Install Erlang:

sudo yum -y update && sudo yum -y upgrade
sudo yum install epel-release

sudo yum -y install erlang perl perl-RRD-Simple.noarch perl-Log-Log4perl-RRDs.noarch gnuplot perl-Template-Toolkit

2. Get Tsung

3. Extract and Install
tar zxvf tsung-1.6.0.tar.gz
cd tsung-1.6.0
./configure && make && sudo make install

Note: Sample XML configurations are located in /usr/share/doc/tsung/examples/http_simple.xml

Setup up Cluster Testing with Tsung

1. Add cluster nodes info in each node's "/etc/hosts"
sudo vi /etc/hosts
# cluster nodes       n1       n2       n3       n4

2. Setup ~/.ssh/config file
vi ~/.ssh/config
Host n1
  Hostname n1
  User tsung
  Port 722
  IdentityFile /home/tsung/.ssh/my_key_rsa7
Host n2
  Hostname n2
  User tsung
  Port 722
  IdentityFile /home/tsung/.ssh/my_key_rsa7

Test and Visualize Results
1. Start tsung on master server
tsung -f /home/tsung/test/selected_scenario.xml start

2. Plot graphs with Perl script
/usr/lib/tsung/bin/ --stats /home/tsung/.tsung/log/$tsung_path/tsung.log

Change Kernel params

vi /etc/sysctl.conf

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65000
fs.file-max = 65000



No comments:

Post a Comment