TC

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

    <property name="org.apache.tomcat.util. net.NioSelectorShared">
      <p>If <code>true</code>, use a shared selector for servlet write/read. If
      not specified, the default value of <code>true</code> will be used.</p>
    </property>

 

    <code>org.apache.coyote.http11.Http11NioProtocol</code> - non blocking Java 
connector<br/>

 

<!-- configurable attributes are -->

<subsection name="Nio Implementation">

    <p>The NIO connector exposes all the low level socket properties that can 
be used to tune the connector.
    Most of these attributes are directly linked to the socket implementation 
in the JDK so you can find out 
    about the actual meaning in the JDK API documentation.<br/>
    <strong>Note</strong>On some JDK versions, setTrafficClass causes a 
problem, a work around for this is to add 
    the <code>-Djava.net.preferIPv4Stack=true</code> value to your command 
line</p>

    <attributes>
      <attribute name="useSendfile" required="false">
        <p>(bool)Use this attribute to enable or disable sendfile capability.
           The default value is <code>true</code>
        </p>
      </attribute>
      <attribute name="useExecutor" required="false">
        <p>(bool)Set to true to use the NIO thread pool executor. The default 
value is <code>true</code>.
        If set to false, it uses a thread pool based on a stack for its 
execution.
        Generally, using the executor yields a little bit slower performance, 
but yields a better
        fairness for processing connections in a high load environment as the 
traffic gets queued through a 
        FIFO queue. If set to true(default) then the max pool size is the 
<code>maxThreads</code> attribute
        and the core pool size is the <code>minSpareThreads</code>.
        This value is ignored if the <code>executor</code> attribute is present 
and points to a valid shared thread pool.
        </p>
      </attribute>
      <attribute name="executor" required="false">
        <p>A reference to the name in an <a href="executor.html">Executor</a> 
element.
           If this attribute is enabled, and the named executor exists, the 
connector will
           use the executor, and all the other thread attributes will be 
ignored.</p>
      </attribute>
      <attribute name="acceptorThreadCount" required="false">
        <p>(int)The number of threads to be used to accept connections. 
Increase this value on a multi CPU machine,
        although you would never really need more than <code>2</code>. Also, 
with a lot of non keep alive connections,
        you might want to increase this value as well. Default value is 
<code>1</code>.</p>
      </attribute>
      <attribute name="pollerThreadCount" required="false">
        <p>(int)The number of threads to be used to run for the polling events.
        Default value is <code>1</code> per processor. Can't see a reason to go
        above that. But experiment and find your own results.</p>
      </attribute>
      <attribute name="pollerThreadPriority" required="false">
        <p>(int)The priority of the poller threads.
          The default value is <code>java.lang.Thread#NORM_PRIORITY</code>.
          See the JavaDoc for the java.lang.Thread class for more details on
          what this priority means.
        </p>
      </attribute>
      <attribute name="acceptorThreadPriority" required="false">
        <p>(int)The priority of the acceptor threads. The threads used to 
accept new connections.
          The default value is <code>java.lang.Thread#NORM_PRIORITY</code>.
          See the JavaDoc for the java.lang.Thread class for more details on
          what this priority means.
        </p>
      </attribute>
      
      <attribute name="selectorTimeout" required="false">
        <p>(int)The time in milliseconds to timeout on a select() for the 
poller.
           This value is important, since connection clean up is done on the 
same thread, so dont set this 
           value to an extremely high one. The default value is 
<code>1000</code> milliseconds.</p>
      </attribute>
      <attribute name="useComet" required="false">
        <p>(bool)Whether to allow comet servlets or not, Default value is 
<code>true</code>.</p>
      </attribute>
      <attribute name="processCache" required="false">
        <p>(int)The protocol handler caches Http11NioProcessor objects to speed 
up performance.
           This setting dictates how many of these objects get cached.
           <code>-1</code> means unlimited, default is <code>200</code>. Set 
this value somewhere close to your maxThreads value.
        </p>
      </attribute>
      <attribute name="maxKeepAliveRequests" required="false">
        <p>The maximum number of HTTP requests which can be pipelined until
        the connection is closed by the server. Setting this attribute to 1 will
        disable HTTP/1.0 keep-alive, as well as HTTP/1.1 keep-alive and
        pipelining. Setting this to -1 will allow an unlimited amount of
        pipelined or keep-alive HTTP requests.
        If not specified, this attribute is set to 100.</p>
      </attribute>
      <attribute name="socket.directBuffer" required="false">
        <p>(bool)Boolean value, whether to use direct ByteBuffers or java 
mapped ByteBuffers. Default is <code>false</code>
           <br/>When you are using direct buffers, make sure you allocate the 
appropriate amount of memory for the 
                direct memory space. On Sun's JDK that would be something like 
