bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / xdocs / reference / status.xml
1 <?xml version="1.0"?>
2 <!--
3   Licensed to the Apache Software Foundation (ASF) under one or more
4   contributor license agreements.  See the NOTICE file distributed with
5   this work for additional information regarding copyright ownership.
6   The ASF licenses this file to You under the Apache License, Version 2.0
7   (the "License"); you may not use this file except in compliance with
8   the License.  You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17 -->
18 <!DOCTYPE document [
19   <!ENTITY project SYSTEM "project.xml">
20 ]>
21 <document url="status.html">
22
23     &project;
24
25     <properties>
26         <author email="rjung@apache.org">Rainer Jung</author>
27         <title>Status Worker Reference</title>
28     </properties>
29
30 <body>
31
32 <section name="Introduction">
33 <br/>
34 <p>
35 Tomcat Connectors has a special type of worker, the so-called status worker.
36 The status worker does not forward requests to Tomcat instances. Instead it allows
37 to retrieve status and configuration information at runtime,
38 and furthermore to change many configuration items dynamically. This can be done
39 via a simple embedded web interface.
40 </p>
41 <p>
42 The status worker is especially powerful, when used together with load balancing workers.
43 </p>
44 <p>
45 This document does not explain the HTML user interface of the status worker.
46 Until now it is very simple, so just go ahead and use it. This doc instead
47 tries to explain the less obvious features of the status worker. We also will give a
48 complete coverage of the various request parameters and their meaning, so that you can
49 include the status worker in your automation scripts. 
50 </p>
51 <p>
52 The documentation of the status worker starts with <b>jk 1.2.20</b>
53 </p>
54 </section>
55
56 <section name="Usage Patterns">
57 <br/>
58 <subsection name="Actions">
59 <br/>
60 <p>
61 The status worker knows about six actions.
62 <ul>
63 <li>
64 <b>list</b>: lists the configurations and runtime information of all configured workers.
65 The output will be grouped by global information first (version data), then load balancer
66 information, after that AJP worker information and finally the legend. For load balancers,
67 there will be a summary part, and after that details for each member worker. For all workers,
68 we also include the URL mappings (forward definitions).
69 </li>
70 <li>
71 <b>show</b>: the same as list, but only shows data for one chosen worker
72 </li>
73 <li>
74 <b>edit</b>: produces a form to edit configuration data for a chosen worker. There is a
75 special subtype of "edit", that makes it easy to change one attribute for all members of
76 a load balancer, e.g. their activation state.
77 </li>
78 <li>
79 <b>update</b>: commit changes made in an edit form. <b>Caution</b>: the changes will not be
80 persisted to the configuration files. As soon as your restart your web server, all changes
81 made through the status worker will be lost! On the other hand, the changes done by the status
82 worker will be applied during runtime without a restart of the web server.
83 </li>
84 <li>
85 <b>reset</b>: reset all runtime statistics for a worker.
86 </li>
87 <li>
88 <b>recover</b>: Mark a member of a load balancer, that is in error state, for immediate recovery.
89 </li>
90 <li>
91 <b>version</b>: only show version information of the web server and the JK software
92 </li>
93 <li>
94 <b>dump</b>: list the original workers configuration. <b>Caution</b>: the dump will only contain
95 the configuration that was used during startup. Any changes applied later by the dynamic management
96 interface of the status worker itself will not be contained in this dump.
97 The dump action has been added in version 1.2.27.
98 </li>
99 </ul>
100 </p>
101 </subsection>
102
103 <subsection name="Output Format">
104 <br/>
105 <p>
106 For most actions you can choose between 4 output formats.
107 <ul>
108 <li>
109 <b>HTML</b>: Used interactively with a browser
110 </li>
111 <li>
112 <b>XML</b>: Mostly useful for automation, when your scripting environment is XML friendly.
113 This format has rich structure information, but does not work line based, so you would really
114 like to use it together with XML tools.
115 </li>
116 <li>
117 <b>Properties</b>: This format is a line based format, that conforms to the rules of Java
118 property files. Most structure information is contained in the hierarchical key. For information,
119 that is of configuration nature, the format should produce lines very similar to the ones you can
120 use in workers.properties. It will not produce a complete configuration file!
121 </li>
122 <li>
123 <b>Text</b>: A simple textual output format.
124 </li>
125 </ul>
126 The "edit" action does only make sense for the HTML output type.
127 </p>
128 </subsection>
129
130 <subsection name="User Interface Features">
131 <br/>
132 <p>
133 In the HTML view, there is an <b>automatic refresh</b> feature, implemented via the meta refresh
134 option of HTML. Once you start the automatic refresh, the UI will will respect it for all actions
135 except edit, update and maintain. Even if you navigate through one of those, the automatic refresh
136 will start again as soon as you come back to one of the other actions.
137 </p>
138 <p>
139 Many parts of the HTML page can be minimised, if they are not interesting for you. There are a couple
140 of "Hide" links, which will collapse parts of the information. The feature exists for the following
141 blocks of information:
142 <ul>
143 <li>
144 <b>Legend</b>: Do not show the legend for the information presented in "list" and "show" actions
145 </li>
146 <li>
147 <b>URI mappings</b>: Do not show the URI mapping for the workers
148 </li>
149 <li>
150 <b>Load Balancing Workers</b>: Do not show workers of type "lb"
151 </li>
152 <li>
153 <b>AJP Workers</b>: Do not show workers of type ajp
154 </li>
155 <li>
156 <b>Balancer Members</b>: Do not show detailed information concerning each member of load balancers
157 </li>
158 <li>
159 <b>Load Balancer Configuration</b>: Do not show configuration data for load balancers
160 </li>
161 <li>
162 <b>Load Balancer Summary</b>: Do not show status summary for load balancers
163 </li>
164 <li>
165 <b>AJP Configuration</b>: Do not show configuration data for ajp workers load balancer members
166 </li>
167 </ul>
168 The last three minimisation features have been added in version 1.2.27.
169 </p>
170 </subsection>
171
172 <subsection name="Special Considerations concerning URL Maps and Virtual Hosts">
173 <br/>
174 <p>
175 <b>Note: </b>The following restriction has been removed starting with version 1.2.26.
176 </p>
177 <p>
178 The Apache module mod_jk makes use of the internal Apache httpd infrastructure concerning
179 virtual hosts. The downside of this is, that the status worker can only show URL maps, for
180 the virtual host it is defined in. It is not able to reach the configuration objects
181 for other virtual hosts. Of course you can define a status worker in any virtual host you
182 are using. All information presented apart from the URL maps will be the same, independent
183 of the virtual host the status worker has been called in.
184 </p>
185 </subsection>
186
187 <subsection name="Logging">
188 <br/>
189 <p>
190 The status worker will log changes made to the configuration with log level "info" to the usual
191 JK log file. Invalid requests will be logged with log level "warn". If you want to report some
192 broken behaviour, log file content of level "debug" or even "trace" will be useful.
193 </p>
194 </subsection>
195
196 </section>
197
198 <section name="Configuration">
199 <br/>
200 <subsection name="Basic Configuration">
201 <br/>
202 <p>
203 The basic configuration of a status worker is very similar to that of a usual ajp worker.
204 You need to specify a name for the worker, and the URLs you want to map to it. The first
205 part of the configuration happens in the workers.properties file. We define a worker named
206 mystatus of type status:
207 <source>
208 worker.list=mystatus
209 worker.mystatus.type=status
210 </source>
211 Then we define a URL, which should be mapped to this worker, i.e. the URL we use
212 to reach the functionality of the status worker. You can use any method mod_jk supports
213 for the web server of your choice. Possibilities are maps inside uriworkermap.properties,
214 an additional mount attribute in workers.properties, or in Apache JkMount. Here's an
215 example for a uriworkermap.properties line:
216 <source>
217 /private/admin/mystatus=mystatus
218 </source>
219 The URI pattern is case sensitive.
220 </p>
221 <p>
222 As you will learn in the following sections, the status worker is very powerful. You should
223 use the usual authentication and authorisation methods of your web server to secure this URL.
224 </p>
225 <p>
226 You can also define multiple instances of the status worker, by using different names and URL mappings.
227 For instance you might want to configure them individually
228 and then allow special groups of people to use them
229 </p>
230 </subsection>
231
232 <subsection name="Output Customisation">
233 <br/>
234 <p>
235 There are a couple of attributes for the workers.properties entries, which allow to customise
236 various aspects of the output of the status worker.
237 </p>
238 <p>
239 The attribute <b>css</b> can be set to the URL of a stylesheet:
240 <source>
241 worker.mystatus.css=/private/admin/static/mystatus.css
242 </source>
243 When writing HTML output, the status worker then includes the line
244 <source>
245 &lt;link rel="stylesheet" type="text/css" href="/private/admin/static/mystatus.css" /&gt;
246 </source>
247 There is no sample stylesheet included with the mod_jk release, and by default the attribute css
248 is empty, so no stylesheet reference will be included in the pages. The HTML code
249 of the status worker output pages does not include any class attributes. If you like to contribute a
250 stylesheet or improvements to the HTML layout, please contact us on the tomcat developers list.
251 </p>
252 <p>
253 The properties output format can be customised via the attribute <b>prefix</b>. The names of all
254 properties the status worker does output, will begin with this prefix. The default is "worker".
255 </p>
256 <p>
257 Several attributes influence the format when writing XML output.
258 The attribute <b>ns</b> allows to set a namespace prefix, that will be used for every status worker+element.
259 The default is "jk:". Setting it to "-" disables the namespace prefix.
260 </p>
261 <p>
262 With the attribute xmlns you can map the prefix to a namespace URL. The default value
263 is xmlns:jk="http://tomcat.apache.org". Setting it to "-" disables the output of the URL.
264 </p>
265 <p>
266 Finally you can specify an XML document type via the attribute doctype. The specified string will 
267 be inserted at the beginning of the document, directly after the xml header. The default is empty.
268 </p>
269 </subsection>
270
271 <subsection name="Securing Access">
272 <br/>
273 <p>
274 We urge you to use the builtin access control features of your web server to control
275 access to the status worker URLs you have chosen. Nevertheless two configuration
276 attributes of status workers are helpful. The attribute "read_only" disables all features of
277 the status worker, that can be used to change configurations or runtime status of the other workers.
278 A read_only status worker will not allow access to the edit, update, reset or recover actions.
279 The default value is "False", ie. read/write. To enable read_only you need to set it to "True".
280 </p>
281 <p>
282 You could configure two status workers, one has read_only and will be made available to a larger
283 admin group, the other one will be used fully featured, but only by fewer people:
284 <source>
285 worker.list=jk-watch
286 worker.jk-watch.type=status
287 worker.jk-watch.read_only=True
288 worker.jk-watch.mount=/user/status/jk
289 worker.list=jk-manage
290 worker.jk-manage.type=status
291 worker.jk-manage.mount=/admin/status/jk
292 </source>
293 Starting with version 1.2.21, a read/write status worker can also be switched temporarily
294 into read-only mode by the user via a link in the HTML GUI. The user can always switch it
295 back to read/write. Only a status worker configured as read-only via the "read_only" attribute
296 is completely safe from applying any changes.
297 </p>
298 <p>
299 The other attribute you can use is <b>user</b>. By default this list is empty, which means
300 no limit on the users. You can set "user" to a comma separated list of user names. If your
301 web server is configured such that it sends the user names with the request, the status worker
302 will check, if the name attached with the request is contained in it's "user" list.
303 </p>
304 <p>
305 The user list can be split over multiple occurrences of the "user" attribute.
306 </p>
307 <p>
308 By default, the user names are matched case sensitively. Starting with version 1.2.21 you can set
309 the attribute <b>user_case_insensitive</b> to "True". Then the comparison will be made case insensitive.
310 </p>
311 </subsection>
312
313 <subsection name="Service Availability Rating">
314 <br/>
315 <p>
316 For load balancing workers the status worker shows some interesting overview information.
317 It categorises the members of the load balancer into the classes "good", "bad" and degraded".
318 This feature can be combined with external escalation procedures. Depending on your global
319 system design and your operating practises your preferred categorisation might vary.
320 </p>
321 <p>
322 The categorisation is based on the activation state of the workers (active, disabled or stopped),
323 which is a pure configuration state, and the runtime state
324 (OK or ERR with possible substates idle, busy, recovering, probing, and forced recovery)
325 which only depends on the runtime situation.
326 </p>
327 <p>
328 The runtime substates have the following meaning:
329 <ul>
330 <li>
331 <b>OK (idle)</b>: This worker didn't receive any request since the last balancer
332 maintenance. By default balancer maintenance runs every 60 seconds. The
333 worker should be OK, but since we didn't have to use it for some time, we
334 can't be sure. This state has been called N/A before version 1.2.24.
335 </li>
336 <li>
337 <b>OK (busy)</b>: All connections for this worker are in use for requests.
338 </li>
339 <li>
340 <b>ERROR (recovering)</b>: The worker was in error state for some time and is now
341 marked for recovery. The next request suitable for this worker will use it.
342 </li>
343 <li>
344 <b>ERROR (probing)</b>: After setting the worker to recovering, we received a request
345 suitable for this worker. This request is now using the worker.
346 </li>
347 <li>
348 <b>ERROR (forced recovery)</b>: The worker is in error, but we don't have an alternative
349 worker, so we keep using it.
350 </li>
351 </ul>
352 </p>
353 <p>
354 By default the status worker groups into "good" all members, that have activation "active" and
355 runtime state not equal to "error" with empty substate.
356 The "bad" group consists of the members, that have either activation
357 "stopped", or are in runtime state "error" with empty substate.
358 </p>
359 <p>
360 Workers that fit neither of the two groups, are considered to be "degraded".
361 </p>
362 <p>
363 You can define other rules for the grouping into good, bad and degraded.
364 The two attributes "good" and "bad" can be populated by a comma-separated list ob single characters or
365 dot-separated pairs. Each character stands for the first character of one of the possible states "active",
366 "disabled", "stopped", "ok", "idle", "busy", "recovering" and "error". The additional states "probing"
367 and "forced recovery" are always rated equivalent to "recovering".
368 Comma-separated entries will be combined
369 with logical "or", if you combine a configuration and a runtime state with a dot. the are combined with logical
370 "and". So the default value for "good" is "a.o,a.i,a.b,a.r", for "bad" it is "e,s".
371 </p>
372 <p>
373 The status worker first tries to match against the "bad" definitions, if this doesn't succeed
374 it tries to match against "good", and finally it chooses "degraded", if no "bad" or "good" match
375 can be found.
376 </p>
377 </subsection>
378 </section>
379
380 <section name="Request Parameters">
381 <br/>
382 <p>
383 This section should help you building automation scripts based on the jk status
384 management interface. This interface is stable in the sense, that we only expect
385 to add further parameters in the future. Existing parameters from previous versions
386 will keep their original semantics. We also expect the output formats XML, Properties
387 and Text to be kept stable. So please use those, if you want to parse status worker
388 output in your automation scripts.
389 </p>
390 <subsection name="Actions">
391 <br/>
392 <p>
393 The action is determined by the parameter <b>cmd</b>. It can have the values "list", "show",
394 "edit", "update", "reset", "recover", "version" and "dump". If you omit the <b>cmd</b> parameter,
395 the default "list" will be used.
396 All actions except for "list", "refresh", "version" and "dump" need additional parameters.
397 </p>
398 <p>
399 The action "dump" has been added in version 1.2.27.
400 </p>
401 </subsection>
402 <subsection name="Output Format">
403 <br/>
404 <p>
405 The format is determined by the parameter <b>mime</b>. It can have the values "html", "xml",
406 "txt" and "prop". If you omit the <b>mime</b> parameter, the default "html"
407 will be used. The action "edit" (the edit form) does only make sense for "mime=html".
408 </p>
409 </subsection>
410 <subsection name="Worker Selection">
411 <br/>
412 <p>
413 Actions that operate on a single worker need one or two additional parameters to select
414 this worker. The parameter <b>w</b> contains the name of the worker from the worker list.
415 If an action operates on a member (sub worker) of a load balancer, the parameter <b>w</b>
416 contains the name of the load balancer worker, and the additional parameter <b>sw</b> contains the
417 name of the sub worker.
418 </p>
419 </subsection>
420 <subsection name="Automatic Refresh">
421 <br/>
422 <p>
423 During automatic refresh, the parameter <b>re</b> contain the refresh interval in seconds.
424 If you omit this parameter, automatic refresh will be off.
425 </p>
426 </subsection>
427 <subsection name="Hide Options">
428 <br/>
429 <p>
430 The parameter <b>opt</b> contains a bit mask of activated options. The default is 0, so
431 by default no options are activated. The following options exist:
432 <ul>
433 <li>
434 <b>0x0001</b>: hide members of lb workers
435 </li>
436 <li>
437 <b>0x0002</b>: hide URL maps
438 </li>
439 <li>
440 <b>0x0004</b>: hide the legend
441 </li>
442 <li>
443 <b>0x0008</b>: hide load balancer workers
444 </li>
445 <li>
446 <b>0x0010</b>: hide ajp workers
447 </li>
448 <li>
449 <b>0x0020</b>: only allow read_only actions for a read/write status worker.
450 </li>
451 <li>
452 <b>0x0040</b>: hide load balancer configuration
453 </li>
454 <li>
455 <b>0x0080</b>: hide load balancer status summary
456 </li>
457 <li>
458 <b>0x0100</b>: hide configuration for ajp and load balancer member workers
459 </li>
460 </ul>
461 Values 0x0040-0x0100 have been added in version 1.2.27.
462 </p>
463 </subsection>
464 <subsection name="Data Parameters for the standard Update Action">
465 <br/>
466 <p>
467 You can use the edit action with a final click to the update button, to change settings of workers.
468 But you can also make direct calls to the update action. The following request parameters 
469 contain the configuration information, you want to change. First the list for load balancer workers:
470 <ul>
471 <li>
472 <b>vlr</b>: retries (number)
473 </li>
474 <li>
475 <b>vlt</b>: recover_time (seconds)
476 </li>
477 <li>
478 <b>vlee</b>: error_escalation_time (seconds)
479 </li>
480 <li>
481 <b>vlx</b>: max_reply_timeouts (number)
482 </li>
483 <li>
484 <b>vls</b>: sticky_session (0/f/n/off=off, 1/t/y/on=on; case insensitive)
485 </li>
486 <li>
487 <b>vlf</b>: sticky_session_force (0/f/n/off=off, 1/t/y/on=on; case insensitive)
488 </li>
489 <li>
490 <b>vlm</b>: method (0/r="Requests", 1/t="Traffic", 2/b="Busyness", 3/s="Sessions"; case insensitive, only first character is used)
491 </li>
492 <li>
493 <b>vll</b>: lock (0/o="Optimistic", 1/p="Pessimistic"; case insensitive, only first character is used)
494 </li>
495 </ul>
496 And now the list of parameters you can use to change settings for load balancer members:
497 <ul>
498 <li>
499 <b>vwa</b>: activation flag (0/a="active", 1/d="disabled", 2/s="stopped"; case insensitive, only first character is used)
500 </li>
501 <li>
502 <b>vwf</b>: load balancing factor (integer weight)
503 </li>
504 <li>
505 <b>vwn</b>: route for use with sticky sessions (string)
506 </li>
507 <li>
508 <b>vwr</b>: redirect to define simple failover rules (string)
509 </li>
510 <li>
511 <b>vwc</b>: domain to tell JK about your replication design (string)
512 </li>
513 <li>
514 <b>vwd</b>: distance to express preferences (integer)
515 </li>
516 </ul>
517 Finally the list of parameters you can use to change settings for ajp workers and ajp load balancer members:
518 <ul>
519 <li>
520 <b>vahst</b>: host (string)
521 </li>
522 <li>
523 <b>vaprt</b>: port (number)
524 </li>
525 <li>
526 <b>vacpt</b>: connection_pool_timeout (number)
527 </li>
528 <li>
529 <b>vact</b>: connect_timeout (number)
530 </li>
531 <li>
532 <b>vapt</b>: prepost_timeout (number)
533 </li>
534 <li>
535 <b>vart</b>: reply_timeout (number)
536 </li>
537 <li>
538 <b>var</b>: retries (number)
539 </li>
540 <li>
541 <b>varo</b>: recovery_options (number)
542 </li>
543 <li>
544 <b>vamps</b>: max_packet_size (number)
545 </li>
546 </ul>
547 Note that changing the host name or port will only take effect for new connections.
548 Already established connections to the old address will still be used.
549 Nevertheless this feature is interesting, because you can provision load balancer
550 members with port "0", which will automatically be stopped during startup. Later
551 when you know the final names and ports, you can set them and they will be
552 automatically activated.
553 </p>
554 <p>
555 The leading character "v" has been added to the parameters in version 1.2.27.
556 Changing settings for ajp workers has also been introduced in version 1.2.27.
557 </p>
558 <p>
559 For the details of all parameters, we refer to the <a href="workers.html">workers.properties Reference</a>.
560 </p>
561 </subsection>
562 <subsection name="Aspect Editing for Load Balancer Members">
563 <br/>
564 <p>
565 You can use the edit action to edit all settings for a load balancer or for a
566 member of a load balancer respectively on one page. If you want to edit one
567 configuration aspect for all members of a load balancer simultaneously, this
568 will be triggered by the parameter <b>att</b>. The value of the parameter indicates,
569 which aspect you want to edit. The list is the same as in the previous section,
570 except for "vahst" and "vaprt":
571 "vwa", "vwf", "vwn", "vwr", "vwc", "vwd", "vacpt", "vact", "vapt", "vart", "var",
572 "varo" and "vamps". But here you
573 need to put the name into the parameter <b>att</b>, instead of using it as a request
574 parameter name.
575 </p>
576 <p>
577 The values of the common aspect for all the load balancer members will be given
578 in parameters named "val0", "val1", ....
579 </p>
580 </subsection>
581 </section>
582
583 </body>
584 </document>