source: main/waeup.sirp/branches/ulif-stress-multimech/README.txt @ 7519

Last change on this file since 7519 was 7479, checked in by uli, 13 years ago

More docs.

File size: 4.5 KB
Line 
1waeup.stresstest
2****************
3
4This package provides stresstests for *existing* WAeUP SIRP sites.
5
6It deploys the Python multi-mechanize programme/library to fire tons
7of requests against a running site. So, you don't want to use it with
8sites that are under load already. The requests try to simulate users
9using the portal simultanously.
10
11multi-mechanize registers the numbers and latencies of single requests
12and generates graphics/tables with the results. This way you can see
13what actions/requests need how much time. You can also see how the
14server reacts when many concurrent users use the portal.
15
16`waeup.stresstest` is code-wise independent from `waeup.sirp`. You can
17run it on any machine that can do HTTP requests to the target machine
18(which means the machine that should be stress-tested).
19
20Installation is a bit difficult (numpy and matplotlib, two complex
21Python libs for statistical computations) are required and not easily
22installable in the usual buildout-way (well, numpy is but matplotlib
23is a constant source of trouble in that respect). Please refer to the
24``Installation`` section below.
25
26Installation
27============
28
29The following steps are tested on Ubuntu Linux only.
30
31Requirements
32------------
33
34* Python 2.6 or Python 2.7.
35
36* Python packages numpy, mechanize and matplotlib
37
38With recent Ubuntu installs it should be possible to install the
39required libs systemwide by doing::
40
41  $ sudo apt-get install python-numpy
42  $ sudo apt-get install python-matplotlib
43  $ sudo apt-get install python-mechanize
44
45With older Ubuntu releases (for instance ones, that do not ship with
46Python 2.6 or newer), you have to install Python 2.6 or 2.7 locally
47and then install both packages using ``easy_install`` or ``pip``.
48
49The latter is also possible in ``virtualenv`` environments, i.e. if
50you don't want to install the additional packages system-wide.
51
52Install of ``multi-mechanize`` then is especially, ehrm, improvable,
53because this package (yet) lacks support for any package management
54(no setup.py or similar; just plain code packed in a ZIP file for
55download).
56
57We therefore packed the sources of version "1.011" (?) here and added
58some own project which can be run. See usage instructions below.
59
60Usage
61=====
62
63Quick guide:
64
651) Make sure configuration is up-to-date in
66   `multi-mechanize/projects/sirp1/config.cfg`. This 'project' will
67   run against a SIRP portal installed locally as ``app-stress``
68
692) Create a local waeup.sirp portal running on localhost:8080 and
70   named ``app-stress``
71
723) Start the portal.
73
744) On the shell, run::
75
76     $ cd multi-mechanize
77     $ python multi-mechanize sirp1
78
79The latter tells multi mechanize to run the stress tests in the
80``projects/sirp1`` directory. Make sure that the Python interpreter
81you use here is the one that has support for matplotlib and numpy.
82
83Results will be as HTML page in ``projects/sirp1/results/``.
84
85
86Tweaking and Playing Around
87===========================
88
89The current stress tests only include simulation of a bunch of users
90simultaneously trying to access the portal home page and the portal
91applicants page (as anonymous users).
92
93You can tweak and change ``projects/sirp1/test_scripts/`` to do
94different things. See http://code.google.com/p/multi-mechanize/ for
95first steps/hints.
96
97
98ToDo
99====
100
101multi-mechanize currently makes no use of Python packaging,
102entry-points and the like. Improving it in this way and making it a
103first-class-citizen of the Python 'packaging' community would be a
104first step to make it more useful for others.
105
106Notes
107=====
108
109Installing matplotlib with buildout
110-----------------------------------
111
112To install `waeup.stresstest` you need matplotlib which in turn
113depends on `numpy`. While `numpy` can be installed during
114buildout-runs, `matplotlib` is a bit difficult. It does a manual check
115for already installed packages and does not detect already fetched
116numpy installs. As a result matplotlib cannot be installed easily with
117buildout, although there are a few workarounds:
118
119http://comments.gmane.org/gmane.comp.python.distutils.devel/13590
120
121Installing on an old Ubuntu with virtualenv
122-------------------------------------------
123
124Just for the logs, this is what I did to make it work::
125
126  $ virtualenv --no-site-packages -p <PATH-TO-PYTHON-2.6> sandbox26
127  $ source sandbox26/bin/activate
128  $ pip install mechanize
129  $ pip install numpy
130  $ pip install matplotlib
131
132Then (on a different shell):
133
134  - Started waeup.sirp::
135
136    $ ./bin/sirpctl fg
137
138
139  - Added a University instance named 'app-stress'
140
141Back on the first shell::
142
143  $ python multi-mechanize.py sirp1
144
Note: See TracBrowser for help on using the repository browser.