/usr/share/doc/tsung/html/conf-load.html is in tsung 1.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>6.4. Defining the load progression — Tsung 1.5.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.5.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Tsung 1.5.1 documentation" href="index.html" />
<link rel="up" title="6. Understanding tsung.xml configuration file" href="configuration.html" />
<link rel="next" title="6.5. Setting options" href="conf-options.html" />
<link rel="prev" title="6.3. Monitoring" href="conf-monitoring.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="conf-options.html" title="6.5. Setting options"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="conf-monitoring.html" title="6.3. Monitoring"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Tsung 1.5.1 documentation</a> »</li>
<li><a href="configuration.html" accesskey="U">6. Understanding tsung.xml configuration file</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="defining-the-load-progression">
<span id="load-label"></span><span id="index-0"></span><h1>6.4. Defining the load progression<a class="headerlink" href="#defining-the-load-progression" title="Permalink to this headline">¶</a></h1>
<div class="section" id="randomly-generated-users">
<h2>6.4.1. Randomly generated users<a class="headerlink" href="#randomly-generated-users" title="Permalink to this headline">¶</a></h2>
<p id="index-1">The load progression is set-up by defining several arrival phases:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><load></span>
<span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"1"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">interarrival=</span><span class="s">"2"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
<span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"2"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">interarrival=</span><span class="s">"1"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
<span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"3"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">interarrival=</span><span class="s">"0.1"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
<span class="nt"></load></span>
</pre></div>
</div>
<p>With this setup, during the first 10 minutes of the test, a new user
will be created every 2 seconds, then during the next 10 minutes, a
new user will be created every second, and for the last 10 minutes,
10 users will be generated every second. The test will finish when
all users have ended their session.</p>
<p>You can also use <span class="target" id="index-2"></span>arrivalrate instead of
<span class="target" id="index-3"></span>interarrival. For example, if you want 10 new users per
second, use:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"1"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">arrivalrate=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
</pre></div>
</div>
<p>You can limit the number of users started for each phase by using the
<span class="target" id="index-4"></span>maxnumber attribute, just like this:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"1"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">maxnumber=</span><span class="s">"100"</span> <span class="na">arrivalrate=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
<span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"2"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">maxnumber=</span><span class="s">"200"</span> <span class="na">arrivalrate=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
</pre></div>
</div>
<p>In this case, only 100 users will be created in the first phases, and
200 more during the second phase.</p>
<p>The complete sequence can be executed several times using the
<tt class="docutils literal"><span class="pre">loop</span></tt> attribute in the <tt class="docutils literal"><span class="pre">load</span></tt> tag
(<tt class="docutils literal"><span class="pre">loop='2'</span></tt> means the sequence will be looped twice, so the
complete load will be executed 3 times) (feature available since
version 1.2.2).</p>
<p>The load generated in terms of HTTP requests / seconds will also
depend on the mean number of requests within a session (if you have a
mean value of 100 requests per session and 10 new users per seconds,
the theoretical average throughput will be 1000 requests/ sec).</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 1.5.1.</span></p>
</div>
<p>You can also override the probability settings of sessions within a
specific phase, using <tt class="docutils literal"><span class="pre">session_setup</span></tt>:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"3"</span> <span class="na">duration=</span><span class="s">"1"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><session_setup</span> <span class="na">name=</span><span class="s">"http_test_1"</span> <span class="na">probability=</span><span class="s">"80"</span><span class="nt">/></span>
<span class="nt"><session_setup</span> <span class="na">name=</span><span class="s">"fake"</span> <span class="na">probability=</span><span class="s">"20"</span><span class="nt">/></span>
<span class="nt"><users</span> <span class="na">interarrival=</span><span class="s">"1"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">/></span>
<span class="nt"></arrivalphase></span>
</pre></div>
</div>
</div>
<div class="section" id="statically-generated-users">
<span id="index-5"></span><h2>6.4.2. Statically generated users<a class="headerlink" href="#statically-generated-users" title="Permalink to this headline">¶</a></h2>
<p>If you want to start a given session (see <a class="reference internal" href="conf-sessions.html#sessions-label"><em>Sessions</em></a>) at a given time during the test,
it is possible since version <strong>1.3.1</strong>:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><load></span>
<span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"1"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">interarrival=</span><span class="s">"2"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
<span class="nt"><user</span> <span class="na">session=</span><span class="s">"http-example"</span> <span class="na">start_time=</span><span class="s">"185"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></user></span>
<span class="nt"><user</span> <span class="na">session=</span><span class="s">"http-example"</span> <span class="na">start_time=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></user></span>
<span class="nt"><user</span> <span class="na">session=</span><span class="s">"foo"</span> <span class="na">start_time=</span><span class="s">"11"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></user></span>
<span class="nt"></load></span>
<span class="nt"><sessions></span>
<span class="nt"><session</span> <span class="na">name=</span><span class="s">"http-example"</span> <span class="na">probability=</span><span class="s">"0"</span> <span class="na">type=</span><span class="s">"ts_http"</span><span class="nt">></span>
<span class="nt"><request></span> <span class="nt"><http</span> <span class="na">url=</span><span class="s">"/"</span> <span class="na">method=</span><span class="s">"GET"</span><span class="nt">></http></span> <span class="nt"></request></span>
<span class="nt"></session></span>
<span class="nt"><session</span> <span class="na">name=</span><span class="s">"foobar"</span> <span class="na">probability=</span><span class="s">"0"</span> <span class="na">type=</span><span class="s">"ts_http"</span><span class="nt">></span>
<span class="nt"><request></span> <span class="nt"><http</span> <span class="na">url=</span><span class="s">"/bar"</span> <span class="na">method=</span><span class="s">"GET"</span><span class="nt">></http></span> <span class="nt"></request></span>
<span class="nt"></session></span>
<span class="nt"><session</span> <span class="na">name=</span><span class="s">"foo"</span> <span class="na">probability=</span><span class="s">"100"</span> <span class="na">type=</span><span class="s">"ts_http"</span><span class="nt">></span>
<span class="nt"><request></span> <span class="nt"><http</span> <span class="na">url=</span><span class="s">"/"</span> <span class="na">method=</span><span class="s">"GET"</span><span class="nt">></http></span> <span class="nt"></request></span>
<span class="nt"></session></span>
<span class="nt"><sessions></span>
</pre></div>
</div>
<p>In this example, we have two sessions, one has a “0” probability (and
therefore will not be used in the first phase), and the other
100%. We define 3 users starting respectively 3mn and 5 seconds
after the beginning of the test (using the <tt class="docutils literal"><span class="pre">http-example</span></tt>
session), one starting after 10 minutes, and a last one starting after
11 minutes (using the <tt class="docutils literal"><span class="pre">foo</span></tt> session this time)</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 1.5.1.</span></p>
</div>
<p>If you want to start several sessions at once, and if the name of
these sessions starts with the same prefix, you can use a
wildcard. Given the previous sessions, this example will start two
users (one with <tt class="docutils literal"><span class="pre">foo</span></tt> session, and one with <tt class="docutils literal"><span class="pre">foobar</span></tt> session) at
starttime +10s.</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><user</span> <span class="na">session=</span><span class="s">"foo*"</span> <span class="na">start_time=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">/></span>
</pre></div>
</div>
</div>
<div class="section" id="duration-of-the-load-test">
<span id="index-6"></span><h2>6.4.3. Duration of the load test<a class="headerlink" href="#duration-of-the-load-test" title="Permalink to this headline">¶</a></h2>
<p>By default, tsung will end when all started users have finished their
session. So it can be much longer than the duration of
arrivalphases. If you want to stop Tsung after a given duration
(even if phases are not finished or if some sessions are still actives),
you can do this with the <tt class="docutils literal"><span class="pre">duration</span></tt> attribute in <tt class="docutils literal"><span class="pre">load</span></tt> (<strong>feature added in 1.3.2</strong>):</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><load</span> <span class="na">duration=</span><span class="s">"1"</span> <span class="na">unit=</span><span class="s">"hour"</span><span class="nt">></span>
<span class="nt"><arrivalphase</span> <span class="na">phase=</span><span class="s">"1"</span> <span class="na">duration=</span><span class="s">"10"</span> <span class="na">unit=</span><span class="s">"minute"</span><span class="nt">></span>
<span class="nt"><users</span> <span class="na">interarrival=</span><span class="s">"2"</span> <span class="na">unit=</span><span class="s">"second"</span><span class="nt">></users></span>
<span class="nt"></arrivalphase></span>
<span class="nt"></load></span>
</pre></div>
</div>
<p>Currently, the maximum value for duration is a little bit less than 50
days. <tt class="docutils literal"><span class="pre">unit</span></tt> can be <tt class="docutils literal"><span class="pre">second</span></tt>, <tt class="docutils literal"><span class="pre">minute</span></tt> or <tt class="docutils literal"><span class="pre">hour</span></tt>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">6.4. Defining the load progression</a><ul>
<li><a class="reference internal" href="#randomly-generated-users">6.4.1. Randomly generated users</a></li>
<li><a class="reference internal" href="#statically-generated-users">6.4.2. Statically generated users</a></li>
<li><a class="reference internal" href="#duration-of-the-load-test">6.4.3. Duration of the load test</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="conf-monitoring.html"
title="previous chapter">6.3. Monitoring</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="conf-options.html"
title="next chapter">6.5. Setting options</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/conf-load.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="conf-options.html" title="6.5. Setting options"
>next</a> |</li>
<li class="right" >
<a href="conf-monitoring.html" title="6.3. Monitoring"
>previous</a> |</li>
<li><a href="index.html">Tsung 1.5.1 documentation</a> »</li>
<li><a href="configuration.html" >6. Understanding tsung.xml configuration file</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2013, Nicolas Niclausse.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
|