2 new revisions:

Revision: ebc6f53e0c83
Author:   Alexandre Mendonça <ammendonca>
Date:     Wed Jan  9 18:46:19 2013
Log:      Diameter Stack: Make Peer FSM thread count configurable...
http://code.google.com/p/jdiameter/source/detail?r=ebc6f53e0c83

Revision: 593acd2098a8
Author:   Alexandre Mendonça <ammendonca>
Date:     Wed Jan  9 18:47:08 2013
Log: Documentation for 'Diameter Stack: Make Peer FSM thread count configur...
http://code.google.com/p/jdiameter/source/detail?r=593acd2098a8

==============================================================================
Revision: ebc6f53e0c83
Author:   Alexandre Mendonça <ammendonca>
Date:     Wed Jan  9 18:46:19 2013
Log:      Diameter Stack: Make Peer FSM thread count configurable

Fixes Issue 30

http://code.google.com/p/jdiameter/source/detail?r=ebc6f53e0c83

Modified:
/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/fsm/PeerFSMImpl.java /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/Parameters.java /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/XMLConfiguration.java /core/jdiameter/impl/src/main/java/org/jdiameter/server/impl/helpers/XMLConfiguration.java
 /core/jdiameter/impl/src/main/resources/META-INF/jdiameter-client.xsd
 /core/jdiameter/impl/src/main/resources/META-INF/jdiameter-server.xsd
 /core/mux/sar-jboss-4/src/main/resources/config/jdiameter-config.xml
 /core/mux/sar-jboss-5/src/main/resources/config/jdiameter-config.xml

=======================================
--- /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/fsm/PeerFSMImpl.java Tue Jan 8 18:07:56 2013 +++ /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/fsm/PeerFSMImpl.java Wed Jan 9 18:46:19 2013
@@ -28,6 +28,7 @@
 import static org.jdiameter.client.impl.helpers.Parameters.DpaTimeOut;
 import static org.jdiameter.client.impl.helpers.Parameters.DwaTimeOut;
 import static org.jdiameter.client.impl.helpers.Parameters.IacTimeOut;
+import static org.jdiameter.client.impl.helpers.Parameters.PeerFSMThreadCount;
 import static org.jdiameter.client.impl.helpers.Parameters.QueueSize;
 import static org.jdiameter.client.impl.helpers.Parameters.RecTimeOut;

@@ -82,7 +83,7 @@
protected long CEA_TIMEOUT = 0, IAC_TIMEOUT = 0, REC_TIMEOUT = 0, DWA_TIMEOUT = 0, DPA_TIMEOUT = 0;

   //PCB made FSM queue multi-threaded
-  private static final int FSM_THREAD_COUNT = 3;
+  private static int FSM_THREAD_COUNT = 3;

protected final StateEvent timeOutEvent = new FsmEvent(EventTypes.TIMEOUT_EVENT);
   protected Random random = new Random();
@@ -111,6 +112,7 @@
     this.listeners = new ConcurrentLinkedQueue<StateChangeListener>();
     loadTimeOuts(config);
     this.concurrentFactory = concurrentFactory;
+ FSM_THREAD_COUNT = config.getIntValue(PeerFSMThreadCount.ordinal(), (Integer) PeerFSMThreadCount.defValue());
     runQueueProcessing();
   }

@@ -218,7 +220,7 @@
           }
         }
         //PCB added logging
-        logger.debug("FSM Thread is exiting");
+ logger.debug("FSM Thread {} is exiting", Thread.currentThread().getName());
         //this happens when peer FSM is down, lets remove stat
         statisticFactory.removeStatistic(queueStat);
         queueStat = null;
=======================================
--- /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/Parameters.java Wed Mar 14 17:28:31 2012 +++ /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/Parameters.java Wed Jan 9 18:46:19 2013
@@ -104,6 +104,11 @@
    */
public static final Parameters RecTimeOut = new Parameters("RecTimeOut", Long.class, 10000L);

+  /**
+   * Peer FSM Thread Count property
+   */
+ public static final Parameters PeerFSMThreadCount = new Parameters("PeerFSMThreadCount", Integer.class, 3);
+
   /**
    * Orig_host avp set as URI into CER message
    */
=======================================
--- /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/XMLConfiguration.java Wed Mar 14 17:28:31 2012 +++ /core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/XMLConfiguration.java Wed Jan 9 18:46:19 2013
@@ -53,6 +53,7 @@
 import static org.jdiameter.client.impl.helpers.Parameters.OwnRealm;
 import static org.jdiameter.client.impl.helpers.Parameters.OwnVendorID;
 import static org.jdiameter.client.impl.helpers.Parameters.PeerIp;
