Enabling JMX on TIBCO BusinessWorks AppNode vs. BWAgent - tibco

I was reading this TIBCO doc, https://docs.tibco.com/pub/activematrix_businessworks/6.3.4/doc/html/GUID-BAC813F8-5DDC-4043-86D6-2F5D6C286B02.html, and it mentions this (emphasis mine):
Enable JMX on the AppNode or bwagent by adding the JMX properties in the AppNode or the agent TRA files for remote monitoring.
What are the pros/cons for enabling JMX on the AppNode versus the BWAgent?
FWIW, our system has 20 AppNodes spread across 2 servers (10 per server).
Thanks :)

To add JMX properties in an appnode, add the following line :
java.extended.properties=-Xmx1024m -Xms512m -XX:+UseParNewGC -Dcom.sun.management.jmxremote.port=5000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote=true in the bwappnode-[APPNODE].tra file.
Or you can add it in the bwagent.tra, and all appnodes will inherit this configuration.

Enabling JMX port on Appnode will let you see how the BWEngine has been performing, you could see memory and CPU utilization. And possibly you can have thread dumps.
BWAgent is mere like a hawk agent like in classic BW. I don't believe it helps much.

Related

running tomcat as coherence node

I have a question for someone who is familiar with tomcat and coherence.
I am using tomcat 8 and coherence 12.2.1 now and here I have, maybe not a problem, but interesting case.
I am trying to start web application on tomcat as coherence node. I already know that there is ExtendTcpCacheService and now I am using it to make additional node which can communicate with coherence cluster.
But my question is: Is there a way to make tomcat start node which IS NOT Extend? I mean, I need tomcat to start coherence node but like grizzly rest server (automatically connecting to existing cluster), not like I have it now - it needs all IP addresses and configuration to connect to existing coherence node.
Thank you for any advice!
I am assuming that the other nodes in the cluster have the ExtendTcpCacheService enabled and you just want to disable only this service when running in tomcat. This is easy to do and you can continue to use one cache config file for all cluster nodes but you will need to make a slight change to your coherence cache configuration file. Go to the <proxy-scheme> section pertaining to your ExtendTcpCacheService service and change the <autostart> tag with a system-property attribute as shown below:
<proxy-scheme>
<scheme-name>some-name</scheme-name>
<service-name>ExtendTcpCacheService</service-name>
....
<autostart system-property="ExtendTcpCacheService.enabled">true</autostart>
</proxy-scheme>
In the JVM start-up parameters for Tomcat you will need to pass -DExtendTcpCacheService.enabled=false to turn off starting the service. In the other JVMs you will not need to do anything since this property is on by default.
You can use this feature to modify almost any xml tag in the coherence config using system parameters. More details on this feature is detailed in the coherence docs

VisualVM on new 64-bit laptop with JDK7 can't connect to JMX agent

I have a Spring app that runs fine on WebLogic 10.3.x on my old Win7-32bit laptop with JDK 1.6. I can make a local connection to the app from VisualVM and view JMX properties and execute JMX methods.
I'm now setting up a new Win7-64bit laptop, with JDK 1.7 and WebLogic 12.1.2.0. The app itself works almost without change (I had to add some package overrides in the weblogic-application.xml).
However, when I installed VisualVM (1.3.7) and installed all of the relevant plugins, I can connect to the process, but when I try to open the MBeans tab, it says:
Data not available because JMX connection to the JMX agent could not be established.
There's nothing useful in the VisualVM log. I don't have quick access to the old laptop right now. Is there perhaps a WebLogic command-line option I need in order to allow JMX connections?
I've resolved this. It simply requires setting the "com.sun.management.jmxremote" system property on the JVMs I want to target. Curiously, I found an Oracle docs page that talks about this property, and it says it's not necessary to set this anymore. My experience conflicts with that.

How can i test data source connections configured in Tomcat

I'm moving from Websphere server to Tomcat and looking for any open source tools which might aid the manageability of my application. Any suggestions?
Thanks
At the application level, within the dbcp configuration, you can specify directives like validationQuery and testOnBorrow which perform the same function as WebSphere. You can google "tomcat dbcp" to get more details on the various options.

