423.2.8
by John Arbash Meinel
Add a NEWS update, and HACKING commentary about the new code. |
1 |
Loggerhead
|
2 |
==========
|
|
3 |
||
4 |
Overview
|
|
5 |
--------
|
|
6 |
||
7 |
This document attempts to give some hints for people that are wanting to work |
|
8 |
on Loggerhead. |
|
9 |
||
10 |
||
11 |
Testing
|
|
12 |
-------
|
|
13 |
||
14 |
You can run the loggerhead test suite as a bzr plugin. To run just the |
|
15 |
loggerhead tests::
|
|
16 |
||
17 |
bzr selftest -s bp.loggerhead
|
|
18 |
||
19 |
||
20 |
Load Testing
|
|
21 |
------------
|
|
22 |
||
23 |
As a web service, Loggerhead will often be hit by multiple requests. We want |
|
24 |
to make sure that loggerhead can scale with many requests, without performing |
|
25 |
poorly or crashing under the load. |
|
26 |
||
27 |
There is a command ``bzr load-test-loggerhead`` that can be run to stress
|
|
28 |
loggerhead. A script is given, describing what requests to make, against what |
|
29 |
URLs, and for what level of parallel activity. |
|
30 |
||
31 |
||
32 |
Load Testing Multiple Instances
|
|
33 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
34 |
||
35 |
One way that Launchpad provides both high availability and performance scaling |
|
36 |
is by running multiple instances of loggerhead, serving the same content. A |
|
37 |
proxy is then used to load balance the requests. This also allows us to shut |
|
38 |
down one instance for upgrading, without interupting service (requests are |
|
39 |
just routed to the other instance). |
|
40 |
||
41 |
However, multiple processes poses an even greater risk that caches will |
|
42 |
conflict. As such, it is useful to test that changes don't introduce coherency |
|
43 |
issues at load. ``bzr load-test-loggerhead`` can be configured with a script
|
|
44 |
that will make requests against multiple loggerhead instances concurrently. |
|
45 |
||
46 |
To run multiple instances, it is often sufficient to just spawn multiple |
|
47 |
servers on different ports. For example::
|
|
48 |
||
49 |
$ bzr serve --http --port=8080 &
|
|
50 |
$ bzr serve --http --port=8081 &
|
|
51 |
||
52 |
There is a simple example script already in the source tree::
|
|
53 |
||
54 |
$ bzr load-test-loggerhead load_test_scripts/multiple_instances.script
|
|
55 |
||
56 |
||
57 |
||
58 |
.. vim: ft=rst tw=78
|
|
59 |