+import static org.jdiameter.client.impl.helpers.Parameters.PeerFSMThreadCount; import static org.jdiameter.client.impl.helpers.Parameters.PeerLocalPortRange;
 import static org.jdiameter.client.impl.helpers.Parameters.PeerName;
 import static org.jdiameter.client.impl.helpers.Parameters.PeerRating;
@@ -304,6 +305,7 @@
else if (nodeName.equals("DwaTimeOut")) { add(DwaTimeOut, getLongValue(c.item(i))); } else if (nodeName.equals("DpaTimeOut")) { add(DpaTimeOut, getLongValue(c.item(i))); } else if (nodeName.equals("RecTimeOut")) { add(RecTimeOut, getLongValue(c.item(i))); } + else if (nodeName.equals("PeerFSMThreadCount")) { add(PeerFSMThreadCount, getIntValue(c.item(i)));} else if (nodeName.equals("Statistics")) { addStatisticLogger(Statistics, c.item(i)); } else if (nodeName.equals("Concurrent")) { addConcurrent(Concurrent, c.item(i)); } else if (nodeName.equals("Dictionary")) { addDictionary(Dictionary, c.item(i)); }
=======================================
--- /core/jdiameter/impl/src/main/java/org/jdiameter/server/impl/helpers/XMLConfiguration.java Tue May 22 18:48:38 2012 +++ /core/jdiameter/impl/src/main/java/org/jdiameter/server/impl/helpers/XMLConfiguration.java Wed Jan 9 18:46:19 2013
@@ -38,6 +38,7 @@
 import static org.jdiameter.client.impl.helpers.Parameters.KDPwd;
 import static org.jdiameter.client.impl.helpers.Parameters.KDStore;
 import static org.jdiameter.client.impl.helpers.Parameters.KeyData;
+import static org.jdiameter.client.impl.helpers.Parameters.PeerFSMThreadCount;
 import static org.jdiameter.client.impl.helpers.Parameters.Properties;
 import static org.jdiameter.client.impl.helpers.Parameters.PropertyName;
 import static org.jdiameter.client.impl.helpers.Parameters.PropertyValue;
@@ -249,6 +250,7 @@
else if (nodeName.equals("DpaTimeOut")) { add(DpaTimeOut, getLongValue(c.item(i))); } else if (nodeName.equals("RecTimeOut")) { add(RecTimeOut, getLongValue(c.item(i))); } else if (nodeName.equals("ThreadPool")) { addThreadPool(c.item(i)); } + else if (nodeName.equals("PeerFSMThreadCount")) { add(PeerFSMThreadCount, getIntValue(c.item(i)));} else if (nodeName.equals("Statistics")) { addStatisticLogger(Statistics, c.item(i)); } else if (nodeName.equals("Concurrent")) { addConcurrent(Concurrent, c.item(i)); } else if (nodeName.equals("Dictionary")) { addDictionary(Dictionary, c.item(i)); }
=======================================
--- /core/jdiameter/impl/src/main/resources/META-INF/jdiameter-client.xsd Mon Apr 2 11:33:48 2012 +++ /core/jdiameter/impl/src/main/resources/META-INF/jdiameter-client.xsd Wed Jan 9 18:46:19 2013
@@ -215,6 +215,14 @@
<xsi:attribute name="value" type="xsi:long" use="required"/>
                </xsi:complexType>
             </xsi:element>
+ <xsi:element name="PeerFSMThreadCount" minOccurs="0" maxOccurs="1">
+                <xsi:annotation>
+ <xsi:documentation>Peer FSM Thread Count.</xsi:documentation>
+                </xsi:annotation>
+                <xsi:complexType>
+ <xsi:attribute name="value" type="xsi:integer" use="required"/>
+               </xsi:complexType>
+            </xsi:element>
             <xsi:element name="Statistics" minOccurs="0" maxOccurs="1">
                 <xsi:annotation>
<xsi:documentation>Statistics configuration</xsi:documentation>
=======================================
--- /core/jdiameter/impl/src/main/resources/META-INF/jdiameter-server.xsd Tue May 22 18:48:38 2012 +++ /core/jdiameter/impl/src/main/resources/META-INF/jdiameter-server.xsd Wed Jan 9 18:46:19 2013
@@ -281,6 +281,14 @@
<xsi:attribute name="value" type="xsi:long" use="required"/>
                </xsi:complexType>
             </xsi:element>
+ <xsi:element name="PeerFSMThreadCount" minOccurs="0" maxOccurs="1">
+                <xsi:annotation>
+ <xsi:documentation>Peer FSM Thread Count.</xsi:documentation>
+                </xsi:annotation>
+                <xsi:complexType>
+ <xsi:attribute name="value" type="xsi:integer" use="required"/>
+               </xsi:complexType>
+            </xsi:element>
             <xsi:element name="Statistics" minOccurs="0" maxOccurs="1">
                 <xsi:annotation>
