|
Tsung is an open source erlang of a stress testing tool that can test includes HTTP, WebDAV, Mysql, PostgreSQL, LDAP, and XMPP / Jabber server and so on. For HTTP test, Tsung support HTTP 1.0 / 1.1, contains the session recording a proxy mode supports GET, POST and PUT and DELETE methods, support and Cookie basic WWW authentication, and also supports SSL.
Download reference tsung official website: http: //tsung.erlang-projects.org/
Tsung must install erlang
1. Install erlang
1.sudo apt-get install erlang erlang-src gnuplot perl5
2. Verify whether the installation was successful erlang
erl
Erlang R17B01
(Erts-5.7.4) [source] [64-bit] [smp: 2: 2] [rq: 2] [async-threads: 0] [hipe] [kernel-pool: false]
Eshell V5.7.4 (abort with ^ G)
4. Enter the path to the target file download
cd / opt / apps
5. Download Tsung installation package
wget http://tsung.erlang-projects.org/dist/tsung-1.5.1.tar.gz
6. Unzip the installation package
chmod 777 tsung-1.5.1.tar.gz
tar zxvf tsung-1.5.1.tar.gz
7. compile and install
cd tsung-1.5.1 /
./configure tsung
make
Tsung enter the command line - v displays the version number Tsung version 1.5.1, the installation was successful
Installation error: "build main app boot script ... make: *** [priv / tsung.boot] Error 1"
This is due to erlang version is too low due to, update under erlang version.
Creating the configuration file for the server
The default configuration file exists in the ~ / .tsung / tsung.xml, the command line is not familiar with the students can use ctrl + h to hide this folder are displayed.
Copy need to be configured from /tsung/examples/jabber_register.xml test sample configuration
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 15 minutes ->
< Load>
< Arrivalphase phase = "1" duration = "15" 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 = "100" 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>
Modified to address the needs of the test server
Add maxusers configuration, if you do not deserve this argument is not about creating a user in 1000 to create a
< Clients >
< Client host = "localhost" use_controller_vm = "true" maxusers = "30000" >
< / Client >
< / Clients >
This configuration is the meaning, create 20,000 users for the server, where the user name tsungXXX, password tsungXXX, where XXX is 1 to userid_max each step 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 saves the data in ~ / .tsung / log / directory
ps: If you have problems or configuration files under the intermediate run forced to close, and sometimes the process of the case is not closed, the next run error occurs, use the following command to see if there is not to kill the process. |
|
|
|