[jboss-cvs] JBoss Messaging SVN: r6861 - in trunk: src/main/org/jboss/messaging/core/journal/impl and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 18 19:54:02 EDT 2009
Author: clebert.suconic at jboss.com
Date: 2009-05-18 19:54:02 -0400 (Mon, 18 May 2009)
New Revision: 6861
Modified:
trunk/docs/user-manual/en/modules/thread-pooling.xml
trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFileFactory.java
Log:
tweaks & adding AIO thread pool explanation
Modified: trunk/docs/user-manual/en/modules/thread-pooling.xml
===================================================================
--- trunk/docs/user-manual/en/modules/thread-pooling.xml 2009-05-18 23:33:37 UTC (rev 6860)
+++ trunk/docs/user-manual/en/modules/thread-pooling.xml 2009-05-18 23:54:02 UTC (rev 6861)
@@ -59,36 +59,48 @@
</section>
<section>
<title>Asychronous IO</title>
- <para>TODO</para>
+ <para>Two threads are used on Asynchronous IO files. One for polling events, and one for
+ writing data. </para>
+ <para>The thread poller is used by the native layer to receive and dispatch events. You
+ will find it on a thread dump with the prefix JBM-AIO-poller-pool. JBoss Messaging
+ uses one poller per opened file on the journal. (there is usually one) and they are
+ aways distributed thorugh a pool.</para>
+ <para>The writing thread is a single thread used to invoke libaio. We do that to avoid
+ context switching on libaio what would cause performance issues. You will find this
+ thread on a thread dump with the prefix JBM-AIO-writer-pool.</para>
</section>
</section>
<section>
<title>Client-Side Thread Management</title>
- <para>On the client side, JBoss Messaging maintains a single static scheduled thread pool and a single static general thread pool
- for use by all clients using the same classloader in that JVM instance.</para>
- <para>The static scheduled thread pool has a maximum size of <literal>2</literal> threads, and the general purpose thread
- pool has an unbounded maximum size.</para>
- <para>If required JBoss Messaging can also be configured so that each <literal>ClientSessionFactory</literal> instance does not use
- these static pools but instead maintains its own scheduled and general purpose pool. Any sessions created from that <literal>ClientSessionFactory</literal>
- will use those pools instead.</para>
- <para>To configure a <literal>ClientSessionFactory</literal> instance to use its own pools, simply use the appropriate setter methods
- immediately after creation, for example:</para>
+ <para>On the client side, JBoss Messaging maintains a single static scheduled thread pool
+ and a single static general thread pool for use by all clients using the same
+ classloader in that JVM instance.</para>
+ <para>The static scheduled thread pool has a maximum size of <literal>2</literal> threads,
+ and the general purpose thread pool has an unbounded maximum size.</para>
+ <para>If required JBoss Messaging can also be configured so that each <literal
+ >ClientSessionFactory</literal> instance does not use these static pools but instead
+ maintains its own scheduled and general purpose pool. Any sessions created from that
+ <literal>ClientSessionFactory</literal> will use those pools instead.</para>
+ <para>To configure a <literal>ClientSessionFactory</literal> instance to use its own pools,
+ simply use the appropriate setter methods immediately after creation, for
+ example:</para>
<programlisting>
ClientSessionFactory myFactory = new ClientSessionFactory(...);
myFactory.setUseGlobalPools(false);
myFactory.setScheduledThreadPoolMaxSize(10);
myFactory.setThreadPoolMaxSize(-1);
</programlisting>
- <para>If you're using the JMS API, you can set the same parameters directly on the <literal>JBossConnectionFactory</literal>
- instance, for example:</para>
+ <para>If you're using the JMS API, you can set the same parameters directly on the <literal
+ >JBossConnectionFactory</literal> instance, for example:</para>
<programlisting>
JBossConnectionFactory myFactory = new JBossConnectionFactory(...);
myFactory.setUseGlobalPools(false);
myFactory.setScheduledThreadPoolMaxSize(10);
myFactory.setThreadPoolMaxSize(-1);
</programlisting>
- <para>If you're using JNDI to instantiate <literal>JBossConnectionFactory</literal> instances, you can also set these parameters in the
- <literal>jbm-jms.xml</literal> file where you describe your connection factory, for example:</para>
+ <para>If you're using JNDI to instantiate <literal>JBossConnectionFactory</literal>
+ instances, you can also set these parameters in the <literal>jbm-jms.xml</literal> file
+ where you describe your connection factory, for example:</para>
<programlisting>
<connection-factory name="ConnectionFactory">
<connector-ref connector-name="netty"/>
@@ -101,6 +113,5 @@
<thread-pool-max-size>-1</thread-pool-max-size>
</connection-factory>
</programlisting>
-
</section>
</chapter>
Modified: trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFileFactory.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFileFactory.java 2009-05-18 23:33:37 UTC (rev 6860)
+++ trunk/src/main/org/jboss/messaging/core/journal/impl/AIOSequentialFileFactory.java 2009-05-18 23:54:02 UTC (rev 6861)
@@ -25,7 +25,6 @@
import java.nio.ByteBuffer;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
import org.jboss.messaging.core.asyncio.impl.AsynchronousFileImpl;
import org.jboss.messaging.core.journal.SequentialFile;
@@ -44,7 +43,7 @@
/** A single AIO write executor for every AIO File.
* This is used only for AIO & instant operations. We only need one executor-thread for the entire journal as we always have only one active file.
* And even if we had multiple files at a given moment, this should still be ok, as we control max-io in a semaphore, guaranteeing AIO calls don't block on disk calls */
- private final Executor writeExecutor = Executors.newSingleThreadExecutor(new JBMThreadFactory("JBM-AIO-poller-pool" + System.identityHashCode(this), true));
+ private final Executor writeExecutor = Executors.newSingleThreadExecutor(new JBMThreadFactory("JBM-AIO-writer-pool" + System.identityHashCode(this), true));
private final Executor pollerExecutor = Executors.newCachedThreadPool(new JBMThreadFactory("JBM-AIO-poller-pool" + System.identityHashCode(this), true));
More information about the jboss-cvs-commits
mailing list