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

Last change on this file since 10459 was 7562, checked in by uli, 13 years ago

Update beginning of README.

File size: 3.7 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
36On the shell (after, optionally, enabling a virtual environment) run::
37
38  $ python bootstrap/bootstrap.py
39  $ ./bin/buildout
40
41Usage (outdated)
42================
43
44Quick guide:
45
461) Make sure configuration is up-to-date in
47   `multi-mechanize/projects/sirp1/config.cfg`. This 'project' will
48   run against a SIRP portal installed locally as ``app-stress``
49
502) Create a local waeup.sirp portal running on localhost:8080 and
51   named ``app-stress``
52
533) Start the portal.
54
554) On the shell, run::
56
57     $ cd multi-mechanize
58     $ python multi-mechanize sirp1
59
60The latter tells multi mechanize to run the stress tests in the
61``projects/sirp1`` directory. Make sure that the Python interpreter
62you use here is the one that has support for matplotlib and numpy.
63
64Results will be as HTML page in ``projects/sirp1/results/``.
65
66
67Tweaking and Playing Around
68===========================
69
70The current stress tests only include simulation of a bunch of users
71simultaneously trying to access the portal home page and the portal
72applicants page (as anonymous users).
73
74You can tweak and change ``projects/sirp1/test_scripts/`` to do
75different things. See http://code.google.com/p/multi-mechanize/ for
76first steps/hints.
77
78
79ToDo
80====
81
82multi-mechanize currently makes no use of Python packaging,
83entry-points and the like. Improving it in this way and making it a
84first-class-citizen of the Python 'packaging' community would be a
85first step to make it more useful for others.
86
87Notes
88=====
89
90Installing matplotlib with buildout
91-----------------------------------
92
93To install `waeup.stresstest` you need matplotlib which in turn
94depends on `numpy`. While `numpy` can be installed during
95buildout-runs, `matplotlib` is a bit difficult. It does a manual check
96for already installed packages and does not detect already fetched
97numpy installs. As a result matplotlib cannot be installed easily with
98buildout, although there are a few workarounds:
99
100http://comments.gmane.org/gmane.comp.python.distutils.devel/13590
101
102Installing on an old Ubuntu with virtualenv
103-------------------------------------------
104
105Just for the logs, this is what I did to make it work::
106
107  $ virtualenv --no-site-packages -p <PATH-TO-PYTHON-2.6> sandbox26
108  $ source sandbox26/bin/activate
109  $ pip install mechanize
110  $ pip install numpy
111  $ pip install matplotlib
112
113Then (on a different shell):
114
115  - Started waeup.sirp::
116
117    $ ./bin/sirpctl fg
118
119
120  - Added a University instance named 'app-stress'
121
122Back on the first shell::
123
124  $ python multi-mechanize.py sirp1
125
Note: See TracBrowser for help on using the repository browser.