-
Notifications
You must be signed in to change notification settings - Fork 405
/
user_manual.html
3292 lines (3193 loc) · 189 KB
/
user_manual.html
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Tsung User's manual
</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META name="GENERATOR" content="hevea 1.10">
<STYLE type="text/css">
.li-itemize{margin:1ex 0ex;}
.li-enumerate{margin:1ex 0ex;}
.dd-description{margin:0ex 0ex 1ex 4ex;}
.dt-description{margin:0ex;}
.toc{list-style:none;}
.thefootnotes{text-align:left;margin:0ex;}
.dt-thefootnotes{margin:0em;}
.dd-thefootnotes{margin:0em 0em 0em 2em;}
.footnoterule{margin:1em auto 1em 0px;width:50%;}
.caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
.title{margin:2ex auto;text-align:center}
.center{text-align:center;margin-left:auto;margin-right:auto;}
.flushleft{text-align:left;margin-left:0ex;margin-right:auto;}
.flushright{text-align:right;margin-left:auto;margin-right:0ex;}
DIV TABLE{margin-left:inherit;margin-right:inherit;}
PRE{text-align:left;margin-left:0ex;margin-right:auto;}
BLOCKQUOTE{margin-left:4ex;margin-right:4ex;text-align:left;}
TD P{margin:0px;}
.boxed{border:1px solid black}
.textboxed{border:1px solid black}
.vbar{border:none;width:2px;background-color:black;}
.hbar{border:none;height:2px;width:100%;background-color:black;}
.hfill{border:none;height:1px;width:200%;background-color:black;}
.vdisplay{border-collapse:separate;border-spacing:2px;width:auto; empty-cells:show; border:2px solid red;}
.vdcell{white-space:nowrap;padding:0px;width:auto; border:2px solid green;}
.display{border-collapse:separate;border-spacing:2px;width:auto; border:none;}
.dcell{white-space:nowrap;padding:0px;width:auto; border:none;}
.dcenter{margin:0ex auto;}
.vdcenter{border:solid #FF8000 2px; margin:0ex auto;}
.minipage{text-align:left; margin-left:0em; margin-right:auto;}
.marginpar{border:solid thin black; width:20%; text-align:left;}
.marginparleft{float:left; margin-left:0ex; margin-right:1ex;}
.marginparright{float:right; margin-left:1ex; margin-right:0ex;}
.theorem{text-align:left;margin:1ex auto 1ex 0ex;}
.part{margin:2ex auto;text-align:center}
</STYLE>
<style type="text/css">
<!--
body {font-size: 90%; margin-right:40px; margin-left:40px; font-family:Sans-Serif; color:#000000; background-color:#ffffff;}
p, .n {font-size: 90%; font-family:Sans-Serif; color:#000000; background-color:#ffffff;}
h1 {font-size: 200%; color:#800000; background-color:#ffffff;}
h2 {font-size:150%; color:#000080; background-color:#ffffff;}
h3 {font-family:Sans-Serif; font-size: 120%; font-weight:bold; color:#000080; background-color:#ffffff;}
h4 {font-family:Sans-Serif; font-size:100%; font-weight:bold; color:#000080; background-color:#ffffff;}
h5 {font-family:Sans-Serif; font-size:100%; font-weight:bold; color:#000000; background-color:#ffffff; margin-bottom: 0;}
form {margin-bottom:-5px;}
textarea {color:#333333; background-color:#ffffff; width:90%;}
table {font-size:90%;}
dl,ul,ol {margin-top: 2pt; margin-bottom: 2pt;}
tt, pre {font-family:monospace; color:#666666; background-color:#ffffff;}
pre {
background-color: #ffffee;
white-space:pre;
border-style:solid;
border-width:thin;
border-color:#999999;
color:#333333;
// padding:3px;
margin-bottom: -1pt;
width:100%;
}
a:link {color:#800000; background-color: #ffffff;}
a:visited {color:#006600; background-color: #ffffff;}
a:active {color:green; background-color: #ffffff;}
a:hover {background:#ffffaa;}
.piedpage, .entete {
font-family:Sans-Serif; font-size:90%; font-style:italic; color:#0000ff; background-color: #ffffff;
text-align: center;
}
-->
</style>
</HEAD>
<BODY >
<!--HEVEA command line is: hevea -fix -I ./styles -exec xxdate.exe -pedantic TSUNG.hva user_manual.tex -->
<!--HTMLHEAD-->
<DIV class="entete">
<A href="http://tsung.erlang-projects.org/">http://tsung.erlang-projects.org/</A>
</DIV>
<HR>
<!--ENDHTML-->
<!--CUT DEF section 1 --><H1 ALIGN=center>Tsung User’s manual</H1><DIV CLASS="center">
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Version:</TD><TD ALIGN=left NOWRAP>1020</TD></TR>
<TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Date :</TD><TD ALIGN=left NOWRAP>30 juin 2009</TD></TR>
</TABLE>
</DIV><!--TOC section Table des matières-->
<H2 CLASS="section"><!--SEC ANCHOR -->Table des matières</H2><!--SEC END --><UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc1">1 Introduction</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc2">1.1 What is Tsung ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc3">1.2 What is Erlang and why is it important for Tsung ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc4">1.3 Tsung background</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc5">2 Features</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc6">2.1 Tsung main features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc7">2.2 HTTP related features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc8">2.3 WEBDAV related features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc9">2.4 Jabber/XMPP related features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc10">2.5 PostgreSQL related features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc11">2.6 MySQL related features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc12">2.7 LDAP related features</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc13">2.8 Complete reports set</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc14">2.9 Highlights</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc15">3 Installation</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc16">3.1 Dependencies</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc17">3.2 Compilation</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc18">3.3 Configuration</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc19">3.4 Running</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc20">3.5 Feedback</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc21">4 Benchmark approach</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc22">4.1 HTTP/WebDAV benchmark approach</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc23">4.1.1 Benchmarking a Web server</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc24">4.1.2 WEBDAV </A>
</LI><LI CLASS="li-toc"><A HREF="#htoc25">4.1.3 Benchmarking a proxy server</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc26">4.2 LDAP benchmark approach</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc27">4.3 PostgreSQL benchmark approach</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc28">4.4 MySQL benchmark approach</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc29">4.5 Jabber/XMPP benchmark approach</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc30">4.5.1 Overview</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc31">4.5.2 Acknowledgments of messages</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc32">4.5.3 Status: Offline, Connected and Online</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc33">4.5.4 Authentication</A>
</LI></UL>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc34">5 Using the proxy recorder</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc35">5.1 PostgreSQL</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc36">5.2 HTTP and WEBDAV</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc37">6 Understanding tsung.xml configuration file</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc38">6.1 File structure</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc39">6.2 Clients and server</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc40">6.3 Monitoring</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc41">6.3.1 Erlang</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc42">6.3.2 SNMP</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc43">6.3.3 Munin</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc44">6.4 Defining the load progression</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc45">6.4.1 Randomly generated users</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc46">6.4.2 Statically generated users</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc47">6.5 Setting options</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc48">6.5.1 Jabber options</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc49">6.5.2 HTTP options</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc50">6.6 Sessions</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc51">6.6.1 Thinktimes</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc52">6.6.2 HTTP</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc53">6.6.3 Jabber/XMPP</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc54">6.6.4 PostgreSQL</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc55">6.6.5 MySQL</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc56">6.6.6 LDAP</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc57">6.7 Advanced features</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc58">6.7.1 Dynamic substitutions</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc59">6.7.2 Reading external file</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc60">6.7.3 Dynamic variables</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc61">6.7.4 Checking the server’s response</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc62">6.7.5 Loops, If</A>
</LI></UL>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc63">7 Statistics and reports</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc64">7.1 Available stats</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc65">7.2 Design</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc66">7.3 Generating the report</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc67">7.4 Tsung summary</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc68">7.5 Graphical overview</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc69">7.6 Tsung Plotter</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc70">7.7 RRD</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc71">8 References</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc72">9 Acknowledgments</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc73">A Frequently Asked Questions</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc74">A.1 Can’t start distributed clients: timeout error </A>
</LI><LI CLASS="li-toc"><A HREF="#htoc75">A.2 Tsung crashes when I start it </A>
</LI><LI CLASS="li-toc"><A HREF="#htoc76">A.3 Why do i have error_connect_emfile errors ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc77">A.4 Tsung still crashes/fails when I start it !</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc78">A.5 Can I dynamically follow redirect with HTTP ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc79">A.6 What is the format of the stats file tsung.log ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc80">A.7 How can I compute percentile/quartiles/median for transactions or requests
response time ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc81">A.8 How can I specify the number of concurrent users ?</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc82">A.9 SNMP monitoring doesn’t work ?!</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc83">B Errors list</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc84">C CHANGELOG</A>
</LI></UL><!--TOC section Introduction-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc1">1</A> Introduction</H2><!--SEC END --><!--TOC subsection What is Tsung ?-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc2">1.1</A> What is Tsung ?</H3><!--SEC END --><P><EM>Tsung</EM> (formerly IDX-Tsunami) is a distributed load testing tool. It is
protocol-independent and can currently be used to stress HTTP, WebDAV, SOAP,
PostgreSQL, MySQL, LDAP, and Jabber/XMPP servers.</P><P>It is distributed under the GNU General Public License version 2.</P><!--TOC subsection What is Erlang and why is it important for Tsung ?-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc3">1.2</A> What is Erlang and why is it important for Tsung ?</H3><!--SEC END --><P><EM>Tsung’s</EM> main strength is its ability to simulate a huge number of
simultaneous user from a single CPU. When used on cluster you can
generate a really impressive load on a server with a modest cluster,
easy to set-up and to maintain.</P><P><EM>Tsung</EM> is developed in Erlang and this is where the power
of <EM>Tsung</EM> resides.</P><P>Erlang is a <EM>concurrency-oriented</EM> programming language.
Tsung is based on the Erlang OTP (Open Transaction Platform) and
inherits several characteristics from Erlang:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>Performance</EM>: Erlang has been made to support hundred thousands
of lightweight processes in a single virtual machine.
</LI><LI CLASS="li-itemize"><EM>Scalability</EM>: Erlang runtime environment is naturally
distributed, promoting the idea of process’s location transparency.
</LI><LI CLASS="li-itemize"><EM>Fault-tolerance</EM>:Erlang has been built to develop robust,
fault-tolerant systems. As such, wrong answer sent from the server
to <EM>Tsung</EM> does not make the whole running benchmark crash.
</LI></UL><P>More information on Erlang on <A HREF="http://www.erlang.org"><TT>http://www.erlang.org</TT></A> and
<A HREF="http://www.erlang-projects.org/"><TT>http://www.erlang-projects.org/</TT></A></P><!--TOC subsection Tsung background-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc4">1.3</A> Tsung background</H3><!--SEC END --><P>History:
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>Tsung</EM> development was started by Nicolas Niclausse in
2001 as a distributed jabber load stress tool for internal use at
<A HREF="http://IDEALX.com/"><TT>http://IDEALX.com/</TT></A>. It has evolved as an open-source
multi-protocol load testing tool several months later. The HTTP
support was added in 2003, and this tool has been used for several
industrial projects. It is now hosted by Erlang-projects, and
supported by <A HREF="http://process-one.net/"><TT>http://process-one.net/</TT></A>. The list of contributors
is available in the source archive
(<A HREF="https://svn.process-one.net/tsung/trunk/CONTRIBUTORS"><TT>https://svn.process-one.net/tsung/trunk/CONTRIBUTORS</TT></A>).</LI><LI CLASS="li-itemize">It is an industrial strength implementation of a <EM>stochastic model</EM>
for real users simulation. User events distribution is based on a
Poisson Process. More information on this topic in:<P>Z. Liu, N. Niclausse, and C. Jalpa-Villanueva. <B>Traffic Model
and Performance Evaluation of Web Servers</B>. <EM>Performance Evaluation,
Volume 46, Issue 2-3, October 2001</EM>.</P></LI><LI CLASS="li-itemize">This model has already been tested in the INRIA <EM>WAGON</EM>
research prototype (Web trAffic GeneratOr and beNchmark). WAGON was
used in the <A HREF="http://www.vthd.org/"><TT>http://www.vthd.org/</TT></A> project (Very High Broadband
IP/WDM test platform for new generation Internet applications, 2000-2004).</LI></UL><P><EM>Tsung</EM> has been used for very high load tests:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>Jabber/XMPP</EM> protocol:
<UL CLASS="itemize"><LI CLASS="li-itemize">
90 000 simultaneous jabber users on a
4-node Tsung cluster (3xSun V240 + 1 Sun V440)
</LI><LI CLASS="li-itemize">10 000 simultaneous users.
<EM>Tsung</EM> was running on a 3-computers cluster (CPU
800MHz)
</LI></UL>
</LI><LI CLASS="li-itemize"><EM>HTTP and HTTPS</EM> protocol:
<UL CLASS="itemize"><LI CLASS="li-itemize">
12 000 simultaneous users.
<EM>Tsung</EM> were running on a 4-computers cluster. The
tested platform reached 3 000 requests per second.
</LI></UL>
</LI></UL><P><EM>Tsung</EM> has been used at:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>DGI</EM> (Direction Générale des impôts): French finance ministry
</LI><LI CLASS="li-itemize"><EM>Cap Gemini Ernst & Young</EM>
</LI><LI CLASS="li-itemize"><EM>IFP</EM> (Institut Français du Pétrole): French Research Organization
for Petroleum
</LI><LI CLASS="li-itemize"><EM>LibertySurf</EM>
</LI><LI CLASS="li-itemize">Sun™for their Mooddlerooms platform on Niagara processors:
<A HREF="http://blogs.sun.com/kevinr/resource/Moodle-Sun-RA.pdf"><TT>http://blogs.sun.com/kevinr/resource/Moodle-Sun-RA.pdf</TT></A>
</LI></UL><!--TOC section Features-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc5">2</A> Features</H2><!--SEC END --><!--TOC subsection Tsung main features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc6">2.1</A> Tsung main features</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>High Performance</EM>: <EM>Tsung</EM> can simulate a
huge number of simultaneous users per physical computer: It can
simulates thousands of users on a single CPU (Note: a simulated user
is not always active: it can be idle during a <TT>thinktime</TT>
period). Traditional injection tools can hardly go further than a
few hundreds (Hint: if all you want to do is requesting a single URL
in a loop, use <EM>ab</EM>; but if you want to build complex
scenarios with extended reports, <EM>Tsung</EM> is for you).
</LI><LI CLASS="li-itemize"><EM>Distributed</EM>: the load can be distributed on a cluster of
client machines
</LI><LI CLASS="li-itemize"><EM>Multi-Protocols</EM> using a plug-in system: HTTP (both standard
web traffic and SOAP), WebDAV, Jabber/XMPP and PostgreSQL are currently
supported. Experimental LDAP and MySQL plugins were included in the 1.3.0 release.
</LI><LI CLASS="li-itemize"><EM>SSL</EM> support
</LI><LI CLASS="li-itemize"><EM>Several IP addresses</EM> can be used on a single machine using
the underlying OS IP Aliasing
</LI><LI CLASS="li-itemize"><EM>OS monitoring</EM> (CPU, memory and network traffic) using Erlang
agents on remote servers or <EM>SNMP</EM>
</LI><LI CLASS="li-itemize"><EM>XML configuration system</EM>: complex user’s scenarios are written
in XML. Scenarios can be written with a simple browser using the
Tsung recorder (HTTP and PostgreSQL only).
</LI><LI CLASS="li-itemize"><EM>Dynamic scenarios</EM>: You can get dynamic data from the
server under load (without writing any code) and re-inject it in
subsequent requests. You can also loop, restart or stop a
session when a string (or regexp) matches the server response.
</LI><LI CLASS="li-itemize"><EM>Mixed behaviours</EM>: several sessions can be used to simulate
different type of users during the same benchmark. You can define
the proportion of the various behaviours in the benchmark scenario.
</LI><LI CLASS="li-itemize"><EM>Stochastic processes</EM>: in order to generate a realistic traffic,
user thinktimes and the arrival rate can be randomize using a probability
distribution (currently exponential)
</LI></UL><!--TOC subsection HTTP related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc7">2.2</A> HTTP related features</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
HTTP/1.0 and HTTP/1.1 support
</LI><LI CLASS="li-itemize">GET, POST, PUT, DELETE and HEAD requests
</LI><LI CLASS="li-itemize">Cookies: Automatic cookies management
</LI><LI CLASS="li-itemize"><CODE>'</CODE>GET If-modified since<CODE>'</CODE> type of request
</LI><LI CLASS="li-itemize">WWW-authentication Basic
</LI><LI CLASS="li-itemize">User Agent support
</LI><LI CLASS="li-itemize">Any HTTP Headers can be added
</LI><LI CLASS="li-itemize">Proxy mode to record sessions using a Web browser
</LI><LI CLASS="li-itemize">SOAP support using the HTTP mode (the SOAPAction HTTP header is
handled).
</LI><LI CLASS="li-itemize">HTTP server or proxy server load testing.
</LI></UL><!--TOC subsection WEBDAV related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc8">2.3</A> WEBDAV related features</H3><!--SEC END --><P>The WebDAV (RFC 4918) plugin is a superset of the HTTP plugin. It adds the
following features (some versionning extensions to WebDAV (RFC 3253)
are also supported):</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Methods implemented: DELETE, CONNECT, PROPFIND, PROPPATCH, COPY,
MOVE, LOCK, UNLOCK, MKCOL, REPORT, OPTIONS, MKACTIVITY, CHECKOUT, MERGE
</LI><LI CLASS="li-itemize">Recording of DEPTH, IF, TIMEOUT OVERWRITE, DESTINATION, URL and
LOCK-TOKEN Headers.
</LI></UL><!--TOC subsection Jabber/XMPP related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc9">2.4</A> Jabber/XMPP related features</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
Authentication (plain-text, digest and sip-digest)
</LI><LI CLASS="li-itemize">presence and register messages
</LI><LI CLASS="li-itemize">Chat messages to online or offline users
</LI><LI CLASS="li-itemize">MUC: join room, send message in room, change nickname
</LI><LI CLASS="li-itemize">Roster set and get requests
</LI><LI CLASS="li-itemize">Global users<CODE>'</CODE> synchronization can be set on specific actions
</LI><LI CLASS="li-itemize">raw XML messages
</LI></UL><!--TOC subsection PostgreSQL related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc10">2.5</A> PostgreSQL related features</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
Basic and MD5 Authentication
</LI><LI CLASS="li-itemize">Basic Queries (Extended queries not yet supported)
</LI><LI CLASS="li-itemize">Proxy mode to record sessions
</LI></UL><!--TOC subsection MySQL related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc11">2.6</A> MySQL related features</H3><!--SEC END --><P>
This plugin is experimental. It works only with MySQL version 4.1 and higher.
</P><UL CLASS="itemize"><LI CLASS="li-itemize">
Secured Authentication method only (MySQL >= 4.1)
</LI><LI CLASS="li-itemize">Basic Queries
</LI></UL><!--TOC subsection LDAP related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc12">2.7</A> LDAP related features</H3><!--SEC END --><P>
This plugin is experimental.</P><UL CLASS="itemize"><LI CLASS="li-itemize">
bind
</LI><LI CLASS="li-itemize">add, modify and search queries
</LI><LI CLASS="li-itemize">starttls (only with R12B-0 Erlang and up)
</LI></UL><!--TOC subsection Complete reports set-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc13">2.8</A> Complete reports set</H3><!--SEC END --><P>Measures and statistics produced by Tsung are extremely feature-full.
They are all represented as a graphic. <EM>Tsung</EM> produces
statistics regarding:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>Performance</EM>: response time, connection time, decomposition of the user scenario based on request grouping instruction (called <I>transactions</I>), requests per second
</LI><LI CLASS="li-itemize"><EM>Errors</EM>: Statistics on page return code to trace errors
</LI><LI CLASS="li-itemize"><EM>Target server behaviour</EM>: An Erlang agent can gather information
from the target server(s). Tsung produces graphs for CPU and memory
consumption and network traffic. SNMP and munin is also supported to
monitor remote servers.
</LI></UL><P>Note that <EM>Tsung</EM> takes care of the synchronization process
by itself. Gathered statistics are «synchronized».</P><P>It is possible to generate graphs during the benchmark as statistics
are gathered in real-time.</P><!--TOC subsection Highlights-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc14">2.9</A> Highlights</H3><!--SEC END --><P><EM>Tsung</EM> has several advantages over other injection tools:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>High performance</EM> and <EM>distributed benchmark</EM>: You
can use Tsung to simulate tens of thousands of virtual users.
</LI><LI CLASS="li-itemize"><EM>Ease of use</EM>: The hard work is already done for all supported
protocol. No need to write complex scripts. Dynamic scenarios only
requires small trivial piece of code.
</LI><LI CLASS="li-itemize"><EM>Multi-protocol support</EM>: <EM>Tsung</EM> is for example one of
the only tool to benchmark SOAP applications
</LI><LI CLASS="li-itemize"><EM>Monitoring</EM> of the target server(s) to analyze the behaviour
and find bottlenecks. For example, it has been used to analyze cluster
symmetry (is the load properly balanced ?) and to determine the best
combination of machines on the three cluster tiers (Web engine, EJB
engine and database)
</LI></UL><!--TOC section Installation-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc15">3</A> Installation</H2><!--SEC END --><P>This package has been tested on Linux, FreeBSD and Solaris. A port is
available on MacOS X. It should
work on Erlang supported platforms (Linux, Solaris, *BSD, Win32 and
MacOS-X).</P><!--TOC subsection Dependencies-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc16">3.1</A> Dependencies</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
Erlang/OTP R10B-0 and up
(<A HREF="http://www.erlang.org/download.html"><TT>http://www.erlang.org/download.html</TT></A>). Erlang is now
part of fedora and debian/ubuntu repositories.
</LI><LI CLASS="li-itemize">extended regexp module (used for dynamic variables):
gregexp.erl available at
<A HREF="http://www.cellicium.com/erlang/contribs/"><TT>http://www.cellicium.com/erlang/contribs/</TT></A> . The module is
included in the source and binary distribution of <EM>Tsung</EM>. It
is released under the EPL License.
</LI><LI CLASS="li-itemize">pgsql module made by Christian Sunesson (for the PostgreSQL plugin):
sources available at
<A HREF="http://jungerl.sourceforge.net/"><TT>http://jungerl.sourceforge.net/</TT></A> . The module is
included in the source and binary distribution of <EM>Tsung</EM>. It
is released under the EPL License.
</LI><LI CLASS="li-itemize">mysql module made by Magnus Ahltorp & Fredrik Thulin (for the mysql plugin):
sources available at
<A HREF="http://www.stacken.kth.se/projekt/yxa/"><TT>http://www.stacken.kth.se/projekt/yxa/</TT></A> . The modified module is
included in the source and binary distribution of <EM>Tsung</EM>. It
is released under the three-clause BSD License.
</LI><LI CLASS="li-itemize">eldap module (for the LDAP plugin):
sources available at
<A HREF="http://jungerl.sourceforge.net/"><TT>http://jungerl.sourceforge.net/</TT></A> . The module is
included in the source and binary distribution of <EM>Tsung</EM>. It
is released under the GPL License.
</LI><LI CLASS="li-itemize">mochiweb libs (for xpath parsing, optionally used for dynamic variables in
the HTTP plugin):
sources available at
<A HREF="http://code.google.com/p/mochiweb/"><TT>http://code.google.com/p/mochiweb/</TT></A> . The module is
included in the source and binary distribution of <EM>Tsung</EM>. It
is released under the MIT License.
</LI><LI CLASS="li-itemize">gnuplot and perl5 (optional; for graphical output with
<TT>tsung_stats.pl</TT> script). The Template Toolkit is used for HTML
reports (see <A HREF="http://template-toolkit.org/"><TT>http://template-toolkit.org/</TT></A>)
</LI><LI CLASS="li-itemize">python and mathplotlib (optional; for graphical output with
<TT>tsung-plotter</TT>).
</LI><LI CLASS="li-itemize">for distributed tests, you need an ssh access to remote
machines without password (use a RSA/DSA key without pass-phrase or
ssh-agent) (rsh is also supported)
</LI><LI CLASS="li-itemize">bash
</LI></UL><!--TOC subsection Compilation-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc17">3.2</A> Compilation</H3><!--SEC END --><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim">./configure
make
make install
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC subsection Configuration-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc18">3.3</A> Configuration</H3><!--SEC END --><P>The default configuration file is <TT>~/.tsung/tsung.xml</TT> (
there are several sample files in
<TT>/usr/share/doc/tsung/examples</TT>).</P><P>Log files are saved in <TT>~/.tsung/log/</TT> . A new sub-directory
is created for each test using the current date as name
(<TT>~/.tsung/log/20040217-09:40</TT> for ex.)</P><!--TOC subsection Running-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc19">3.4</A> Running</H3><!--SEC END --><P>Two commands are installed in the directory <TT>$PREFIX/bin</TT>:
<TT>tsung</TT> and <TT>tsung-recorder</TT>. A man page is available
for both commands.</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim">>tsung -h
Usage: tsung <options> start|stop|debug|status
Options:
-f <file> set configuration file (default is ~/.tsung/tsung.xml)
-l <logfile> set log file (default is ~/.tsung/log/tsung.log)
-i <id> set controller id (default is empty)
-r <command> set remote connector (default is ssh)
-F use long names (FQDN) for erlang nodes
-v print version information and exit
-h display this help and exit
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>A typical way of using tsung is to run:
<TT>tsung -f myconfigfile.xml start</TT>.</P><P>The command will print the current log directory created for the test, and wait until the test is
over.</P><!--TOC subsection Feedback-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc20">3.5</A> Feedback</H3><!--SEC END --><P>Use the Tsung mailing list (see
<A HREF="https://lists.process-one.net/mailman/listinfo/tsung-users"><TT>https://lists.process-one.net/mailman/listinfo/tsung-users</TT></A>) if you have
suggestions or questions about <EM>Tsung</EM>. You can also use the
bug-tracker available at <A HREF="https://support.process-one.net/browse/TSUN"><TT>https://support.process-one.net/browse/TSUN</TT></A>.
You can also try the #tsung IRC channel on Freenode.</P><!--TOC section Benchmark approach-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc21">4</A> Benchmark approach</H2><!--SEC END --><!--TOC subsection HTTP/WebDAV benchmark approach-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc22">4.1</A> HTTP/WebDAV benchmark approach</H3><!--SEC END --><!--TOC subsubsection Benchmarking a Web server-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc23">4.1.1</A> Benchmarking a Web server</H4><!--SEC END --><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
Record one or more sessions: start the recorder with:
<TT>tsung-recorder start</TT>, and then configure your browser to use Tsung
proxy recorder (the listen port is 8090). A session file will be
created. For HTTPS recording, use <FONT COLOR=purple>http://ssl-</FONT> instead of
<FONT COLOR=purple>https://</FONT> in your browser.
</LI><LI CLASS="li-enumerate">Edit / organize scenario, by adding recorded sessions in the
configuration file.
</LI><LI CLASS="li-enumerate">Write small code for dynamic parts if needed and place dynamic mark-up
in the scenario.
</LI><LI CLASS="li-enumerate">Test and adjust scenario to have a nice progression of the load. This
is highly dependent of the application and of the size of the target
server(s). Calculate the normal duration of the scenario and use the
interarrival time between users and the duration of the phase to estimate
the number of simultaneous users for each given phase.
</LI><LI CLASS="li-enumerate">Launch benchmark with your first application parameters set-up:
<TT>tsung start</TT> (run <TT>man tsung</TT> for more options)
</LI><LI CLASS="li-enumerate">Wait for the end of the test or stop by hand with
<TT>tsung stop</TT> (reports can also be generated during the
test (see § <A HREF="#sec:statistics-reports">7</A>) : the statistics are
updated every 10 seconds). For a brief summary of the current
activity, use <TT>tsung status</TT>
</LI><LI CLASS="li-enumerate">Analyze results, change parameters and relaunch another benchmark
</LI></OL><!--TOC subsubsection WEBDAV -->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc24">4.1.2</A> WEBDAV </H4><!--SEC END --><P>It’s the same approach as HTTP: first you start to record one or more
sessions with the recorder:
<TT>tsung-recorder -p webdav start</TT></P><!--TOC subsubsection Benchmarking a proxy server-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc25">4.1.3</A> Benchmarking a proxy server</H4><!--SEC END --><P>By default, the HTTP plugin is used to benchmark HTTP servers. But you
can also benchmark HTTP Proxy servers. To do that, you must add in the
<TT>options</TT> section:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <option type="ts_http" name="http_use_server_as_proxy" value="true"></option>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC subsection LDAP benchmark approach-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc26">4.2</A> LDAP benchmark approach</H3><!--SEC END --><P>An LDAP plugin for the recorder is not yet implemented, so you have to
write the session by yourself; see section <A HREF="#sec:session:ldap">6.6.6</A> for
more information.</P><!--TOC subsection PostgreSQL benchmark approach-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc27">4.3</A> PostgreSQL benchmark approach</H3><!--SEC END --><P>It’s the same approach as HTTP: first you start to record one or more
sessions with the recorder:
<TT>tsung-recorder -p pgsql start</TT></P><P>This will start a proxy listening to port 8090 and will proxy requests
to 127.0.0.0:5432.</P><P>To choose another port and/or address:
<TT>tsung-recorder -L 5432 -I 10.6.1.1 -P 5433 -p pgsql start</TT></P><P>This will start a proxy listening to port 5432 and will proxy requests
to 10.6.1.1:5433.</P><!--TOC subsection MySQL benchmark approach-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc28">4.4</A> MySQL benchmark approach</H3><!--SEC END --><P>A MySQL plugin for the recorder is not yet implemented, so you have to
write the session by yourself; see section <A HREF="#sec:session:mysql">6.6.5</A> for
more information.</P><!--TOC subsection Jabber/XMPP benchmark approach-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc29">4.5</A> Jabber/XMPP benchmark approach</H3><!--SEC END --><!--TOC subsubsection Overview-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc30">4.5.1</A> Overview</H4><!--SEC END --><P>This paragraph explains how to write a session for Jabber/XMPP.</P><P>There are two differences between HTTP and Jabber testing:
</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
There is no recorder for Jabber, so you have to write your
sessions by hand (an example is provided in
<A HREF="#sec:sessions:jabber">6.6.3</A>).
</LI><LI CLASS="li-enumerate">the jabber plugin does not parse XML; instead it uses packet
acknowledgments.
</LI></OL><!--TOC subsubsection Acknowledgments of messages-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc31">4.5.2</A> Acknowledgments of messages</H4><!--SEC END --><P>Since the jabber plugin does not parse XML (historically, it was for
performance reasons), you must have a way to tell when a request is
finished. There are 3 possibilities:</P><DL CLASS="description"><DT CLASS="dt-description">
<B>ack=local</B></DT><DD CLASS="dd-description"> as soon as a packet is received from the server, the
request is considered as completed. Hence if you use a local ack with a request
that do not require a response from the server (presence for ex.), it
will wait forever (or until a timeout is reached).
</DD><DT CLASS="dt-description"><B>ack=no_ack</B></DT><DD CLASS="dd-description"> as soon as the request is send, it is considered as completed (do
not wait for incoming data)
</DD><DT CLASS="dt-description"><B>ack=global</B></DT><DD CLASS="dd-description"> synchronized users. its main use is for waiting for all
users to connect before sending messages. To do that, set a request
with global ack (it can be the first presence msg:<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <request> <jabber type="presence" ack="global"/> </request>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>You also have to specify the number of users to be connected:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"><option type="ts_jabber" name="global_number" value="100"></option>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>To be sure that exactly <TT>global_number</TT> users are started, add the
<FONT COLOR=purple>’maxnumber’</FONT> attribute to <TT>’users’</TT></P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <users maxnumber="100" interarrival="1.0" unit="second"></users>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>If you do not specify <TT>maxnumber</TT>, the global ack will be reset every
<TT>global_number</TT> users
</P></DD></DL><P><A NAME="bidi:presence"></A>
<B>New in 1.2.2:</B> This version adds an new option for a
session. if you set the attribute <TT>bidi</TT> (for bidirectional)
in the <TT>session</TT> tag: <FONT COLOR=purple><session ... bidi=’true’></FONT>,
then incoming messages from the server will be analyzed. Currently,
only roster subscription requests are handled: if a user received a
subscription request (<FONT COLOR=purple><presence ... type=’subscribe’></FONT>), it
will respond with a <FONT COLOR=purple><presence ... type=’subscribed’></FONT>
message.</P><!--TOC subsubsection Status: Offline, Connected and Online-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc32">4.5.3</A> Status: Offline, Connected and Online</H4><!--SEC END --><P>You can send messages to offline or online users. A user is considered
online when he has send a <FONT COLOR=purple>presence:initial</FONT> message (before
this message , the state of the user is <TT>connected</TT>).</P><P>If you want to switch back to <TT>connected</TT> before going
<TT>offline</TT>, you can use a <FONT COLOR=purple>presence:final</FONT> message:</P><P><FONT COLOR=purple>presence:final</FONT> does two things:
</P><OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
It removes the client from the list of Online users, and moves
them into the list of Connected users.
</LI><LI CLASS="li-enumerate">It sends a broadcast presence update of type=’unavailable’.
</LI></OL><P><FONT COLOR=purple>presence:final</FONT> is optional.</P><P><EM>warn:</EM> this is new in <B>1.2.0</B>, in earlier version, only 2
status were available: online and offline; a user was considered
online as soon as it was connected.</P><!--TOC subsubsection Authentication-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc33">4.5.4</A> Authentication</H4><!--SEC END --><P>Below are configuration examples for the possible authentication
methods. Note: the regular expressions used here are only examples -
they may need to be altered depending on how a particular server
implementation composes messages (see also <A HREF="#sec:jabber-options">6.5.1</A>
for password settings).</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<B>plain authentication</B> - sends clear-text passwords:
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <session probability="100" name="jabber-plain" type="ts_jabber">
<request> <jabber type="connect" ack="local"></jabber> </request>
<thinktime value="2"></thinktime>
<transaction name="auth_plain">
<request> <jabber type="auth_get" ack="local"></jabber> </request>
<request> <jabber type="auth_set_plain" ack="local"></jabber> </request>
</transaction>
...
</session>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE></LI><LI CLASS="li-itemize"><B>digest authentication</B> as described in XMPP JEP-0078: Non-SASL Authentication
<A HREF="http://www.jabber.org/jeps/jep-0078.html"><TT>http://www.jabber.org/jeps/jep-0078.html</TT></A>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <session probability="100" name="jabber-digest" type="ts_jabber">
<!-- regexp captures stream ID returned by server -->
<request>
<dyn_variable name="sid" regexp="&lt;stream:stream id=&quot;\(.*\)&quot; xmlns:stream"/>
<jabber type="connect" ack="local"></jabber>
</request>
<thinktime value="2"></thinktime>
<transaction name="auth_digest">
<request> <jabber type="auth_get" ack="local"></jabber> </request>
<request subst='true'> <jabber type="auth_set_digest" ack="local"></jabber> </request>
</transaction>
...
</session>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE></LI><LI CLASS="li-itemize"><B>sip-digest authentication</B>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <session probability="100" name="jabber-sipdigest" type="ts_jabber">
<request> <jabber type="connect" ack="local"></jabber> </request>
<thinktime value="2"></thinktime>
<transaction name="auth_sipdigest">
<!-- regexp captures nonce value returned by server -->
<request>
<dyn_variable name="nonce"
regexp="&lt;Nonce encoding=&quot;hex&quot;&gt;\(.*\)&lt;\/Nonce&gt;"/>
<jabber type="auth_get" ack="local"></jabber>
</request>
<request subst='true'> <jabber type="auth_set_sip" ack="local"></jabber> </request>
</transaction>
...
</session>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE></LI></UL><!--TOC section Using the proxy recorder-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc34">5</A> Using the proxy recorder</H2><!--SEC END --><P>The recorder has three plugins: for HTTP, WebDAV and for PostgreSQL.</P><P>To start it, run <TT>tsung-recorder -p <PLUGIN> start</TT>, where <TT>PLUGIN</TT> can be
<FONT COLOR=purple>http</FONT>, <FONT COLOR=purple>webdav</FONT> or <FONT COLOR=purple>pgsql</FONT> for PostgreSQL. The default plugin is <FONT COLOR=purple>http</FONT>.</P><P>The proxy is listening to port 8090. You can change the port with
<FONT COLOR=purple>-L portnumber</FONT>.</P><P>To stop it, use <TT>tsung-recorder stop</TT>.</P><P>The recorded session is created as
<TT>~/.tsung/tsung_recorderYYYMMDD-HH:MM.xml</TT>; if it doesn’t work,
take a look at <TT>~/.tsung/log/tsung.log-tsung_recorder@hostname</TT></P><P>During the recording, you can add custom tag in the XML file, this can
be useful to set transactions or comments:
<TT>tsung-recorder record_tag "<transaction name=’login’>’’</TT></P><P>Once a session has been created, you can insert it in your main configuration
file, either by editing by hand the file, or by using an ENTITY
declaration, like:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"><!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [
<!ENTITY mysession1 SYSTEM "/home/nniclausse/.tsung/tsung_recorder20051217-13:11.xml">
]>
...
<sessions>
&mysession1;
</sessions>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC subsection PostgreSQL-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc35">5.1</A> PostgreSQL</H3><!--SEC END --><P>For PostgreSQL, the proxy will connect to the server at IP 127.0.0.1
and port 5432. Use <FONT COLOR=purple>-I serverIP</FONT> to change the IP and
<FONT COLOR=purple>-P portnumber</FONT> to change the port.</P><!--TOC subsection HTTP and WEBDAV-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc36">5.2</A> HTTP and WEBDAV</H3><!--SEC END --><P>For HTTPS recording, use <FONT COLOR=purple>http://ssl-</FONT> instead of
<FONT COLOR=purple>https://</FONT> in your browser</P><P><B>New in 1.2.2</B>: For HTTP, you can configure the recorder to
use a parent proxy (but this will not work for https). Add the -u
option to enable parent proxy, and use <FONT COLOR=purple>-I serverIP</FONT> to set
the IP and <FONT COLOR=purple>-P portnumber</FONT> to set the port of the parent.</P><!--TOC section Understanding tsung.xml configuration file-->
<H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc37">6</A> Understanding tsung.xml configuration file</H2><!--SEC END --><P>The default encoding is utf-8. You can use a different encoding, like in:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"><?xml version="1.0" encoding="ISO-8859-1"?>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC subsection File structure-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc38">6.1</A> File structure</H3><!--SEC END --><P>Scenarios are enclosed into Tsung tags:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"><?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info">
...
</tsung>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>If you add the attribute <FONT COLOR=purple>dumptraffic="true"</FONT>, all the
traffic will be logged to a file. <EM>Warn:</EM> this will considerably
slow down Tsung, so use with care. It is useful for debugging
purpose. You can use the attribute <FONT COLOR=purple>dumptraffic="light"</FONT> to
dump only the first 44 bytes.</P><P>The <TT>loglevel</TT> can also have a great impact on performance:
For high load, <FONT COLOR=purple>warning</FONT> is recommended.
Possible values are:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
emergency
</LI><LI CLASS="li-itemize">critical
</LI><LI CLASS="li-itemize">error
</LI><LI CLASS="li-itemize">warning
</LI><LI CLASS="li-itemize">notice (default)
</LI><LI CLASS="li-itemize">info
</LI><LI CLASS="li-itemize">debug
</LI></UL><P>For REALLY verbose logging, recompile tsung with <TT>make debug</TT>
and set <TT>loglevel</TT> to <FONT COLOR=purple>debug</FONT>.</P><!--TOC subsection Clients and server-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc39">6.2</A> Clients and server</H3><!--SEC END --><P>Scenarios start with clients (Tsung cluster) and server definitions:</P><P>For non distributed load, you can use a basic setup like:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <clients>
<client host="localhost" use_controller_vm="true"/>
</clients>
<servers>
<server host="192.168.1.1" port="80" type="tcp"></server>
</servers>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><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 (<B>New in 1.2.0:</B>
if several servers are defined, a round robin algorithm is used to
choose the server).</P><P>The next example is more complex, and use several features for
advanced distributed testing:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <clients>
<client host="louxor" weight="1" maxusers="800">
<ip value="10.9.195.12"></ip>
<ip value="10.9.195.13"></ip>
</client>
<client host="memphis" weight="3" maxusers="600" cpu="2"/>
</clients>
<servers>
<server host="10.9.195.1" port="8080" type="tcp"></server>
</servers>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>Several virtual IP can be used to simulate more machines. This is
very useful when a load-balancer use the client<CODE>'</CODE>s IP to
distribute the traffic among a cluster of servers. <B>New in
1.1.1:</B> IP is no longer mandatory. If not specified, the default IP will
be used.</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><BLOCKQUOTE CLASS="quote">
<B>Note:</B> Even if an Erlang VM is now able to handle severals CPUs
(erlang SMP), benchmarks shows that it’s more efficient to use one VM
per CPU (with SMP disabled) for tsung clients. Only the controller node is using SMP
erlang. Therefore, you cpu should be equal to the number of cores of
your nodes.
</BLOCKQUOTE><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><P>The <TT>maxusers</TT> parameter is used to bypass the limit of
maximum number of sockets opened by a single process (usually 1024)
and the lack of scalability of the <TT>select</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>maxusers</TT> is 800 . Nowadays, with kernel polling enable, you
can and should use a very large value for <TT>maxusers</TT> (30000 for example) without
performance penalty (but don’t forget to raise the limit of the OS with
<TT>ulimit -n</TT>, see also FAQ <A HREF="#sec:faq:emfile">A.3</A>).</P><!--TOC subsection Monitoring-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc40">6.3</A> Monitoring</H3><!--SEC END --><P>Tsung is able to monitor remote servers using several backends that
communicates with remote agent; This
is configured in the <TT><monitoring></TT> section. Available
statistics are: cpu activity, load average, memory usage.</P><P>Several types of remote agents are supported (<FONT COLOR=purple>erlang</FONT> is the default) :</P><!--TOC subsubsection Erlang-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc41">6.3.1</A> Erlang</H4><!--SEC END --><P>The remote agent is started by Tsung. It use erlang communications to
retrieve statistics of activity on the server. For example, here is a
cluster monitoring definition based on Erlang agents, for a cluster of
6 computers:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <monitoring>
<monitor host="geronimo" type="erlang"></monitor>
<monitor host="bigfoot-1" type="erlang"></monitor>
<monitor host="bigfoot-2" type="erlang"></monitor>
<monitor host="f14-1" type="erlang"></monitor>
<monitor host="f14-2" type="erlang"></monitor>
<monitor host="db" type="erlang"></monitor>
</monitoring>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>Note: monitored computers needs to be
accessible through the network, and erlang communications must be
allowed (no firewall is better ). SSH (or rsh) needs to be configured to
allow connection without password on. <B>You must use the same
version of Erlang/OTP on all nodes otherwise it may not work
properly !</B></P><P>If you can’t have erlang installed on remote servers, you can use one
of the other available agents:</P><!--TOC subsubsection SNMP-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc42">6.3.2</A> SNMP</H4><!--SEC END --><P>
The type keyword <FONT COLOR=purple>snmp</FONT> can replace the erlang keyword, if SNMP monitoring
is preferred. They can be mixed. Since version 1.2.2, you can customize the SNMP version,
community and port number. It uses the MIB provided in
<EM>net-snmp</EM> (see also <A HREF="#sec:faq:snmp">A.9</A>).</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <monitoring>
<monitor host="geronimo" type="snmp"/>
<monitor host="f14-2" type="erlang"></monitor>
<monitor host="db" type="snmp">
<snmp version="v2" community="mycommunity" port="11161"/>
</monitor>
</monitoring>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><P>The default version is <FONT COLOR=purple>v1</FONT>, default community
<FONT COLOR=purple>public</FONT> and default port <FONT COLOR=purple>161</FONT>.</P><!--TOC subsubsection Munin-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc43">6.3.3</A> Munin</H4><!--SEC END --><P>Since version <B>1.3.1</B>, Tsung is able to retrieve data from a munin-node agent
(see <A HREF="http://munin.projects.linpro.no/wiki/munin-node"><TT>http://munin.projects.linpro.no/wiki/munin-node</TT></A>). The <TT>type</TT>
keyword must be set to <FONT COLOR=purple>munin</FONT>, for example:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <monitoring>
<monitor host="geronimo" type="munin"/>
<monitor host="f14-2" type="erlang"></monitor>
</monitoring>
</PRE></TD></TR>
</TABLE></TD><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE><!--TOC subsection Defining the load progression-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc44">6.4</A> Defining the load progression</H3><!--SEC END --><!--TOC subsubsection Randomly generated users-->
<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc45">6.4.1</A> Randomly generated users</H4><!--SEC END --><P>The load progression is set-up by defining several arrival phases:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"> <load>
<arrivalphase phase="1" duration="10" unit="minute">
<users interarrival="2" unit="second"></users>
</arrivalphase>
<arrivalphase phase="2" duration="10" unit="minute">
<users interarrival="1" unit="second"></users>
</arrivalphase>
<arrivalphase phase="3" duration="10" unit="minute">
<users interarrival="0.1" unit="second"></users>