改进 JBoss 5 慢速启动
我们从 JBoss 4(和 JDK 5)升级到 JBoss 5(和 JDK 6)。问题是开始时间从1.5分钟(在JBoss 4上)增加到4分钟以上。
18:53:35,444 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 3m:9s:262ms
似乎花费JBoss最长时间来初始化的组件是JMX
18:50:41,926 INFO [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss.mx.server.MBeanServerImpl@1adc122[ defaultDomain='jboss' ]
18:52:38,797 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://lharel2/jndi/rmi://lharel2:1090/jmxconnector
从 DEBUG 服务器日志中,我在有问题的时间得到这些行:
2009-12-18 18:51:00,886 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) vfsfile:/C:/QC/Views/QCDev/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/ endpoint mappings:
2009-12-18 18:51:00,886 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (main) Processing unit=jmx-console.war, structure: jmx-console.war
2009-12-18 18:52:35,209 DEBUG [org.jboss.deployment.OptAnnotationMetaDataDeployer] (main) Deployment is metadata-complete, skipping annotation processing, ejbJarMetaData=null, jbossWebMetaData=org.jboss.metadata.web.spec.Web23MetaData@1f, jbossClientMetaData=null, metaDataCompleteIsDefault=false
项目中没有 EJB。
内存设置包括:
-Xms128m -Xmx512m -XX:MaxPermSize=256m
您知道如何改善 JBoss 的启动时间吗?
更新:到目前为止没有运气,我尝试了shreeni的建议(更改了扫描xmls)。服务器未在调试模式下运行,因此 MicSim 的建议不相关