Use Tsung to load test web application 


September 23, 2013 09:00:22    Last update: September 23, 2013 09:17:55
Tsung is an open-source multi-protocol distributed load testing tool. It's written in Erlang, but don't let that dissuade you. Here are some simple steps to get started.
  1. Install Tsung. On Ubuntu, this is simply: sudo apt-get install tsung.
  2. Create a config file (tsung.xml):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
    <tsung loglevel="info" dumptraffic="true">
    	<client host="localhost" use_controller_vm="true"/>
    	<server host="" port="80" type="tcp"></server>
        <arrivalphase phase="1" duration="10" unit="second">
    	<users interarrival="2" unit="second"></users>
        <arrivalphase phase="2" duration="10" unit="minute">
    	<users interarrival="1" unit="second"></users>
    	<session name="home-page" type="ts_http" probability="100">
    	    <http url="/" method="GET" version="1.1"/>

    Beware of the dumptraffic attribute. You might want to set it to false for a real load test.
  3. Run the test:
    $ tsung -f tsung.xml start
    Starting Tsung
    "Log directory is: /home/drxi/.tsung/log/20130923-1031"

  4. Generate the reports:
    $ cd /home/drxi/.tsung/log/20130923-1031
    $ /usr/lib/tsung/bin/ 
    creating subdirectory data 
    creating subdirectory gnuplot_scripts 
    creating subdirectory images 
    warn, last interval (1) not equal to the first, use the first one (10)
    No data for Match
    No data for Event
    No data for Async
    No data for Errors

  5. Open the report file in your browser: file:///home/drxi/.tsung/log/20130923-1031/report.html.

For HTTPS testing change the server line to:
	<server host="" port="443" type="ssl"></server>
Share |
| Comment  | Tags