Disable deployment scanner in JBoss

1 Dec

If you do not plan on using hot deployment feature it makes sense to disable the scanner feature. It is advised to disable scanning for most productions systems. It takes up lot of cpu.

You can find cpu utilization using mbean in jboss jmx-console. Brose http://localhost:8080/jmx-console/ and search for ServerInfo on the page you should find type=ServerInfo under jboss.system. Alternatively you can filter by typing type=ServerInfo. Invoke the java.lang.String listThreadCpuUtilization() mbean operation and you should see an entry for ScannerThread.

There are other useful operations in ServerInfo like listThreadDump() and listMemoryPools() which can be used while tuning your jboss.Scanning can be disabled in jboss-service.xml. Open jboss-service.xml from the appropriate jboss instance and search for ScanEnabled. This file well documented and is self explanatory. Change the setting to false.

<attribute name="ScanEnabled">true</attribute>

to

<attribute name="ScanEnabled">false</attribute>

Restart your jboss and scan should be disabled.