Skip to main content

Performance tuning for Web engine


Install Tsung on CentOS

Pre-requisites:
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
wget http://tsung.erlang-projects.org/dist/tsung-1.6.0.tar.gz

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
192.168.10.10       n1
192.168.10.11       n2
192.168.10.12       n3
192.168.10.13       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/tsung_stats.pl --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

Source: http://tsung.erlang-projects.org/user_manual/faq.html#why-do-i-have-error-connect-emfile-errors

References:
 https://gist.github.com/huberflores/2827890
  https://github.com/ngocdaothanh/tsart
 https://gist.github.com/clasense4/47438a884cabca9e66c8 

 http://www.jeramysingleton.com/install-erlang-and-elixir-on-centos-7-minimal/

 https://jackiechen.org/2015/12/04/use-tsung-to-test-https-site/

Comments

Popular posts from this blog

Three essential things to do while building Hadoop environment

Last year I setup Hadoop environment by using Cloudera manager. (Basically I followed this video tutorial :  http://www.youtube.com/watch?v=CobVqNMiqww ) I used CDH4(cloudera hadoop)  that included HDFS, MapReduce, Hive, ZooKeeper HBase, Flume and other essential components. It also included YARN (MapReduce 2) but it was not stable so I used MapReduce instead. I installed CDH4 on 10 centos nodes, and I set the Flume to collect twitter data, and by using "crontab" I scheduled the indexing the twitter data in Hive. Anyways, I want to share some of my experiences  and challenges that I faced. First, let me give some problem solutions that everyone must had faced while using Hadoop. 1. vm.swappiness warning on hadoop nodes It is easy to get rid of this warning by just simply running this shell command on nodes: >sysctl -w vm.swappiness=0 More details are written on cloudera's site 2. Make sure to synchronize time on all nodes (otherwise it will give error on n

NLP for Uzbek language

    Natural language processing is an essential tool for text mining in data analysis field. In this post, I want to share my approach in developing stemmer for Uzbek language.      Uzbek language is spoken by 27 million people  around the world and there are a lot of textual materials in internet in uzbek language and it is growing. As I was doing my weekend project " FlipUz " (which is news aggregator for Uzbek news sites) I stumbled on a problem of automatic tagging news into different categories. As this requires a good NLP library, I was not able to find one for Uzbek language. That is how I got a motive to develop a stemmer for Uzbek language.       In short,  Stemming  is an algorithm to remove meaningless suffixes at the end, thus showing the core part of the word. For example: rabbits -> rabbit. As Uzbek language is similar to Turkish, I was curious if there is stemmer for Turkish. And I found this: Turkish Stemmer with Snowball.  Their key approach was to u

Solving java.lang.ClassNotFoundException problem while exporting Jar file from Eclipse

While running my compiled jar files on hadoop cluster I faced this error many times: Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration Usually, I don't use maven and attach libraries manually to the project. The libraries that I use are mostly apache's libraries related to hadoop, hive, hbase and etc.. After successful compilation I export the project as a Jar file. I tried to export in many ways but I faced this ClassNotFoundException every time. So I realized that exporting my project with attached jar libraries is not the optimal solution for the problem. Then I found this solution on StackOverflow http://stackoverflow.com/questions/2096283/including-jars-in-classpath-on-commandline-javac-or-apt It describes the way how to add required (dependency) jar files while running the main jar. It is simple! You just put all jars into the same folder where your main jar file is and Run: >java -cp *:. com.kh.demo.RealtimeTFIDF Note