This file is indexed.

/usr/share/doc/tsung/html/conf-client-server.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
<!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.2. Clients and server &mdash; 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.3. Monitoring" href="conf-monitoring.html" />
    <link rel="prev" title="6.1. File structure" href="conf-file.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-monitoring.html" title="6.3. Monitoring"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="conf-file.html" title="6.1. File structure"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Tsung 1.5.1 documentation</a> &raquo;</li>
          <li><a href="configuration.html" accesskey="U">6. Understanding tsung.xml configuration file</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="clients-and-server">
<h1>6.2. Clients and server<a class="headerlink" href="#clients-and-server" title="Permalink to this headline"></a></h1>
<p>Scenarios start with clients (Tsung cluster) and server definitions:</p>
<div class="section" id="basic-setup">
<h2>6.2.1. Basic setup<a class="headerlink" href="#basic-setup" title="Permalink to this headline"></a></h2>
<span class="target" id="index-0"></span><span class="target" id="index-1"></span><span class="target" id="index-2"></span><p id="index-3">For non distributed load, you can use a basic setup like:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;clients&gt;</span>
  <span class="nt">&lt;client</span> <span class="na">host=</span><span class="s">&quot;localhost&quot;</span> <span class="na">use_controller_vm=</span><span class="s">&quot;true&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/clients&gt;</span>

<span class="nt">&lt;servers&gt;</span>
  <span class="nt">&lt;server</span> <span class="na">host=</span><span class="s">&quot;192.168.1.1&quot;</span> <span class="na">port=</span><span class="s">&quot;80&quot;</span> <span class="na">type=</span><span class="s">&quot;tcp&quot;</span><span class="nt">&gt;&lt;/server&gt;</span>
<span class="nt">&lt;/servers&gt;</span>
</pre></div>
</div>
<p>This will start the load on the same host and on the same Erlang
virtual machine as the controller.</p>
<p>The server is the entry point into the cluster. You can add several
servers, by default each server will have a <span class="target" id="index-4"></span>weight of 1, and each
session will choose a server randomly according to the weight. You can
set a weight for each server like this (weight can be an integer or
a float):</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;servers&gt;</span>
  <span class="nt">&lt;server</span> <span class="na">host=</span><span class="s">&quot;server1&quot;</span> <span class="na">port=</span><span class="s">&quot;80&quot;</span> <span class="na">type=</span><span class="s">&quot;tcp&quot;</span> <span class="na">weight=</span><span class="s">&quot;4&quot;</span><span class="nt">&gt;&lt;/server&gt;</span>
  <span class="nt">&lt;server</span> <span class="na">host=</span><span class="s">&quot;server2&quot;</span> <span class="na">port=</span><span class="s">&quot;80&quot;</span> <span class="na">type=</span><span class="s">&quot;tcp&quot;</span> <span class="na">weight=</span><span class="s">&quot;1&quot;</span><span class="nt">&gt;&lt;/server&gt;</span>
<span class="nt">&lt;/servers&gt;</span>
</pre></div>
</div>
<p>(in version older than <strong>1.5.0</strong>, the <tt class="docutils literal"><span class="pre">weight</span></tt> option was
not implemented and a round robin algorithm was used to choose the
server).</p>
<p><em>Type</em> can be <tt class="docutils literal"><span class="pre">tcp</span></tt>, <tt class="docutils literal"><span class="pre">ssl</span></tt>,
<tt class="docutils literal"><span class="pre">udp</span></tt> (for IPv6, use <tt class="docutils literal"><span class="pre">tcp6</span></tt>, <tt class="docutils literal"><span class="pre">ssl6</span></tt> or
<tt class="docutils literal"><span class="pre">udp6</span></tt> ; only available in  version <strong>1.4.2</strong> and newer)
or <tt class="docutils literal"><span class="pre">websocket</span></tt> (only available in version <strong>1.5.0</strong> and newer))</p>
</div>
<div class="section" id="advanced-setup">
<span id="index-5"></span><h2>6.2.2. Advanced setup<a class="headerlink" href="#advanced-setup" title="Permalink to this headline"></a></h2>
<p>The next example is more complex, and use several features for
advanced distributed testing:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;clients&gt;</span>
  <span class="nt">&lt;client</span> <span class="na">host=</span><span class="s">&quot;louxor&quot;</span> <span class="na">weight=</span><span class="s">&quot;1&quot;</span> <span class="na">maxusers=</span><span class="s">&quot;800&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;ip</span> <span class="na">value=</span><span class="s">&quot;10.9.195.12&quot;</span><span class="nt">&gt;&lt;/ip&gt;</span>
    <span class="nt">&lt;ip</span> <span class="na">value=</span><span class="s">&quot;10.9.195.13&quot;</span><span class="nt">&gt;&lt;/ip&gt;</span>
  <span class="nt">&lt;/client&gt;</span>
  <span class="nt">&lt;client</span> <span class="na">host=</span><span class="s">&quot;memphis&quot;</span> <span class="na">weight=</span><span class="s">&quot;3&quot;</span> <span class="na">maxusers=</span><span class="s">&quot;600&quot;</span> <span class="na">cpu=</span><span class="s">&quot;2&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/clients&gt;</span>

<span class="nt">&lt;servers&gt;</span>
  <span class="nt">&lt;server</span> <span class="na">host=</span><span class="s">&quot;10.9.195.1&quot;</span> <span class="na">port=</span><span class="s">&quot;8080&quot;</span> <span class="na">type=</span><span class="s">&quot;tcp&quot;</span><span class="nt">&gt;&lt;/server&gt;</span>