Tomcat Connection Pool Concept & c3p0 connection pooling?

I have two Java Web Applications running under Tomcat (6.0) and using the Tomcat & c3p0 connection pool as Tomcat Data-source.If I define two Resources (server.xml) for two different Oracle Connection and use c3p0 for connection pool as below which my we applications use, my questions are:
<Resource
name="jdbc/OracleDB"
auth="Container"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
driverClass="oracle.jdbc.OracleDriver"
factory="xxx"
jdbcUrl="jdbc:oracle:thin:#(DESCRIPTION= (LOAD_BALANCE=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xxx)))"
maxPoolSize="10"
minPoolSize="0"
maxIdleTime="60"
maxConnectionAge="600"
acquireIncrement="1"
user="xxx="
password="xxx=" />
<Resource name="jdbc/xxx2DB"
auth="Container"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
driverClass="oracle.jdbc.OracleDriver"
factory="xxx"
jdbcUrl="jdbc:oracle:thin:#xxx:1527:xxx"
maxPoolSize="10"
minPoolSize="0"
acquireIncrement="1"
maxIdleTime="60"
maxConnectionAge="600"
user="xxx"
password="xxx"
/>
Q1. Does the below in server.xml mean that two connection pools are existing in the Tomcat
memory to two different Oracle Instances?
Q2. Do I have to specify any configuration properties (ref:http://www.mchange.com/projects/c3p0/index.html#configuration_properties) , in my case I have a connection to an Oracle RAC instance and another to a single instance of Oracle. Should I take into account
any additional configuration properties in an enterprise environment ?
Q3. Are the below setting valid enough?
Q4. How do I enable c3p0 logging (i have only the jar in Tomcat lib and the above setting for now?
Any advice?
Thanks in advance.
A1: Yes.
A2: Not sure if I got the question right, but you should only specify those connection properties which defaults do not make sense to you. It's probably best to do this in the separate c3p0.properties file and specify which connection which property applies to. Answer to 'additional configuration properties' question requires to know the specifics of your environment. I would recommend looking at idle_test_period setting as these can typically have wrong defaults (make sure this matches relevant setting on the DB end).
A3: Yeah, this looks OK.
A4: You need to specify logging preferences in c3p0.properties or define them in dynamically as System properties. Refer to this chapter of the c3p0 manual.
A1: Yes
A2: Looks right at first glance. You need to be careful with RAC in case you would use distributed transactions - then I believe you would have to specify additional properties.
A3: Looks ok but depending on your task and estimated load I would play with maxIdleTime, acquireIncrement and maxPoolSize. For example with current settings after 60 seconds of inactivity your connection will be closed so next operation requesting connection after 60 seconds would incur penalty in waiting for new connection to open.
A4: http://www.mchange.com/projects/c3p0/index.html#configuring_logging
Advice:
There is a better connection pool from Tomcat 7, which could be used in Tomcat 6 as well. Consider it, especially if you need high performance
Consider connection testing so your application don't get (or get less frequently) exception when db connectivity goes down
It might be preferable to package connection pool and it's configuration within your application vs. in Tomcat. This way application WAR would be self contained so it could be just dropped into wabapps dir of tomcat.

how to monitor memory in a spring + tomcat application?

i have a spring application that i want to optimize , its using much memory, it was fine when few people used it, but numbers scaled a little and i have no idea where to start . Is there a way of knowing which class and methods take what kind of resources ?
I think JMX will be a good start. Using Spring's JMX support, it will be very easy to configure your beans to integrate with JMX.
http://static.springsource.org/spring/docs/3.0.5.RELEASE/reference/jmx.html
The best way to start with this is using a profiler. There are a lot of products out there. I personally like YourKit. It's a matter of preference. Using a profiler you can easily find out the number of instantiated classes from where in the code. You might simply have a memory leak.
In general I think it's a good idea to set up your application server/servlet container to expose their internals over JMX. You'll just have to enable the JMX agent by setting JVM startup parameters. You can then connect to your server and monitor CPU and memory consumption using JConsole or VisualVM. VisualVM provides a simple profiling plugin.

Resources