Improving JBoss 5 slow startup

2020-05-19 06:01发布

We upgraded from JBoss 4 (and JDK 5) to JBoss 5 (and JDK 6). The problem is that the start time has gone from 1.5 minutes (on JBoss 4) to more than 4 minutes.

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

It seems like the component that is taking JBoss the longest time to initialize is the 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

From the DEBUG server log, I get these lines at the problematic time:

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

There is no EJB in the project.

The memory settings are:

 -Xms128m -Xmx512m -XX:MaxPermSize=256m

Do you have any idea how JBoss start time can be improved?

Update: so far no luck, I tried shreeni's suggestion (changed the scanning xmls). The server is not running in debug mode so MicSim's suggestion is not relevant

10条回答
唯我独甜
2楼-- · 2020-05-19 06:17

You could refer to this link to avoid unnecessary annotation scanning which could speedup your server start

查看更多
一纸荒年 Trace。
3楼-- · 2020-05-19 06:17

Do you need the JMX console application? Pragmatic thing would be to un-deploy it from the server, you could still use the jconsole or jvisualvm for basically the same thing.

查看更多
手持菜刀,她持情操
4楼-- · 2020-05-19 06:20

I suppose you are starting in debug mode. This mode can be up to 3 times slower than normal mode. But there might be also a problem when switching from JDK5 to JDK6. I found this solution here on the net:

I've solved that. It's a debugging issue. I've changed my debug settings from:

wrapper.java.additional.26=-Xdebug
wrapper.java.additional.27=-Xnoagent
wrapper.java.additional.28=-Djava.compiler=NONE
wrapper.java.additional.27=-Xrunjdwp:transport=dt_socket,address=7199,server=y,suspend=n

to:

wrapper.java.additional.26=-Xdebug
wrapper.java.additional.27=-Xrunjdwp:transport=dt_socket,address=7199,server=y,suspend=n

and JBoss becomes fast again.

Hope this helps.

查看更多
虎瘦雄心在
5楼-- · 2020-05-19 06:22

I had an issue like this but I found a good improvement by setting the initial and max heap size to same values, I mean:

 -Xms512m -Xmx512m

With this, I improved from 4 to 2 minutes the starting time.

查看更多
干净又极端
6楼-- · 2020-05-19 06:27

I'm using JBoss 5.1.0 with a Macbook pro (2.26ghz 4gb) without applications it start in 54s

15:00:26,449 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 54s:720ms

I made a new configuration based on the "default". The JMS dataosurce points to a Postgres database instead of the "Hypersonic Database" (in memory database)

查看更多
Lonely孤独者°
7楼-- · 2020-05-19 06:30

That is an awfully big gap in the logs. I suggest changing the log configuration to log everything at DEBUG level, rather than INFO. This will generate an awful lot more log entries, but hopefully will help you narrow it down.

The easiest way to do this is to set the -Djboss.server.log.threshold=DEBUG system property when you start JBoss

查看更多
登录 后发表回答