<xsi:documentation>Statistics configuration</xsi:documentation>
=======================================
--- /core/mux/sar-jboss-4/src/main/resources/config/jdiameter-config.xml Tue Feb 1 10:30:16 2011 +++ /core/mux/sar-jboss-4/src/main/resources/config/jdiameter-config.xml Wed Jan 9 18:46:19 2013
@@ -35,6 +35,7 @@
     <DwaTimeOut value="10000" />
     <DpaTimeOut value="5000" />
     <RecTimeOut value="10000" />
+       <PeerFSMThreadCount value="3" />
<Statistics pause="30000" delay="30000" enabled="false" active_records="Concurrent,ScheduledExecService,Network,ScheduledExecService,AppGenRequestPerSecond,NetGenRequestPerSecond,Peer,Peer.local,PeerFSM"/>
     <Concurrent>
        <Entity name="ThreadGroup" size="64"/>
=======================================
--- /core/mux/sar-jboss-5/src/main/resources/config/jdiameter-config.xml Tue May 22 18:49:55 2012 +++ /core/mux/sar-jboss-5/src/main/resources/config/jdiameter-config.xml Wed Jan 9 18:46:19 2013
@@ -2,7 +2,7 @@
 <Configuration xmlns="http://www.jdiameter.org/jdiameter-server";>

   <LocalPeer>
-    <URI value="aaa://127.0.0.1:3868" />
+    <URI value="aaa://uas.mobicents.org:3868" />
<!-- URI value="aaa://mobicents.open-ims.test:1812" /--> <!-- OpenIMS Example -->
     <IPAddresses>
       <IPAddress value="127.0.0.1" />
@@ -25,7 +25,7 @@

   <Parameters>
     <AcceptUndefinedPeer value="true" />
-    <DuplicateProtection value="true" />
+    <DuplicateProtection value="false" />
     <DuplicateTimer value="240000" />
     <DuplicateSize value="5000" />
<UseUriAsFqdn value="false" /> <!-- Needed for Ericsson Emulator (set to true) -->
@@ -38,6 +38,9 @@
     <DpaTimeOut value="5000" />
     <RecTimeOut value="10000" />

+       <!-- Peer FSM Thread Count Configuration -->
+       <PeerFSMThreadCount value="3" />
+
     <!-- Statistics Configuration -->
<Statistics pause="30000" delay="30000" enabled="false" active_records="Concurrent,ScheduledExecService,Network,ScheduledExecService,AppGenRequestPerSecond,NetGenRequestPerSecond,Peer,Peer.local,PeerFSM"/>


==============================================================================
Revision: 593acd2098a8
Author:   Alexandre Mendonça <ammendonca>
Date:     Wed Jan  9 18:47:08 2013
Log: Documentation for 'Diameter Stack: Make Peer FSM thread count configurable'

Update Issue 30
Updated documentation

http://code.google.com/p/jdiameter/source/detail?r=593acd2098a8

Modified:
/core/docs/sources/src/main/resources/en-US/Section-JDiameter-Configuration.xml

=======================================
--- /core/docs/sources/src/main/resources/en-US/Section-JDiameter-Configuration.xml Fri Jun 1 09:10:10 2012 +++ /core/docs/sources/src/main/resources/en-US/Section-JDiameter-Configuration.xml Wed Jan 9 18:47:08 2013
@@ -168,6 +168,9 @@
        <DpaTimeOut value="5000"/>
        <RecTimeOut value="10000"/>

+       <!-- Peer FSM Thread Count Configuration -->
+       <PeerFSMThreadCount value="3" />
+
        <Concurrent>
                <Entity name="ThreadGroup" size="64"/>
                <Entity name="ProcessingMessageTimer" size="1"/>
@@ -263,6 +266,12 @@
<para>Determines how long it takes for the reconnection procedure to timeout. The delay is in milliseconds.</para>
                        </listitem>
                </varlistentry>
+                <varlistentry>
+                        <term>&lt;PeerFSMThreadCount&gt;</term>
+                        <listitem>
+ <para>Determines the number of threads for handling events in the Peer FSM.</para>
+                        </listitem>
+                </varlistentry>
                <varlistentry>
                        <term>&lt;Concurrent /&gt;</term>
                        <listitem>
@@ -454,6 +463,9 @@
                <DwaTimeOut value="10000" />
                <DpaTimeOut value="5000" />
                <RecTimeOut value="10000" />
+
+               <PeerFSMThreadCount value="3" />
+
                <Concurrent>
                         <Entity name="ThreadGroup" size="64"/>
                         <Entity name="ProcessingMessageTimer" size="1"/>

Reply via email to