Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame^] | 1 | <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat Configuration Reference (6.0.39) - The Cluster Receiver object</title><meta name="author" content="Filip Hanik"><style type="text/css" media="print">
|
| 2 | .noPrint {display: none;}
|
| 3 | td#mainBody {width: 100%;}
|
| 4 | </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
|
| 5 | The Apache Tomcat Servlet/JSP Container
|
| 6 | " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1><font face="arial,helvetica,sanserif">Version 6.0.39, Jan 27 2014</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="nowrap" class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Config Ref. Home</a></li></ul><p><strong>Top Level Elements</strong></p><ul><li><a href="server.html">Server</a></li><li><a href="service.html">Service</a></li></ul><p><strong>Executors</strong></p><ul><li><a href="executor.html">Executor</a></li></ul><p><strong>Connectors</strong></p><ul><li><a href="http.html">HTTP</a></li><li><a href="ajp.html">AJP</a></li></ul><p><strong>Containers</strong></p><ul><li><a href="context.html">Context</a></li><li><a href="engine.html">Engine</a></li><li><a href="host.html">Host</a></li><li><a href="cluster.html">Cluster</a></li></ul><p><strong>Nested Components</strong></p><ul><li><a href="globalresources.html">Global Resources</a></li><li><a href="listeners.html">Listeners</a></li><li><a href="loader.html">Loader</a></li><li><a href="manager.html">Manager</a></li><li><a href="realm.html">Realm</a></li><li><a href="resources.html">Resources</a></li><li><a href="valve.html">Valve</a></li></ul><p><strong>Cluster Elements</strong></p><ul><li><a href="cluster.html">Cluster</a></li><li><a href="cluster-manager.html">Manager</a></li><li><a href="cluster-channel.html">Channel</a></li><li><a href="cluster-membership.html">Channel/Membership</a></li><li><a href="cluster-sender.html">Channel/Sender</a></li><li><a href="cluster-receiver.html">Channel/Receiver</a></li><li><a href="cluster-interceptor.html">Channel/Interceptor</a></li><li><a href="cluster-valve.html">Valve</a></li><li><a href="cluster-deployer.html">Deployer</a></li><li><a href="cluster-listener.html">ClusterListener</a></li></ul><p><strong>Other</strong></p><ul><li><a href="filter.html">Filter</a></li><li><a href="systemprops.html">System properties</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Apache Tomcat Configuration Reference</h1><h2>The Cluster Receiver object</h2><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
|
| 7 | <ul><li><a href="#Introduction">Introduction</a></li><li><a href="#Blocking_vs_Non-Blocking_Receiver">Blocking vs Non-Blocking Receiver</a></li><li><a href="#Attributes">Attributes</a><ol><li><a href="#Common_Attributes">Common Attributes</a></li><li><a href="#NioReceiver">NioReceiver</a></li><li><a href="#BioReceiver">BioReceiver</a></li></ol></li></ul>
|
| 8 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
|
| 9 | <p>
|
| 10 | The receiver component is responsible for receiving cluster messages.
|
| 11 | As you might notice through the configuration, is that the receiving of messages
|
| 12 | and sending of messages are two different components, this is different from many other
|
| 13 | frameworks, but there is a good reason for it, to decouple the logic for how messages are sent from
|
| 14 | how messages are received.<br>
|
| 15 | The receiver is very much like the Tomcat Connector, its the base of the thread pool
|
| 16 | for incoming cluster messages. The receiver is straight forward, but all the socket settings
|
| 17 | for incoming traffic are managed here.
|
| 18 | </p>
|
| 19 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Blocking vs Non-Blocking Receiver"><!--()--></a><a name="Blocking_vs_Non-Blocking_Receiver"><strong>Blocking vs Non-Blocking Receiver</strong></a></font></td></tr><tr><td><blockquote>
|
| 20 | <p>
|
| 21 | The receiver supports both a non blocking, <code>org.apache.catalina.tribes.transport.nio.NioReceiver</code>, and a
|
| 22 | blocking, <code>org.apache.catalina.tribes.transport.bio.BioReceiver</code>. It is preferred to use the non blocking receiver
|
| 23 | to be able to grow your cluster without running into thread starvation.<br>
|
| 24 | Using the non blocking receiver allows you to with a very limited thread count to serve a large number of messages.
|
| 25 | Usually the rule is to use 1 thread per node in the cluster for small clusters, and then depending on your message frequency
|
| 26 | and your hardware, you'll find an optimal number of threads peak out at a certain number.
|
| 27 | </p>
|
| 28 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote>
|
| 29 | <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Common Attributes"><!--()--></a><a name="Common_Attributes"><strong>Common Attributes</strong></a></font></td></tr><tr><td><blockquote>
|
| 30 | <table border="1" cellpadding="5"><tr><th width="15%" bgcolor="#023264"><font color="#ffffff">Attribute</font></th><th width="85%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><strong><code>className</code></strong></td><td align="left" valign="center">
|
| 31 | The implementation of the receiver component. Two implementations available,
|
| 32 | <code>org.apache.catalina.tribes.transport.nio.NioReceiver</code> and
|
| 33 | <code>org.apache.catalina.tribes.transport.bio.BioReceiver</code>.<br>
|
| 34 | The <code>org.apache.catalina.tribes.transport.nio.NioReceiver</code> is the
|
| 35 | preferred implementation
|
| 36 | </td></tr><tr><td align="left" valign="center"><code>address</code></td><td align="left" valign="center">
|
| 37 | The address (network interface) to listen for incoming traffic.
|
| 38 | Same as the bind address. The default value is <code>auto</code> and translates to
|
| 39 | <code>java.net.InetAddress.getLocalHost().getHostAddress()</code>.
|
| 40 | </td></tr><tr><td align="left" valign="center"><code>direct</code></td><td align="left" valign="center">
|
| 41 | Possible values are <code>true</code> or <code>false</code>.
|
| 42 | Set to true if you want the receiver to use direct bytebuffers when reading data
|
| 43 | from the sockets.
|
| 44 | </td></tr><tr><td align="left" valign="center"><code>port</code></td><td align="left" valign="center">
|
| 45 | The listen port for incoming data. The default value is <code>4000</code>.
|
| 46 | To avoid port conflicts the receiver will automatically bind to a free port within the range of
|
| 47 | <code> port <= bindPort <= port+autoBind</code>
|
| 48 | So for example, if port is 4000, and autoBind is set to 10, then the receiver will open up
|
| 49 | a server socket on the first available port in the range 4000-4100.
|
| 50 | </td></tr><tr><td align="left" valign="center"><code>autoBind</code></td><td align="left" valign="center">
|
| 51 | Default value is <code>100</code>.
|
| 52 | Use this value if you wish to automatically avoid port conflicts the cluster receiver will try to open a
|
| 53 | server socket on the <code>port</code> attribute port, and then work up <code>autoBind</code> number of times.
|
| 54 | </td></tr><tr><td align="left" valign="center"><code>securePort</code></td><td align="left" valign="center">
|
| 55 | The secure listen port. This port is SSL enabled. If this attribute is omitted no SSL port is opened up.
|
| 56 | There default value is unset, meaning there is no SSL socket available.
|
| 57 | </td></tr><tr><td align="left" valign="center"><code>selectorTimeout</code></td><td align="left" valign="center">
|
| 58 | The value in milliseconds for the polling timeout in the <code>NioReceiver</code>. On older versions of the JDK
|
| 59 | there have been bugs, that should all now be cleared out where the selector never woke up.
|
| 60 | The default value is a very high <code>5000</code> milliseconds.
|
| 61 | </td></tr><tr><td align="left" valign="center"><code>maxThreads</code></td><td align="left" valign="center">
|
| 62 | The maximum number of threads in the receiver thread pool. The default value is <code>6</code>
|
| 63 | Adjust this value relative to the number of nodes in the cluster, the number of messages being exchanged and
|
| 64 | the hardware you are running on. A higher value doesn't mean more efficiency, tune this value according to your
|
| 65 | own test results.
|
| 66 | </td></tr><tr><td align="left" valign="center"><code>minThreads</code></td><td align="left" valign="center">
|
| 67 | Minimum number of threads to be created when the receiver is started up. Default value is <code>6</code>
|
| 68 | </td></tr><tr><td align="left" valign="center"><code>ooBInline</code></td><td align="left" valign="center">
|
| 69 | Boolean value for the socket OOBINLINE option. Possible values are <code>true</code> or <code>false</code>.
|
| 70 | </td></tr><tr><td align="left" valign="center"><code>rxBufSize</code></td><td align="left" valign="center">
|
| 71 | The receiver buffer size on the receiving sockets. Value is in bytes, the default value is <code>43800</code> bytes.
|
| 72 | </td></tr><tr><td align="left" valign="center"><code>txBufSize</code></td><td align="left" valign="center">
|
| 73 | The sending buffer size on the receiving sockets. Value is in bytes, the default value is <code>25188</code> bytes.
|
| 74 | </td></tr><tr><td align="left" valign="center"><code>soKeepAlive</code></td><td align="left" valign="center">
|
| 75 | Boolean value for the socket SO_KEEPALIVE option. Possible values are <code>true</code> or <code>false</code>.
|
| 76 | </td></tr><tr><td align="left" valign="center"><code>soLingerOn</code></td><td align="left" valign="center">
|
| 77 | Boolean value to determine whether to use the SO_LINGER socket option.
|
| 78 | Possible values are <code>true</code> or <code>false</code>. Default value is <code>true</code>.
|
| 79 | </td></tr><tr><td align="left" valign="center"><code>soLingerTime</code></td><td align="left" valign="center">
|
| 80 | Sets the SO_LINGER socket option time value. The value is in seconds.
|
| 81 | The default value is <code>3</code> seconds.
|
| 82 | </td></tr><tr><td align="left" valign="center"><code>soReuseAddress</code></td><td align="left" valign="center">
|
| 83 | Boolean value for the socket SO_REUSEADDR option. Possible values are <code>true</code> or <code>false</code>.
|
| 84 | </td></tr><tr><td align="left" valign="center"><code>soTrafficClass</code></td><td align="left" valign="center">
|
| 85 | Sets the traffic class level for the socket, the value is between 0 and 255.
|
| 86 | Different values are defined in <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setTrafficClass(int)">
|
| 87 | java.net.Socket#setTrafficClass(int)</a>.
|
| 88 | </td></tr><tr><td align="left" valign="center"><code>tcpNoDelay</code></td><td align="left" valign="center">
|
| 89 | Boolean value for the socket TCP_NODELAY option. Possible values are <code>true</code> or <code>false</code>.
|
| 90 | The default value is <code>true</code>
|
| 91 | </td></tr><tr><td align="left" valign="center"><code>timeout</code></td><td align="left" valign="center">
|
| 92 | Sets the SO_TIMEOUT option on the socket. The value is in milliseconds and the default value is <code>3000</code>
|
| 93 | milliseconds.
|
| 94 | </td></tr><tr><td align="left" valign="center"><code>useBufferPool</code></td><td align="left" valign="center">
|
| 95 | Boolean value whether to use a shared buffer pool of cached <code>org.apache.catalina.tribes.io.XByteBuffer</code>
|
| 96 | objects. If set to true, the XByteBuffer that is used to pass a message up the channel, will be recycled at the end
|
| 97 | of the requests. This means that interceptors in the channel must not maintain a reference to the object
|
| 98 | after the <code>org.apache.catalina.tribes.ChannelInterceptor#messageReceived</code> method has exited.
|
| 99 | </td></tr></table>
|
| 100 | </blockquote></td></tr></table>
|
| 101 | <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="NioReceiver"><strong>NioReceiver</strong></a></font></td></tr><tr><td><blockquote>
|
| 102 | </blockquote></td></tr></table>
|
| 103 | <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="BioReceiver"><strong>BioReceiver</strong></a></font></td></tr><tr><td><blockquote>
|
| 104 | </blockquote></td></tr></table>
|
| 105 |
|
| 106 | </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
|
| 107 | Copyright © 1999-2014, Apache Software Foundation
|
| 108 | </em></font></div></td></tr></table></body></html> |