4
JBoss Performance Tuning Server Version Planning to achieve Configuration Tune JBoss Thread Pools in conf/jboss-service.xml When running an application which issues lots of requests (such as EJB invocations) monitor your thread pool. Web Console > MBean jboss.system:service=ThreadPool. if QueueSize>= MaximumPoolSize set a higher MaximumPoolSize Fine tuning the Underlying HTTP connector of JBoss for production settings server.xml and deployed in the root of JBoss web container (JBoss 4.2.0 : "JBOSS_HOME\server\default\deploy\jboss- web.deployer") important parameters: maxThreads - This indicates the maximum number of threads to be allocated for handling client HTTP requests. This figure corresponds to the concurrent users that are going to access the application. Depending on the machine configuration, there is a physical limit beyond which you will need to do clustering. acceptCount - This is the number of request threads that are put in request queue when all available threads are used. When this exceeds, client machines get a request timeout response. compression - If you set this attribute to “force”, the content will be compressed by JBoss and will be send to browser. Browser will extract it and display the page on screen. Enabling compression can substantially reduce bandwidth requirements of your application. web console > MBean jboss.web:name=http- 127.0.0.1-8080,type=ThreadPool. The key attribute : currentThreadsBusy. If it's about 70-80% of the maxThreads,

JBoss Performance Tuning

Embed Size (px)

Citation preview

Page 1: JBoss Performance Tuning

JBoss Performance Tuning

Server Version

Planning to achieve Configuration

Tune JBoss Thread Pools

in conf/jboss-service.xmlWhen running an application which issues lots of requests (such as EJB invocations) monitor your thread pool. Web Console > MBean jboss.system:service=ThreadPool.if QueueSize>= MaximumPoolSize set a higher MaximumPoolSize

Fine tuning the Underlying HTTP connector of JBoss for production settings

server.xml and deployed in the root of JBoss web container (JBoss 4.2.0 : "JBOSS_HOME\server\default\deploy\jboss-web.deployer")

important parameters:maxThreads - This indicates the maximum number of threads to be allocated for handling client HTTP requests. This figure corresponds to the concurrent users that are going to access the application. Depending on the machine configuration, there is a physical limit beyond which you will need to do clustering.acceptCount - This is the number of request threads that are put in request queue when all available threads are used. When this exceeds, client machines get a request timeout response.compression - If you set this attribute to “force”, the content will be compressed by JBoss and will be send to browser. Browser will extract it and display the page on screen. Enabling compression can substantially reduce bandwidth requirements of your application.

web console > MBean jboss.web:name=http-127.0.0.1-8080,type=ThreadPool. The key attribute : currentThreadsBusy. If it's about 70-80% of the maxThreads, consider raising the number of maxThreads.

Turn off JSP Compilation in production. ( In a production server, JSP files won’t change)

deploy/jboss-web.deployer/conf/ web.xml<init-param><param-name>development</param-name><param-value>false</param-value></init-param><init-param><param-name>checkInterval</param-name><param-value>300</param-value></init-param>

5.x/4.2 switch from the standard jrmp service invoker to the pool invoker

In standardjboss.xml (5.x): <invoker-mbean>jboss:service=invoker,type=jrmp</invoker-mbean>4.x

Page 2: JBoss Performance Tuning

Find 4 occurrences of it: stateless-rmi-invoker, clustered-stateless-rmi-invoker, stateful-rmi-invoker,entity-rmi-invoker.

replace this fragment with : <invoker-mbean>jboss:service=invoker,type=pooled</invoker-mbean>

optimize min-pool-size andmax-pool-size

Disable Console logging

Disable Console logging in production and use only the File appender for better logging performance.

Prevent Immediate Flushing

Tune the File Appender by setting the ImmediateFlush attribute to false:

<param name="ImmediateFlush" value="false" />

By default, the File appender performs a flush operation after writing each event, ensuring that the message is immediately written to disk. Setting the ImmediateFlush option to false can drastically reduce I/O activity since theOutput-StreamWriter will buffer logs in memory before writing them to disk.

Change the logging layout to use the log4j date formatters

These can be specified using one of these strings: ABSOLUTE, DATE.For example:<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c] %m%n"/>(~10% boost!!)

circumventancestor loggers

All the logging events captured by the child logger com.sample will be processed by the child logger itself and also by its parent logger com.In log4j, by setting the additivity of the logger to false, you can circumvent ancestor loggers, thus improving the performance significantly.This can be done by configuring the attribute additivity on the logger:

<logger name="com.sample" additivity="false" ><level value="INFO" /><appender-ref ref="CONSOLE"/><appender-ref ref="FILE"/></logger>

Or programmatically with the method: logger.setAdditivity(false);

Page 3: JBoss Performance Tuning

http://www.jaysonjc.com/programming/how-to-configure-jboss-as-production-settings-and-tuning-tips.html

http://community.jboss.org/wiki/JBossASTuningSlimming

http://community.jboss.org/wiki/JBoss5xTuningSlimming

http://www.mastertheboss.com/jboss-application-server/113-jboss-performance-tuning-1.html

http://www.mastertheboss.com/jboss-application-server/130-jboss-performance-tuning-part-2.html

http://books.google.com/books?id=DpHvFpK2omsC