<code>-XX:MaxDirectMemorySize=256m</code></p>
      </attribute>
      <attribute name="socket.rxBufSize" required="false">
        <p>(int)The socket receive buffer (SO_RCVBUF) size in bytes. Default 
value is <code>25188</code></p>
      </attribute>
      <attribute name="socket.txBufSize" required="false">
        <p>(int)The socket send buffer (SO_SNDBUF) size in bytes. Default value 
is <code>43800</code></p>
      </attribute>
      <attribute name="socket.appReadBufSize" required="false">
        <p>(int)Each connection that is opened up in Tomcat get associated with 
a read and a write ByteBuffer
           This attribute controls the size of these buffers. By default this 
read buffer is sized at <code>8192</code> bytes.
           For lower concurrency, you can increase this to buffer more data.
           For an extreme amount of keep alive connections, decrease this 
number or increase your heap size.</p>
      </attribute>
      <attribute name="socket.appWriteBufSize" required="false">
        <p>(int)Each connection that is opened up in Tomcat get associated with 
a read and a write ByteBuffer
           This attribute controls the size of these buffers. By default this 
write buffer is sized at <code>8192</code> bytes.
           For low concurrency you can increase this to buffer more response 
data.
           For an extreme amount of keep alive connections, decrease this 
number or increase your heap size.
           <br/>
           The default value here is pretty low, you should up it if you are 
not dealing with tens of thousands
           concurrent connections.</p>
      </attribute>
      <attribute name="socket.bufferPool" required="false">
        <p>(int)The Nio connector uses a class called NioChannel that holds 
elements linked to a socket.
           To reduce garbage collection, the Nio connector caches these channel 
objects.
           This value specifies the size of this cache.
           The default value is <code>500</code>, and represents that the cache 
will hold 500 NioChannel objects.
           Other values are <code>-1</code>. unlimited cache, and 
<code>0</code>, no cache.</p>
      </attribute>
      <attribute name="socket.bufferPoolSize" required="false">
        <p>(int)The NioChannel pool can also be size based, not used object 
based. The size is calculated as follows:<br/>
        NioChannel <code>buffer size = read buffer size + write buffer 
size</code><br/>
        SecureNioChannel <code>buffer size = application read buffer size + 
application write buffer size + network read buffer size + network write buffer 
size</code><br/>
        The value is in bytes, the default value is <code>1024*1024*100</code> 
(100MB)
        </p>
      </attribute>
      <attribute name="socket.processorCache" required="false">
        <p>(int)Tomcat will cache SocketProcessor objects to reduce garbage 
collection.
           The integer value specifies how many objects to keep in the cache at 
most.
           The default is <code>500</code>.
           Other values are <code>-1</code>. unlimited cache, and 
<code>0</code>, no cache.</p>
      </attribute>
      <attribute name="socket.keyCache" required="false">
        <p>(int)Tomcat will cache KeyAttachment objects to reduce garbage 
collection.
           The integer value specifies how many objects to keep in the cache at 
most.
           The default is <code>500</code>.
           Other values are <code>-1</code>. unlimited cache, and 
<code>0</code>, no cache.</p>
      </attribute>
      <attribute name="socket.eventCache" required="false">
        <p>(int)Tomcat will cache PollerEvent objects to reduce garbage 
collection.
           The integer value specifies how many objects to keep in the cache at 
most.
           The default is <code>500</code>.
           Other values are <code>-1</code>. unlimited cache, and 
<code>0</code>, no cache.</p>
      </attribute>
      <attribute name="socket.tcpNoDelay" required="false">
        <p>(bool)same as the standard setting <code>tcpNoDelay</code>. Default 
value is <code>false</code></p>
      </attribute>
      <attribute name="socket.soKeepAlive" required="false">
        <p>(bool)Boolean value for the socket's keep alive setting 
(SO_KEEPALIVE). Default is <code>false</code>. </p>
      </attribute>
      <attribute name="socket.ooBInline" required="false">
        <p>(bool)Boolean value for the socket OOBINLINE setting. Default value 
is <code>true</code></p>
      </attribute>
      <attribute name="socket.soReuseAddress" required="false">
        <p>(bool)Boolean value for the sockets reuse address option 
(SO_REUSEADDR). Default value is <code>true</code></p>
      </attribute>
      <attribute name="socket.soLingerOn" required="false">
        <p>(bool)Boolean value for the sockets so linger option (SO_LINGER). 
Default value is <code>true</code>.
           This option is paired with the <code>soLingerTime</code> value.</p>
      </attribute>
      <attribute name="socket.soLingerTime" required="false">
        <p>(bool)Value in seconds for the sockets so linger option (SO_LINGER). 