<span class="nt">&lt;/servers&gt;</span>
</pre></div>
</div>
<p id="index-6">Several virtual IP can be used to simulate more machines. This is
very useful when a load-balancer use the client&#8217;s IP to
distribute the traffic among a cluster of servers. <strong>New in 1.1.1</strong>:
IP is no longer mandatory. If not specified, the default IP will be
used.</p>
<p><strong>New in 1.4.0:</strong> You can use <tt class="docutils literal"><span class="pre">&lt;ip</span> <span class="pre">scan=&quot;yes&quot;</span> <span class="pre">value=&quot;eth0&quot;/&gt;</span></tt> to scan for all the IP aliases on a given interface
(<tt class="docutils literal"><span class="pre">eth0</span></tt> in this example).</p>
<p>In this example, a second machine is used in the Tsung cluster,
with a higher weight, and 2 cpus. Two Erlang virtual machines will be
used to take advantage of the number of CPU.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Even if an Erlang VM is now able to handle several CPUs
(erlang SMP), benchmarks shows that it&#8217;s more efficient to use one VM
per CPU (with SMP disabled) for tsung clients. Only the controller node is using SMP
erlang. Therefore, <tt class="docutils literal"><span class="pre">cpu</span></tt> should be equal to the number of cores of
your nodes. If you prefer to use erlang SMP, add the <tt class="docutils literal"><span class="pre">-s</span></tt>
option when starting tsung (and don&#8217;t set <tt class="docutils literal"><span class="pre">cpu</span></tt> in the config
file).</p>
</div>
<p>By default, the load is distributed uniformly on all CPU (one CPU
per client by default). The weight parameter (integer) can be used to
take into account the speed of the client machine. For instance, if
one real client has a weight of 1 and the other client has a weight
of 2, the second one will start twice the number of users as the
first (the proportions will be 1/3 and 2/3). In the earlier example
where for the second client has 2 CPU and weight=3, the weight is
equal to 1.5 for each CPU.</p>
<div class="section" id="maxusers">
<span id="maxusers-label"></span><span id="index-7"></span><h3>6.2.2.1. maxusers<a class="headerlink" href="#maxusers" title="Permalink to this headline"></a></h3>
<p>The <tt class="docutils literal"><span class="pre">maxusers</span></tt> parameter is used to bypass the limit of maximum
number of sockets opened by a single process (1024 by default on many
OS) and the lack of scalability of the <tt class="docutils literal"><span class="pre">select</span></tt> system call. When
the number of users is higher than the limit, a new erlang virtual
machine will be started to handle new users. The default value of
<tt class="docutils literal"><span class="pre">maxusers</span></tt> is 800. Nowadays, with kernel polling enable, you can and
should use a very large value for <tt class="docutils literal"><span class="pre">maxusers</span></tt> (30000 for example)
without performance penalty (but don&#8217;t forget to raise the limit of
the OS with <strong class="command">ulimit -n</strong>, see also <a class="reference internal" href="faq.html#faq-emfile-label"><em>Why do i have error_connect_emfile errors?</em></a>).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you are using a tsung master with slaves, the master
distributes sessions to slaves. If a session contains multiples requests,
a slave will execute each of these requests in order.</p>
</div>
</div>
</div>
<div class="section" id="running-tsung-with-a-job-scheduler">
<h2>6.2.3. Running Tsung with a job scheduler<a class="headerlink" href="#running-tsung-with-a-job-scheduler" title="Permalink to this headline"></a></h2>
<p id="index-8">Tsung is able to get its client node list from a batch/job
<span class="target" id="index-9"></span>scheduler. It currently handle PBS/torque, LSF and OAR. To do this,
set the <tt class="docutils literal"><span class="pre">type</span></tt> attribute to <tt class="docutils literal"><span class="pre">batch</span></tt>, e.g.:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;client</span> <span class="na">type=</span><span class="s">&quot;batch&quot;</span> <span class="na">batch=</span><span class="s">&quot;torque&quot;</span> <span class="na">maxusers=</span><span class="s">&quot;30000&quot;</span><span class="nt">&gt;</span>
</pre></div>
</div>
<p id="index-10">If you need to scan IP aliases on nodes given by the batch scheduler,
use <em>scan_intf</em> like this:</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt">&lt;client</span> <span class="na">type=</span><span class="s">&quot;batch&quot;</span> <span class="na">batch=</span><span class="s">&quot;torque&quot;</span> <span class="na">scan_intf=</span><span class="s">&#39;eth0&#39;</span> <span class="na">maxusers=</span><span class="s">&quot;30000&quot;</span><span class="nt">&gt;</span>
</pre></div>
</div>
</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.2. Clients and server</a><ul>
<li><a class="reference internal" href="#basic-setup">6.2.1. Basic setup</a></li>
<li><a class="reference internal" href="#advanced-setup">6.2.2. Advanced setup</a><ul>
<li><a class="reference internal" href="#maxusers">6.2.2.1. maxusers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-tsung-with-a-job-scheduler">6.2.3. Running Tsung with a job scheduler</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="conf-file.html"
                        title="previous chapter">6.1. File structure</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="conf-monitoring.html"
                        title="next chapter">6.3. Monitoring</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/conf-client-server.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-monitoring.html" title="6.3. Monitoring"
             >next</a> |</li>
        <li class="right" >
          <a href="conf-file.html" title="6.1. File structure"
             >previous</a> |</li>
        <li><a href="index.html">Tsung 1.5.1 documentation</a> &raquo;</li>
          <li><a href="configuration.html" >6. Understanding tsung.xml configuration file</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2013, Nicolas Niclausse.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
    </div>
  </body>
</html>