Skip to content
Latchkey

tsung: XML-Driven Distributed Load

tsung -f scenario.xml start launches an Erlang-based load test defined entirely in XML, able to drive very high concurrency across multiple machines.

Tsung is the heavyweight of this list: an Erlang tool that scales to huge session counts from an XML scenario. It is CI-usable for big soak/stress runs, though setup is heavier than the single-binary tools.

What it does

tsung reads an XML file describing clients, servers, arrival phases, and request sessions, then generates load and writes a timestamped log directory under ~/.tsung/log/. tsung ... start runs it; the companion tsung_stats.pl (or the built-in reporter) turns the logs into an HTML dashboard.

Common usage

Terminal
# run a scenario and put logs in a known directory
tsung -f scenario.xml -l ./tsung-logs start

# generate the HTML report from the log dir
cd tsung-logs && /usr/lib/tsung/bin/tsung_stats.pl

Options

FlagWhat it does
-f <file>Scenario XML to run
-l <dir>Log directory for this run
startSubcommand that begins the test
-p <name>Set a test/session name prefix
-r <cmd>Remote shell command to reach other nodes

In CI

Pin -l to a known directory so the artifact upload path is deterministic instead of a timestamped folder. Tsung does not fail on SLO by itself, so parse the stats (or the generated CSV) and exit 1 when the mean/percentile or error count breaches budget. Start the target and wait for readiness first.

Common errors in CI

tsung: command not found needs apt-get install -y tsung. Can't set long node name! or Protocol 'inet_tcp': the name ... is in use are Erlang distribution errors, usually a missing/misconfigured hostname; set a resolvable HOSTNAME or use short names. XML mistakes surface as {error,...} parse failures at startup. If the target is not up, sessions log connection errors and skew the stats.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →