mturk 2004/11/25 02:29:36 Modified: jk/xdocs/howto workers.xml Log: Remove things that are now in config/workers.xml. This file needs some serious work, and probably a split to lbhowto.xml Revision Changes Path 1.2 +4 -309 jakarta-tomcat-connectors/jk/xdocs/howto/workers.xml Index: workers.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/xdocs/howto/workers.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- workers.xml 18 Nov 2004 18:30:36 -0000 1.1 +++ workers.xml 25 Nov 2004 10:29:36 -0000 1.2 @@ -24,6 +24,7 @@ <title>Workers HowTo</title> <author email="[EMAIL PROTECTED]">Henri Gomez</author> <author email="[EMAIL PROTECTED]">Gal Shachor</author> +<author email="[EMAIL PROTECTED]">Mladen Tur</author> <date>$Date$</date> </properties> <body> @@ -205,128 +206,12 @@ You should note that Ajp13 is now the only out-process protocol supported by Tomcat 4.0.x, 4.1.x and 5. </p> -<p> -The following table specifies properties that the ajp13 worker can accept: -</p> - - -<p> -<b>host</b> property set the host where the Tomcat worker is listening for ajp13 requests. -</p> - -<p> -<b>port</b> property set The port where the Tomcat worker is listening for ajp13 requests -</p> - -<p> -<b>lbfactor</b> property is used when working with a load balancer worker, this is the load-balancing factor for the worker. -We'll see more on this in the lb worker section. -</p> - -<p> -<b>cachesize</b> property is usefull when you're using JK in multithreaded -web servers such as Apache 2.0, IIS and Netscape. They will benefit the most by -setting this value to a higher level (such as the estimated average concurrent users for Tomcat). -If cachesize is not set, the connection cache support is disabled. -</p> - -<p> -<b>cache_timeout</b> property should be used with <b>cachesize</b> to specify how to time JK should keep -an open socket in cache before closing it. This property should be used to reduce the number of threads -on the Tomcat WebServer. -</p> - -<p> -You should know that under heavy load some WebServers, for example Apache's create many childs/threads -to handle the load and they destroy the childs/threads only when the load decrease. -</p> - -<p> -Each child could open an ajp13 connection if it have to forward a request to Tomcat, creating -a new ajp13 thread on Tomcat side. -</p> - -<p> -The problem is that after an ajp13 connection is created, the child won't drop it -until killed. And since the webserver will keep its childs/threads running -to handle high-load, even it the child/thread handle only static contents, you could -finish having many unused ajp13 threads on the Tomcat side. -</p> - -<p> -<b>socket_keepalive</b> property should be used when you have a firewall between your webserver -and the Tomcat engine, who tend to drop inactive connections. This flag will told Operating System -to send <code>KEEP_ALIVE</code> message on inactive connections (interval depend on global OS settings, -generally 120mn), and sus prevent the firewall to cut the connection. -</p> - -<p> -The problem with Firewall cutting inactive connections is that sometimes, neither webserver or tomcat -have informations about the cut and couldn't handle it. -</p> - -<p> -<b>socket_timeout</b> property told webserver to cut an ajp13 connection after some time of -inactivity. When choosing an endpoint for a request and the assigned socket is open, it will be -closed if it was not used for the configured time. -It's a good way to ensure that there won't too old threads living on Tomcat side, -with the extra cost you need to reopen the socket next time a request be forwarded. -This property is very similar to <b>cache_timeout</b> but works also in non-cache mode. -</p> - -<p> -<b>connect_timeout</b> property told webserver to send a PING request on ajp13 connection after -connection is established. The parameter is the delay in milliseconds to wait for the PONG reply. -</p> -<p> -This features has been added in <b>jk 1.2.6</b> to avoid problem with hung tomcat's and require ajp13 -ping/pong support which has been implemented on Tomcat <b>3.3.2+, 4.1.28+ and 5.0.13+</b>. -Disabled by default. -</p> - -<p> -<b>prepost_timeout</b> property told webserver to send a PING request on ajp13 connection before -forwarding to it a request. The parameter is the delay in milliseconds to wait for the PONG reply. -</p> -<p> -This features has been added in <b>jk 1.2.6</b> to avoid problem with hung tomcat's and require ajp13 -ping/pong support which has been implemented on <b>Tomcat 3.3.2+, 4.1.28+ and 5.0.13+</b>. -Disabled by default. -</p> - -<p> -<b>reply_timeout</b> property told webserver to wait some time for reply to a forwarded request -before considering the remote tomcat is dead and eventually switch to another tomcat in a cluster -group. By default webserver will wait forever which could be an issue for you. -The parameter is the number of milliseconds to wait for reply, so adjust it carrefully if you -have long running servlets. -</p> -<p> -This features has been added in <b>jk 1.2.6</b> to avoid problem with hung tomcat's and works on all -servlet engines supporting ajp13. -Disabled by default. -</p> - -<p> -<b>recovery_options</b> property told webserver how to handle recovery when -it detect that tomcat failed. -By default, webserver will forward the request to another tomcat in LB mode -(or to another ajp thread in ajp13 mode). -values are : 0 (full recovery), 1 (don't recover if tomcat failed after getting the request), -2 (don't recover if tomcat failed after sending the headers to client), 3 (don't recover if tomcat failed -getting the request or after sending the headers to client). -</p> -<p> -This features has been added in <b>jk 1.2.6</b> to avoid problem with hung/broken tomcat's -and works on all servlet engines supporting ajp13. -Full recovery by default. -</p> <source> - # worker "worker2" will talk to Tomcat listening on machine www2.x.com at port 8009 using 3.5 lb factor + # worker "worker2" will talk to Tomcat listening on machine www2.x.com at port 8009 using 3 lb factor worker.worker2.host=www2.x.com worker.worker2.port=8009 - worker.worker2.lbfactor=3.5 + worker.worker2.lbfactor=3 # worker "worker2" use up to 10 sockets, which will stay no more than 10mn in cache worker.worker2.cachesize=10 worker.worker2.cache_timeout=600 @@ -427,199 +312,9 @@ to the local worker. </p> -<p> -If local_worker is an int and is not 0 it is set to JK_TRUE and marked as local worker, JK_FALSE otherwise. -If in minimum one worker is marked as local worker, lb_worker is in local worker mode. -All local workers are moved to the beginning of the internal worker list in lb_worker during validation. -</p> - -<p> -This means that if a request with a session id comes in it would be routed to the appropriate worker. -If this worker is down it will be send to the first local worker which is not in error state. -</p> - -<p> -If a request without a session comes in, it would be routed to the first local worker. -If all local worker are in error state, then the 'local_worker_only' flag is important. -If it was set to an int and this wasn't 0 it is set to JK_TRUE, JK_FALSE otherwise. With set to JK_TRUE, this request gets an error response. If set to JK_FALSE lb_worker tries to route the request to another balanced worker. -</p> - -<p> -If one of the worker was in error state and has recovered nothing changes. -The local worker will be check for requests without a session id (and with a session on himself) and -the other worker will only be checked if a request with a session id of this worker comes in. -</p> - -<p> -Why do we need souch a complex behavior ? -</p> - -<p> -We need a graceful shut down of a node for maintenance. The balancer in front asks a special port on each -node periodically. If we want to remove a node from the cluster, we switch off this port. -The loadbalancer can't connect to it and marks the node as down. -But we don't move the sessions to another node. In this environment it is an error if the balancer sends a request without a session to an apache+mod_jk+tomcat which port is switched off. And if the load balancer determines that a node is down no other node is allowed to send a request without a session to it. Only requests with old sessions on the switched off node would be routed to this node. After some time nobody uses the old sessions and the sessions will time out. Then nobody uses this node, because all session are gone and the node is unreachable without a session-id in the request. If someone uses a session which timed out, our servlet system sends a redirect response without a session id to the browser. This is necessary for me, because on a switched off node apache and tomcat can still be up and running, but they are in an old state and should only be asked for valid old sessions. After the last session timed out, I could update the node etc. without killing sessions or moving them to another node. Sometimes we have a lot of big objects in our sessions, so it would be really time consuming to move them. -</p> - -<p> -The defaults are still local_worker: 0 and local_worker_only:0 -</p> </subsection> -<subsection name="jni Worker properties"> -<p> -The jni worker opens a JVM inside the web server process and executes Tomcat within it (that is in-process). -Following that, messages to and from the JVM are passed using JNI method calls, this makes the jni worker faster -then the out-of-process workers that need to communicate to the Tomcat workers by writing AJP messages over -TCP/IP sockets. -</p> - -<p> -Note: Since the JVM is multithreaded; the jni worker should be used only within multithreaded servers -such as AOLServer, IIS, Netscape and Apache 2.0.<br/> -You should also make sure that the threading scheme used by the web servers match the one -used to build the JK web server plugin. -</p> - -<p> -Since the jni worker opens a JVM it can accept many properties that it forward to the JVM such as -the classpath etc. as we can see in the following table. -</p> - -<p> -<b>class_path</b> is the classpath as used by the in-process JVM. This should point to all Tomcats' -jar/file files as well as any class or other jar file that you want to add to the JVM. -</p> - -<p> -To have JSP compile support, you should remember to also add Javac to the classpath. -This can be done in Java2 by adding tools.jar to the classpath. -In JDK1.xx you should just add classes.zip. -</p> - -<p> -The <b>class_path</b> property can be given in multiple lines. -In this case the JK environment will concatenate all the classpath entries together -by putting path delimiter (":"/";") between the entries. -</p> - -<source> - # Set the classpath for worker "wrkjni" - worker.wrkjni.class_path=/var/tomcat3/lib/tomcat.jar - # we don't forget to add JAVAC (tools.jar) - worker.wrkjni.class_path=/opt/IBMJava2-131/lib/tools.jar -</source> - -<p> -<b>bridge</b> indicate the kind of Tomcat you'll use via JNI. -</p> - -<p> -The bridge property could be for now <b>tomcat32</b> or <b>tomcat33</b>. -Tomcat 3.2.x is deprecated but still present on some distribution like iSeries. -By default the bridge type is set tomcat33. -</p> - -<source> - # Set bridge type for "wrkjni", we'll use tomcat 3.3 - worker.wrkjni.bridge=tomcat33 -</source> - -<p> -<b>cmd_line</b> is the command line that is handed over to Tomcats' startup code. -</p> - -<p> -The cmd_line property can be given in multiple lines. -In this case the JK environment will concatenate all the cmd_line entries together by putting spaces -between the entries. -</p> - -<source> - # Set command line for "wrkjni" - worker.wrkjni.cmd_line=-config - # Next arg - worker.wrkjni.cmd_line=/etc/tomcat3/conf/alt-server.xml - # Very important tomcat.home - worker.wrkjni.cmd_line=-home - # Location of tomcat.home - worker.wrkjni.cmd_line=/var/tomcat3 -</source> - -<p> -<b>jvm_lib</b> is the full path to the JVM implementation library. -The jni worker will use this path to load the JVM dynamically. -</p> - -<source> - # Set full path for JVM shared lib (IBM SDK on Linux) - worker.wrkjni.jvm_lib=/opt/IBMJava2-131/jre/bin/classic/libjvm.so - # Set full path for JVM shared lib (Sun SDK on Windows) - worker.wrkjni.jvm_lib=c:\JDK\1.3.1\jre\bin\classic -</source> - -<p> -<b>stdout</b> is full path to where the JVM write its System.out -</p> - -<source> - # Put logs in /var/log/http/jk-jvm-out.log - worker.wrkjni.stdout=/var/log/http/jk-jvm-out.log -</source> - -<p> -<b>stderr</b> is full path to where the JVM write its System.err -</p> - -<source> - # Put logs in /var/log/http/jk-jvm-err.log - worker.wrkjni.stderr=/var/log/http/jk-jvm-err.log -</source> - -<p> -<b>ms</b> set initial HEAP size for the JVM -</p> - -<source> - # Told JVM to use 64MB of initial heap size - worker.wrkjni.ms=64 -</source> - -<p> -<b>mx</b> set maximal HEAP size for the JVM -</p> - -<source> - # Told JVM to not use more than 128MB for heap - worker.wrkjni.mx=128 -</source> - -<p> -<b>sysprops</b> set the system properties for the JVM -</p> - -<source> - # Told JVM to use french language - worker.wrkjni.sysprops=-Duser.region=FR -</source> - -<p> -<b>ld_path</b> set the additional dynamic libraries path (similar in nature to LD_LIBRARY_PATH) -</p> - -<source> - # Told system which library path to be added to access Java Env - worker.wrkjni.ld_path=/opt/IBMJava2-131/jre/bin/ - worker.wrkjni.ld_path=/opt/IBMJava2-131/jre/bin/classic -</source> - -<p> -Notes: Under Linux it seems that processes can't update their own LD_LIBRARY_PATH, -so you'll have to update it BEFORE launching the webserver... -</p> - -</subsection> <subsection name="Property file macros"> <p>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]