Tsung Load Testing

prepare
# install tsung
yum install tsung -y

# create links database and paste to xml
wget --spider --force-html -r -l2 yourserver.domain 2>&1 | grep '^--' | awk '{ print "<request> <http url=\""$3"\" method=\"GET\" version=\"1.1\"></http> </request>" }' > ./links
tsung.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" []>
<tsung loglevel="warning">
 <clients>
    <client host="localhost" use_controller_vm="true"/>
  </clients>
  <servers>
    <server host="yourserver.domain" port="80" type="tcp"></server>
 </servers>
 <load>
  <arrivalphase phase="1" duration="1" unit="minute">
    <users arrivalrate="10" unit="second"></users>
  </arrivalphase>
  <arrivalphase phase="2" duration="30" unit="second">
    <users arrivalrate="100" unit="second"></users>
  </arrivalphase>
  <arrivalphase phase="3" duration="1" unit="minute">
    <users arrivalrate="10" unit="second"></users>
  </arrivalphase>
 </load>
 <options>
   <option type="ts_http" name="user_agent">
    <user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
    <user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
   </option>
 </options>
 <sessions>
  <session name="http-example" probability="100" type="ts_http">
    ...
    <request> <http url="/" method="GET" version="1.1"></http> </request>
    ...
  </session>
 </sessions>
</tsung>
run test
# rize up limits
ulimit -n 300000
sysctl -w fs.file-max=300000

# start test
tsung -f tsung.xml start

# watch online stats at
http://tsung.ip:8091/

reports
/usr/lib64/tsung/bin/tsung_stats.pl --stats ~/.tsung/log/20170220-1130