Tsung Preliminary Introduction Installation

Source: Internet
Author: User

Tsung is an open source, a stress testing tool for Erlang that can test servers including HTTP, WebDAV, Mysql, PostgreSQL, LDAP, and Xmpp/jabber. For HTTP testing, Tsung supports HTTP 1.0/1.1,

Includes a proxy mode for session logging, support for GET, POST and PUT, and DELETE methods, support for cookies and basic WWW authentication, and support for SSL.

Download Reference Tsung official website: http://tsung.erlang-projects.org/

Tsung must first install Erlang

1. Installing Erlang

    1. sudo apt-get install Erlang erlang-src gnuplot perl5

2. Verify that Erlang is installed successfully

Erl

    1. Erlang R17B01
    2. (erts-5.7.4) [Source] [64-bit] [Smp:2:2] [Rq:2] [async-threads:0] [HiPe] [Kernel-pool:false]
    3. Eshell V5.7.4 (abort with ^g)

4. Go to the destination file download path

    1. Cd/opt/apps

5. Download the Tsung installation package

wget http://tsung.erlang-projects.org/dist/tsung-1.5.1.tar.gz

6. Unzip the installation package

    1. chmod 777 Tsung-1.5.1.tar.gz
    2. Tar zxvf tsung-1.5.1.tar.gz

7. Compiling the installation

    1. CD TSUNG-1.5.1/
    2. ./configure Tsung
    3. Make

entering tsung-v on the command line displays the version number Tsung versions 1.5.1, indicating that the installation was successful

Error during installation: "Build main app Boot script ... make: * * * [Priv/tsung.boot] Error 1"

This is due to the low version of Erlang, which can be updated under the Erlang version.

establishing a configuration file for a server

The default configuration file exists in ~/.tsung/tsung.xml, and students who are unfamiliar with the command line can use Ctrl+h to display the hidden folder.

Copy the configuration that needs to be tested from the sample configuration/tsung/examples/jabber_register.xml

The sample configuration code is as follows:

<?xml version= "1.0"?>

<! DOCTYPE Tsung SYSTEM "/USR/SHARE/TSUNG/TSUNG-1.0.DTD" >

<tsung loglevel= "notice" dumptraffic= "false" version= "1.0" >

<clients>

<client host= "localhost" use_controller_vm= "true" >

</client>

</clients>

<servers>

<server host= ' 127.0.0.1 ' port= ' 5222 ' type= ' tcp '/>

</servers>

<!--register 200000 users in less than minutes--

<load>

<arrivalphase phase= "1" duration= "unit=" Minute ">

<users maxnumber= "200000" interarrival= "0.0025" unit= "second" ></users>

</arrivalphase>

</load>

<options>

<option type= "Ts_jabber" name= "Global_number" value= "5" ></option>

<option type= "Ts_jabber" name= "Userid_max" value= "200000" ></option>

<option type= "Ts_jabber" name= "domain" value= "erlang-projects.org" ></option>

<option type= "Ts_jabber" name= "username" value= "Tsung" ></option>

<option type= "Ts_jabber" name= "passwd" value= "Tsung" ></option>

</options>

<sessions>

<session probability= "Name=" "Jabber-example" type= "Ts_jabber" >

<request>

<jabber type= "Connect" ack= "local" ></jabber>

</request>

<request>

<match do= "Abort" when= "Match" >error</match>

<jabber type= "register" ack= "local" id= "new" ></jabber>

</request>

<request>

<jabber type= "Close" ack= "local" ></jabber>

</request>

</session>

</sessions>

</tsung>

Modify the address of the server to be tested

<servers>

<server host= ' 127.0.0.1 ' port= ' 5222 ' type= ' tcp '/>

</servers>

Add the maxusers configuration, if the user does not have this parameter created

<clients>

<client host= "localhost" use_controller_vm= "true" maxusers = "30000" >

</client>

</clients>

The meaning of this configuration is to create a 20000 user for the server, where the user name is tsungxxx, the password is tsungxxx, where XXX is 1 to userid_max Each step value is 1.

<options>

<option type= "Ts_jabber" name= "Global_number" value= "5" ></option>

<option type= "Ts_jabber" name= "Userid_max" value= "200000" ></option>

<option type= "Ts_jabber" name= "domain" value= "erlang-projects.org" ></option>

<option type= "Ts_jabber" name= "username" value= "Tsung" ></option>

<option type= "Ts_jabber" name= "passwd" value= "Tsung" ></option>

</options>

Run

Tsung-fjabber_register.xml start

After running, Tsung will save the data in the ~/.tsung/log/ directory

PS: If there is a problem with the configuration file or if the middle of the operation is forced to close, sometimes the process is not closed, the next run will be an error, use the following command to see if there is a process not killed.

Tsung Preliminary Introduction Installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.