Default value is <code>25</code> seconds.
           This option is paired with the soLinger value.</p>
      </attribute>
      <attribute name="socket.soTimeout" required="false">
        <p>(int)Value in milliseconds for the sockets read timeout 
(SO_TIMEOUT). Default value is <code>5000</code> milliseconds.</p>
      </attribute>      
      <attribute name="socket.soTrafficClass" required="false">
        <p>(byte)Value between <code>0</code> and <code>255</code> for the 
traffic class on the socket, <code>0x04 | 0x08 | 0x010</code></p>
      </attribute>      
      <attribute name="socket.performanceConnectionTime" required="false">
        <p>(int)The first value for the performance settings. Default is 
<code>1</code>, see <a 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options</a></p>
      </attribute>      
      <attribute name="socket.performanceLatency" required="false">
        <p>(int)The second value for the performance settings. Default is 
<code>0</code>, see <a 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options</a></p>
      </attribute>      
      <attribute name="socket.performanceBandwidth" required="false">
        <p>(int)The third value for the performance settings. Default is 
<code>1</code>, see <a 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket
 Performance Options</a></p>
      </attribute>      
      <attribute name="selectorPool.maxSelectors" required="false">
        <p>(int)The max selectors to be used in the pool, to reduce selector 
contention.
        Use this option when the command line 
<code>org.apache.tomcat.util.net.NioSelectorShared</code> value is set to false.
        Default value is <code>200</code>.</p>
      </attribute>
      <attribute name="selectorPool.maxSpareSelectors" required="false">
        <p>(int)The max spare selectors to be used in the pool, to reduce 
selector contention.
        When a selector is returned to the pool, the system can decide to keep 
it or let it be GC:ed.
        Use this option when the command line 
<code>org.apache.tomcat.util.net.NioSelectorShared</code> value is set to false.
        Default value is <code>-1</code> (unlimited)</p>
      </attribute>
      <attribute name="command-line-options" required="false">
        <p>The following command line options are available for the NIO 
connector:<br/>
        <code>-Dorg.apache.tomcat.util.net.NioSelectorShared=true|false</code> 
- default is <code>true</code>.
        Set this value to false if you wish to use a selector for each thread.
        the property. If you do set it to false, you can control the size of 
the pool of selectors by using the 
        selectorPool.maxSelectors attribute</p>
      </attribute>
      <attribute name="oomParachute" required="false">
        <p>(int)The NIO connector implements an OutOfMemoryError strategy 
called parachute.
           It holds a chunk of data as a byte array. In case of an OOM,
           this chunk of data is released and the error is reported. This will 
give the VM enough room
           to clean up. The <code>oomParachute</code> represent the size in 
bytes of the parachute(the byte array).
           The default value is <code>1024*1024</code>(1MB).
           Please note, this only works for OOM errors regarding the Java Heap 
space, and there is absolutely no 
           guarantee that you will be able to recover at all.
           If you have an OOM outside of the Java Heap, then this parachute 
trick will not help.
        </p>
      </attribute>
    </attributes>
  </subsection>


    <p>Below is a small chart that shows how the connectors differentiate.</p>
    <source>
                       Java Blocking Connector       Java Nio Blocking 
Connector       APR Connector
    Classname              Http11Protocol               Http11NioProtocol       
  Http11AprProtocol
    Tomcat Version        3.x 4.x 5.x 6.x               6.x                     
         5.5.x 6.x
    Support Polling         NO                              YES                 
            YES
    Polling Size              N/A                    Unlimited - Restricted by 
mem   Unlimited - Configurable
    Read HTTP Request   Blocking                     Non Blocking               
    Blocking
    Read HTTP Body       Blocking                     Sim Blocking              
     Blocking
    Write HTTP Response  Blocking                    Sim Blocking               
    Blocking
    SSL Support             Java SSL                    Java SSL                
       OpenSSL
    SSL Handshake         Blocking                     Non blocking             
      Blocking
    Max Connections       maxThreads                See polling size            
   See polling size


you can configure the NIOConnector with attributes and valves as mentioned 
above or can implement Tribes on TC which uses Tribes

http://tomcat.apache.org/tomcat-6.0-doc/tribes/introduction.html


Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 

> Date: Mon, 28 Jun 2010 01:28:15 -0700
> From: roger.var...@googlemail.com
> To: user@struts.apache.org
> Subject: Struts 2, Comet & WebSockets
> 
> 
> Hi
> 
> Does Struts 2 have support for (or plans for supporting) either Comet
> processing or HTML5 WebSockets. Googling suggests that the answer for Comet
> may be no, but the latest page I've found that states this, is from 2008!
> 
> Regards 
> -- 
> View this message in context: 
> http://old.nabble.com/Struts-2%2C-Comet---WebSockets-tp29008515p29008515.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
                                          
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

Reply via email to