Tuesday, August 6, 2013

Performance Issues In Soa Suite 11g (ps5+)

Do you release that after PS5 in case of working threads are full and scheduled threads are increasing then there will be locks on java threads. This will lead to a decrease in performance. To avoid that; be sure to put some limit on your work sources (such as putting minimumDelayBetweenMessages on dequeue mediators). So we can say that it is crucial to monitor your "invoke" and "worker" threads all time but it's not flexible to monitor it from EM console. Using the code parts below you can write your small java code to monitor all threads in all your servers.

1) Connect to admin server

JMXConnector m_connector;
MBeanServerConnection m_connection;


JMXServiceURL serviceURL = new JMXServiceURL("t3","192.168.1.1",7000,"/jndi/weblogic.management.mbeanservers.domainruntime");

System.out.println("Connecting to: " + serviceURL);
Hashtable h = new Hashtable();
h.put("java.naming.security.principal", "wladmin");
h.put("java.naming.security.credentials", "Welcome1");
h.put("jmx.remote.protocol.provider.pkgs", "weblogic.management.remote");
m_connector = JMXConnectorFactory.newJMXConnector(serviceURL, h);
m_connector.connect();
m_connection = m_connector.getMBeanServerConnection();



2) Read Dispatcher Trace

String result=(String)m_connection.invoke("oracle.as.soainfra.bpm:Location=SERVER_NAME,name=CubeDispatcher,type=bpel", "readXMLDispatcherTrace",null,null);

3) Query the results


DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc ;
XPathFactory xPathfactory = XPathFactory.newInstance();
XPath xpath = xPathfactory.newXPath();
XPathExpression expr;
String invokeScheduled="//dispatcher-trace/invokeSet/invokeQueue/scheduled/@count";
String invokeWorking="//dispatcher-trace/invokeSet/invokeQueue/working/@count";
String engineScheduled="//dispatcher-trace/engineSet/instanceQueue/scheduled/@count";   
String engineWorking="//dispatcher-trace/engineSet/instanceQueue/working/@count";   
int is=0;   
int iw=0;   
int es=0;
int ew=0;   


inStream.setCharacterStream(new StringReader(result));  
is=Integer.parseInt(xpath.evaluate(invokeScheduled,inStream)); 
System.out.println("Invoke Scheduled: "+is);   
  
inStream.setCharacterStream(new StringReader(result));  
iw=Integer.parseInt(xpath.evaluate(invokeWorking,inStream));   
System.out.println("Invoke Working: "+iw); 
  
inStream.setCharacterStream(new StringReader(result));  
es=Integer.parseInt(xpath.evaluate(engineScheduled,inStream)); 
System.out.println("Engine Scheduled: "+es);   
  
inStream.setCharacterStream(new StringReader(result));  
ew=Integer.parseInt(xpath.evaluate(engineWorking,inStream));   
System.out.println("Engine Working: "+ew);  



4) Make a loop mechanism in order to query all your servers.





No comments:

Post a Comment