我們有兩個在JBoss下運行的應用程序。我正在尋找一種方法來減少服務器的開銷。主應用程序在Tomcat下運行。另一個應用程序由MBeans組成。有沒有辦法在Tomcat下運行MBean?MBean可以在Tomcat下運行嗎?
讚賞替代建議。
我們有兩個在JBoss下運行的應用程序。我正在尋找一種方法來減少服務器的開銷。主應用程序在Tomcat下運行。另一個應用程序由MBeans組成。有沒有辦法在Tomcat下運行MBean?MBean可以在Tomcat下運行嗎?
讚賞替代建議。
MBean是JRE中包含的JMX規範的一部分。應該可以在Tomcat下運行MBean。 Tomcat 5或更高版本提供MBean服務器。
您可以使用以下JVM參數來啓動Tomcat的與MBean的啓用
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=4444 (could be anything)
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
試試這個http://community.jboss.org/wiki/JBossASTuningSliming。當然你有很多沒有使用的服務。
你也應該使用MBean服務器是在Tomcat中 - 你必須找到一個通過:
// find the existing MBean server (tomcat's) in lieu of
// creating our own
//
ArrayList<MBeanServer> mbservers = MBeanServerFactory
.findMBeanServer(null);
int nservers = mbservers.size();
if (nservers > 0) {
//
// TODO: A better way to get the currently active server ?
// For some reason, every time the webapp is reloaded there is one
// more instance of the MBeanServer
mbserver = (MBeanServer) mbservers.get(nservers - 1);
}
if (mbserver == null) {
mbserver = MBeanServerFactory.createMBeanServer();
}