青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

我的程序人生

jboss性能優(yōu)化(2)

http://wiki.jboss.org/wiki/JBossASTuningSliming

Preface

This advice is primarily on how to tune and/or slim JBossAS. The two concepts are orthogonal in most cases. While reducing idle service threads through slimming won't have a large impact on performance, using less memory and resources may allow you to tune other performance aspects. Of course this does reduce startup time. Furthermore, as a general security concept -- remove services you don't use. We will separate the two categories: slimming and tuning. We start by using the default configuration and trimming from there (for clustering that will be the topic of a later wiki page ;-) ). This advice does not involve areas of tuning that crosscut developer and administrative roles (application tuning such as cache sizes). This is primarily advice for administrative tuning.

Note for those concerned that this advice will make a technically non-J2EE-compliant instance of JBoss (3.2.6 is not compliant anyhow) as removing key J2EE services would cause JBoss to fail the TCK. Most performance tuning/administrative tasks done in real-world installations technically fall in this category.

Assume that you have copied the server/default directory and its subdirectories to server/slim.

Tuning

Java Virtual Machine

  • TuneVMGarbageCollection or Tune JDK 5 Garbage Collection for your machine and memory size
  • Use a 64 bit machine and 64 bit VM so that you can use large heap sizes, larger than 2-4GB typically. 64 bit support is available on all recent SPARC/Solaris boxes running Solaris 9 or later, Itanium with JDK 1.4, or JDK 5 on Linux x64.
  • DO NOT USE -d64 (64-bit) if you do not use ABOVE the maximum 32 bit heap space (2-4 GB of heap). Using 64 bit addressing requires MORE memory to do the same amount of work and provides no advantage for applications that do not need this much memory.
  • Avoid extra large heaps but avoid extra small heaps. (We cannot tell you what qualifies because it depends on what you're doing). This affects generational garbage collection and total time to scan the heap. It is difficult to tune a small heap effectively (even if your app only uses 200MB, if you're using parallel garbage collection + CMS, then you're going to need well above 512MB). Oversize heaps spend needless time scanning memory for garbage collection.
  • Avoid the Sun 1.4 VM. JDK 5 is VASTLY better especially in the area of garbage collection.
  • Use the -server option but use either of -XX:ThreadStackSize?=128k (Solaris) or -Xss128k (every other platform). On Solaris -Xss128k does nothing (you can only set LARGER thread stack sizes). This allows you to create more threads by using less memory per thread but might result in blown stacks with extremely recursive code. Still, 128k stack is still nothing to shake a stick at.
  • You really need to understand generational garbage collectors to tune this properly and you really have to do load testing (OpenSTA?, JMeter, etc) to know for sure.
  • You really should use a multi-processor machine with more than 2 processors and use various parallel and concurrent garbage collection options (we cover this in Advanced JBoss Training hint hint) for maximum performance and high garbage collector throughput. However, you really need to understand how garbage collection works to tune this well. JDK 5 is mostly self-tuning.
  • JDK 1.4's default NewSize is not a good guess. Bad rule of thumb: < 20% is a good NewSize. Above 20% is dangerous due to a nasty JDK bug which can cause it to psychotically run all full garbage collections and never unsuspend or free up enough memory. JDK 5 does not seem to exhibit this bug and seems to pick more sane defaults.

JBoss/Java on Linux

If you are running JBoss AS on a Linux server, you should read this article written by Andrew Oliver, one of JBoss, a division of Red Hat, consultants on how tune JBoss/Java in a Linux server

Tomcat

  • Edit your server/slim/jbossweb-tomcat5?.sar/server.xml
  • Check the XML document for connectors you are using. For example, the HTTP connector:

<Connector port="8080" address="${jboss.bind.address}"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>

  • You should have enough threads (maxThreads) to handle (rule of thumb) 25% more than your maximum expected load (concurrent hits coming in at once)
  • You should have minSpareThreads equal just a little more than your normal load
  • You should have maxSpareThreads equal just a little more than your peak load
  • minSpareThreads
    means "on start up, always keep at least this many threads waiting idle"
  • maxSpareThreads
    means "if we ever go above minSpareThreads then always keep maxSpareThreads waiting idle"

  • Remove any unnecessary valves and logging. If you're not using JBoss's security, remove the security valve (see below).
  • Precompile JSPs. (The built-in compiler is fairly fast, it may not be worthwhile for small sites.)
  • Turn off "development" mode in you sever/slim/jbossweb-tomcat50.sar/conf/web.xml

RMI for Remote Invocations

By default, JBoss creates a new thread for every RMI request that comes in. This is not generally efficient on a large system. Secondly, it can be dangerous to allow unrestrained connections in the case of performance or traffic spikes or run-away connection creating clients. To remedy this you should consider switching to the pooled invoker.

  • Edit server/slim/conf/standardjboss.xml
  • Change all of the proxy bindings to the pooled invoker by changing every XML fragment reading:

<invoker-mbean>jboss:service=invoker,type=jrmp</invoker-mbean>

to

<invoker-mbean>jboss:service=invoker,type=pooled</invoker-mbean>

JBoss also has a mostly undocumented PooledInvokerHA you may try.

Log4j

Logging has a profound effect on performance. Changing the logging level to TRACE can bring the JBossAS to a crawl. Changing it to ERROR (or WARN) can speed things up dramatically.

  • By default, JBoss logs both to the console and server.log and by default it uses level "INFO".
  • Consider not logging to System.out (you may still want to redirect it to catch JVM errors)
  • Consider changing the log level to ERROR. Remember that JBoss watches its log4j config file for changes and you can always change configuration at runtime.
  • Add a category filter for your Java class hierarchy.

To turn off console logging:

  • Edit server/slim/conf/log4j.xml
  • Change the following XML fragment:

<root>
<appender-ref ref=CONSOLE"/>
<appender-ref ref="FILE"/>
</root>

make it read

<root>
<appender-ref ref="FILE"/>
</root>

  • You can then remove this fragment:

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>

To change the log level:

  • Edit server/slim/conf/log4j.xml
  • Remove/comment these XML fragments:

<category name="org.apache">
<priority value="INFO"/>
</category>
<!-- Limit org.jgroups category to INFO -->
<category name="org.jgroups">
<priority value="INFO"/>
</category>

  • Change the root category by changing this XML fragment:

<root>
<appender-ref ref="CONSOLE"/> <!-- you may have removed this earlier -->
<appender-ref ref="FILE"/>
</root>

to look like this

<root>
<priority value="ERROR" />
<appender-ref ref="CONSOLE"/> <!-- you may have removed this earlier -->
<appender-ref ref="FILE"/>
</root>

And finally, probably the most important thing in log4j, make sure you limit the logging level on your own class hierarchy. This assumes that you are using log4j as it was intended and not writing everything to System.out. This will significantly reduce the overhead of log4j and allow you to fully enjoy the benefits of calls like

if (log.isDebugEnabled())...

. If you don't do this then all the logging in your code will get formatted and passed to the appender, and the threshold on the appender will weed out the log messages. This can generate a significant amount of garbage. Assuming your java package starts with "a.b", add something like this to log4j.xml:

<!-- Limit a.b category to INFO -->
<category name="a.b">
<priority value="INFO"/>
</category>

This can be added in the same area where you find the category filters for org.apache and org.jboss (see above).

Deployment Scanner

  • The deployment scanner scanning every 5 seconds eats up cycles especially on systems with a slow filesystem (*cough* NTFS *cough*).
  • See the below slimming stuff on how to turn the number of seconds such that it happens less frequently or not at all

Stateless Session Beans

  • EJB 1.x-2.x stateless session beans operate with an ill-advised pooling model (required by the specification). If you find that you need more than the default (10) instances consider setting the minimum pool size:

edit

server/slim/conf/standardjboss.xml

, scroll down to:

<container-configuration>
<container-name>Standard Stateless SessionBean</container-name>
<call-logging>false</call-logging>
<invoker-proxy-binding-name>stateless-rmi-invoker</invoker-proxy-binding-name>
<container-interceptors>

and find:

<container-pool-conf>
<MaximumSize>100</MaximumSize>
</container-pool-conf>
</container-configuration>

change it to read:

<container-pool-conf>
<MinimumSize>100</MinimumSize>
<MaximumSize>100</MaximumSize>
<strictMaximumSize/>
<strictTimeout>30000</strictTimeout>
</container-pool-conf>
</container-configuration>

For the most part a server environment doesn't want these pools growing and shrinking (because it causes memory-fragmentation and thats worse than latent heap usage). From a performance standpoint, the nuber should be big enough to serve all your requests with no blocking.

CMP tuning

  • Read this: http://www.artima.com/forums/flat.jsp?forum=141&thread=24532
  • and this: http://www.onjava.com/pub/a/onjava/2003/05/28/jboss_optimization.html
  • now ditch CMP and use JBossHibernate instead

Connection Pools

  • Don't use XA versions unless you really know you need them. XA connections do not have good performance.
  • Use database specific "ping" support where available for "check-connection" or use database-specific driver fail-over support rather than checking connections at all. (remember that not all tuning options may be feasible in your environment, we're talking optimal)

Slimming

When not using the mail-service (J2EE standard JavaMail client)

  • remove server/slim/deploy/mail-service.xml
  • remove server/slim/lib/mail* (mail-plugin.jar, mail.jar - JavaMail stuff)
  • remove server/slim/lib/activation.jar (Java Activation Framework is used by JavaMail)

When not using the cache invalidation service (used for CMP Option A beans with Cache Invalidation usually in a clustered configuration)

  • remove server/slim/deloy/cache-invalidation-service.xml

When not using the J2EE client deployer service (this is a not very useful J2EE spec required service for the EAR application-client.xml descriptor)

  • remove server/slim/deploy/client-deployer-service.xml

When not using the integrated HAR deployer and Hibernate session management services

  • remove server/slim/deploy/hibernate-deployer-service.xml (HAR support)
  • remove server/slim/lib/jboss-hibernate.jar (HAR support)
  • remove server/slim/lib/hibernate2.jar (Hibernate itself)
  • remove server/slim/lib/cglib-full-2.0.1.jar (used by Hibernate to create proxies of POJOs)
  • remove server/slim/lib/odmg-3.0.jar (some goofy object-relational mapping thing used by hibernate from some goofy committee http://www.service-architecture.com/database/articles/odmg_3_0.html)

When not using Hypersonic (which you should not in production)

Note that JBossMQ as deployed in the default configuration uses DefaultDS with mappings for Hypersonic. See JBoss MQ Persistence Wiki pages for more information on configuring other alternatives.

  • remove server/slim/deploy/hsqldb-ds.xml
  • remove server/slim/lib/hsqldb-plugin.jar
  • remove server/slim/lib/hsqldb.jar

When not using JBossMQ (our JMS server)

  • remove the entire server/slim/deploy/jms directory
  • remove server/slim/lib/jbossmq.jar

When not using the HTTPInvoker (which lets you tunnel RMI over HTTP)

  • remove the entire server/slim/deploy/http-invoker.sar directory

When not using XA datasources (Distributed and/or recoverable transactions)

  • remove server/slim/deploy/jboss-xa-jdbc.rar

If you do not need the JMX-Console then remove it

  • remove server/slim/deploy/jmx-console.war
  • Otherwise Secure it

If you do not need to make JMX calls over RMI (warning the shutdown.sh DOES do this)

  • remove server/slim/deploy/jmx-invoker-adaptor-server.sar
  • remove server/slim/deploy/jmx-adaptor-plugin.jar
  • or you may want to just secure the JMX invoker-adaptor instead

If you do not need the web-console

  • remove server/slim/deploy/management/web-console.war

If you do not need JSR-77 extensions for JMX

  • remove server/slim/deploy/management/console-mgr.sar

If you need neither the web-console or jsr-77 extensions

  • remove server/slim/deploy/management directory entirely

If you are not using console/email monitor alerts

  • remove server/slim/deploy/monitoring-service.xml
  • remove server/slim/lib/jboss-monitoring.jar

If you are not using rich property editors (JMX) or loading properties into system properties via the Properties Service

  • remove server/slim/deploy/properties-service.xml
  • remove server/slim/lib/properties-plugin.jar

The scheduler-service.xml is an example unless you have put your own in it

  • remove server/slim/deploy/scheduler-service.xml

If you are not using the JBoss Scheduler Manager (allows you to schedule invocations against MBeans)

  • remove server/slim/deploy/schedule-manager-service.xml
  • remove server/slim/lib/scheduler-plugin* (scheduler-plugin.jar, scheduler-plugin-example.jar)

If you do not need vendor-specific sql exception handing (just leave it, really)

  • remove server/slim/deploy/sqlexception-service.xml

If you are using neither client-side transaction management nor cached connections (where instead of pooling we cache connections such as in the case of JAAS->DB User -- using this means you are a bad person and need to be smacked)

  • remove server/slim/deploy/user-service.xml

If you do not use JBoss UUID key generation (often used with CMP primary keys, but we have database specific support as well)

  • remove server/slim/deploy/uuid-key-generator.sar
  • remove server/slim/lib/autonumber-plugin.jar

user-service.xml is an example -- unless you put something in it (your own mbeans) you can always remove it.

  • remove server/slim/deploy/user-service.xml

If your users directly connect to Tomcat via HTTP and do not pass through Apache/mod_jk:

  • open server/slim/deploy/jbossweb-tomcat50.sar/server.xml in the vi editor
  • remove/comment the following XML fragment:

<!-- A AJP 1.3 Connector on port 8009 -->
<Connector port="8009" address="${jboss.bind.address}"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3"/>

If your users do not directly connect to Tomcat via HTTP and always pass through Apache/mod_jk

  • open server/slim/deploy/jbossweb-tomcat50.sar/server.xml in the vi editor
  • remove/comment the following XML fragment:

<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>

If you do not need to be able to deploy EAR files

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment the following XML fragments from the

from under the

<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"

MBean

<attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>

and

<!-- EAR deployer, remove if you are not using Web layers -->
<mbean code="org.jboss.deployment.EARDeployer" name="jboss.j2ee:service=EARDeployer">
</mbean>

If you do not need to be able to deploy JMS Queues

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment the following XML fragments from the

from under the

<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"

MBean

<attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>

If you do not need to use CORBA/IIOP

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment the following XML fragments from the

from under the

<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"

MBean

<attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>

If you removed the user-transaction-service.xml

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment the following XML fragments from the

from under the

<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"

MBean

<attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute>

If you do not need JSR-77 support (tried to make JBoss, Weblogic and Websphere support some basic similar JMX monitoring) you can remove/comment the entire fragment from server/slim/conf/jboss-service.xml:

<!-- ==================================================================== -->
<!-- JSR-77 Single JBoss Server Management Domain -->
<!-- ==================================================================== -->
<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
name="jboss.management.local:j2eeType=J2EEDomain,name=Manager">
<attribute name="MainDeployer">jboss.system:service=MainDeployer</attribute>
<attribute name="SARDeployer">jboss.system:service=ServiceDeployer</attribute>
<!-- <attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>-->
<attribute name="EJBDeployer">jboss.ejb:service=EJBDeployer</attribute>
<attribute name="RARDeployer">jboss.jca:service=RARDeployer</attribute>
<attribute name="CMDeployer">jboss.jca:service=ConnectionFactoryDeployer</attribute>
<attribute name="WARDeployer">jboss.web:service=WebServer</attribute>
<attribute name="MailService">jboss:service=Mail</attribute>
<!-- <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>-->
<attribute name="JNDIService">jboss:service=Naming</attribute>
<attribute name="JTAService">jboss:service=TransactionManager</attribute>
<!-- <attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute>
<attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>-->
</mbean>

If you do not need client-side transaction management (remember that using this means you're a bad person)

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment the following XML fragments

<!--
| UserTransaction support.
-->
<mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService"
name="jboss:service=ClientUserTransaction"
xmbean-dd="resource:xmdesc/ClientUserTransaction-xmbean.xml">
<depends>
<mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
name="jboss:service=proxyFactory,target=ClientUserTransactionFactory">
<attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
<attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
<attribute name="JndiName">UserTransactionSessionFactory</attribute>
<attribute name="ExportedInterface">
org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory
</attribute>
<attribute name="ClientInterceptors">
<interceptors>
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</interceptors>
</attribute>
<depends>jboss:service=invoker,type=jrmp</depends>
</mbean>
</depends>
<depends optional-attribute-name="TxProxyName">
<mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
name="jboss:service=proxyFactory,target=ClientUserTransaction">
<attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
<attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
<attribute name="JndiName"></attribute>
<attribute name="ExportedInterface">
org.jboss.tm.usertx.interfaces.UserTransactionSession
</attribute>
<attribute name="ClientInterceptors">
<interceptors>
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</interceptors>
</attribute>
<depends>jboss:service=invoker,type=jrmp</depends>
</mbean>
</depends>
</mbean>
  • you can now remove server/slim/conf/xmdesc/ClientUserTransaction-xmbean.xml since its not referenced

if you do not need persistent MBean attributes (no JBoss MBeans use this by default...yet)

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment this XML fragment

<!-- ==================================================================== -->
<!-- XMBean Persistence -->
<!-- ==================================================================== -->
<mbean code="org.jboss.system.pm.AttributePersistenceService"
name="jboss:service=AttributePersistenceService"
xmbean-dd="resource:xmdesc/AttributePersistenceService-xmbean.xml">
<attribute name="AttributePersistenceManagerClass">
org.jboss.system.pm.XMLAttributePersistenceManager
</attribute>
<attribute name="AttributePersistenceManagerConfig">
<data-directory>data/xmbean-attrs</data-directory>
</attribute>
<attribute name="ApmDestroyOnServiceStop">false</attribute>
<attribute name="VersionTag"></attribute>
</mbean>
  • you can also remove server/slim/conf/xmdec/xmdesc/AttributePersistenceService-xmbean.xml since it is no longer referenced

If you do not use RMI Classloading (for loading codebases from the client using the classes on the server)

  • open server/slim/conf/jboss-service.xml in the vi editor
  • remove/comment this XML fragment

<!-- ==================================================================== -->
<!-- JBoss RMI Classloader - only install when available -->
<!-- ==================================================================== -->
<mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
name="jboss.rmi:type=RMIClassLoader">
<attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
<attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
</mbean>

and

<!-- ==================================================================== -->
<!-- Class Loading -->
<!-- ==================================================================== -->
<mbean code="org.jboss.web.WebService"
name="jboss:service=WebService">
<attribute name="Port">8083</attribute>
<!-- Should resources and non-EJB classes be downloadable -->
<attribute name="DownloadServerClasses">true</attribute>
<attribute name="Host">${jboss.bind.address}</attribute>
<attribute name="BindAddress">${jboss.bind.address}</attribute>
</mbean>

  • and change this XML fragment (NOTE: In JBoss 4.0, this is located in the file server/slim/deploy/ejb-deployer.xml):

<!-- EJB deployer, remove to disable EJB behavior-->
<mbean code="org.jboss.ejb.EJBDeployer" name="jboss.ejb:service=EJBDeployer">
<attribute name="VerifyDeployments">true</attribute>
...
<depends optional-attribute-name="WebServiceName">jboss:service=WebService</depends>
</mbean>

to read like this:

<!-- EJB deployer, remove to disable EJB behavior-->
<mbean code="org.jboss.ejb.EJBDeployer" name="jboss.ejb:service=EJBDeployer">
<attribute name="VerifyDeployments">true</attribute>
...
<!-- <depends optional-attribute-name="WebServiceName">jboss:service=WebService</depends> -->
</mbean>

or alternatively remove the WebServiceName? depends/attribute.

If you only want to use JBoss Naming locally (no RMI clients)

  • open server/slim/conf/jboss-service.xml in vi
  • change the following XML fragment

<!-- ==================================================================== -->
<!-- JNDI -->
<!-- ==================================================================== -->
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
...
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
<attribute name="Port">1099</attribute>
...
<!-- The port of the RMI naming service, 0 == anonymous -->
<attribute name="RmiPort">1098</attribute>
...
</mbean>

To read

<!-- ==================================================================== -->
<!-- JNDI -->
<!-- ==================================================================== -->
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
...
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
<attribute name="Port">-1</attribute>
...
<!-- The port of the RMI naming service, 0 == anonymous -->
<attribute name="RmiPort">0</attribute>
...
</mbean>

The RmiPort is mostly optional but it means we won't bind to 1098 so that can be helpful.

You may also want to remove the thread pool associated by removing this line from the same XML block:

<depends optional-attribute-name="LookupPool"
proxy-type="attribute">jboss.system:service=ThreadPool</depends>

and the thread pool block itself:

<!-- A Thread pool service -->
<mbean code="org.jboss.util.threadpool.BasicThreadPool"
name="jboss.system:service=ThreadPool">
<attribute name="Name">JBoss System Threads</attribute>
<attribute name="ThreadGroupName">System Threads</attribute>
<attribute name="KeepAliveTime">60000</attribute>
<attribute name="MinimumPoolSize">1</attribute>
<attribute name="MaximumPoolSize">10</attribute>
<attribute name="MaximumQueueSize">1000</attribute>
<attribute name="BlockingMode">run</attribute>
</mbean>

The JNDIView MBean (shows the JNDI naming tree) is increadibly useful from the JMX Console if you want to use it, but if you don't

  • open server/slim/conf/jboss-service.xml in vi
  • remove

<mbean code="org.jboss.naming.JNDIView"
name="jboss:service=JNDIView"
xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
</mbean>
  • you can also remove server/slim/conf/xmdesc/JNDIView-xmbean.xml

If you do not use JBossSX, our integrated JAAS-based security for EJBs or Web-tier components (then you deserve to be flogged and I hope you get hacked but thats another story):

  • open server/slim/conf/jboss-service.xml in vi
  • remove

<!-- ==================================================================== -->
<!-- Security -->
<!-- ==================================================================== -->
<!--
<mbean code="org.jboss.security.plugins.SecurityConfig"
name="jboss.security:service=SecurityConfig">
<attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
</mbean>
<mbean code="org.jboss.security.auth.login.XMLLoginConfig"
name="jboss.security:service=XMLLoginConfig">
<attribute name="ConfigResource">login-config.xml</attribute>
</mbean>

  • edit server/slim/deploy/jbossweb-tomcatxx.sar/META-INF/jboss-service.xml and comment out these fragments:

<!-- The JAAS security domain to use in the absense of an explicit
security-domain specification in the war WEB-INF/jboss-web.xml
-->
<!-- <attribute name="DefaultSecurityDomain">java:/jaas/other</attribute>-->

and

<!-- A mapping to the server security manager service which must be
operation compatible with type
org.jboss.security.plugins.JaasSecurityManagerServiceMBean. This is only
needed if web applications are allowed to flush the security manager
authentication cache when the web sessions invalidate.
-->
<!-- <depends optional-attribute-name="SecurityManagerService"
proxy-type="attribute">jboss.security:service=JaasSecurityManager
</depends>-->

  • also remove/comment:

<!-- JAAS security manager and realm mapping --> <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
name="jboss.security:service=JaasSecurityManager">
<attribute name="SecurityManagerClassName">
org.jboss.security.plugins.JaasSecurityManager
</attribute>
<attribute name="DefaultCacheTimeout">1800</attribute>
<attribute name="DefaultCacheResolution">60</attribute>
</mbean>

  • If you're using JBossMQ you'll need to either remove (preferred) all test queues/topics from server/slim/deploy/jms/jbossmq-destinations-service.xml or comment out their security information. Add comments like the following if you choose to keep the example topics/queues:

<mbean code="org.jboss.mq.server.jmx.Topic"
name="jboss.mq.destination:service=Topic,name=testTopic">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
<!-- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
<attribute name="SecurityConf">
<security>
<role name="guest" read="true" write="true"/>
<role name="publisher" read="true" write="true" create="false"/>
<role name="durpublisher" read="true" write="true" create="true"/>
</security>
</attribute>-->
</mbean>
<mbean code="org.jboss.mq.server.jmx.Topic"
name="jboss.mq.destination:service=Topic,name=testTopic">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
<!-- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
<attribute name="SecurityConf">
<security>
<role name="guest" read="true" write="true"/>
<role name="publisher" read="true" write="true" create="false"/>
<role name="durpublisher" read="true" write="true" create="true"/>
</security>
</attribute>-->
</mbean>
<mbean code="org.jboss.mq.server.jmx.Topic"
name="jboss.mq.destination:service=Topic,name=testDurableTopic">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
<!--
<depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
<attribute name="SecurityConf">
<security>
<role name="guest" read="true" write="true"/>
<role name="publisher" read="true" write="true" create="false"/>
<role name="durpublisher" read="true" write="true" create="true"/>
</security>
</attribute>-->
</mbean>
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=testQueue">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
<!--
<depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
<attribute name="SecurityConf">
<security>
<role name="guest" read="true" write="true"/>
<role name="publisher" read="true" write="true" create="false"/>
<role name="noacc" read="false" write="false" create="false"/>
</security>
</attribute>-->
</mbean>

  • if using JBossMQ you'll also need to edit server/slim/deploy/jms/jbossmq-service.xml and change the InterceptorLoader? XML fragment to read like this:

<mbean code="org.jboss.mq.server.jmx.InterceptorLoader" name="jboss.mq:service=TracingInterceptor">
<attribute name="InterceptorClass">org.jboss.mq.server.TracingInterceptor</attribute>
<depends optional-attribute-name="NextInterceptor">jboss.mq:service=DestinationManager</depends>
<!--
<depends optional-attribute-name="NextInterceptor">jboss.mq:service=SecurityManager</depends>
-->
</mbean>

  • you'll also need to comment out or remove (from server/slim/deploy/jms/jbossmq-service.xml):

<!-- <mbean code="org.jboss.mq.security.SecurityManager" name="jboss.mq:service=SecurityManager">
<attribute name="DefaultSecurityConfig">
<security>
<role name="guest" read="true" write="true" create="true"/>
</security>
</attribute>
<attribute name="SecurityDomain">java:/jaas/jbossmq</attribute>
<depends optional-attribute-name="NextInterceptor">jboss.mq:service=DestinationManager</depends>
</mbean>
-->

  • alter the dead letter queue entry (server/slim/deploy/jms/jbossmq-service.xml) by commenting out the security stuff:

<!-- Dead Letter Queue -->
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=DLQ">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
<!--
<depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>-->
</mbean>

  • in server/slim/deploy/jms/jms-ds.xml alter the JmsXA entry to read as follows:

<!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
<tx-connection-factory>
<jndi-name>JmsXA</jndi-name>
<xa-transaction/>
<adapter-display-name>JMS Adapter</adapter-display-name>
<config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
<config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
<max-pool-size>20</max-pool-size>
<!--
<security-domain-and-application>JmsXARealm</security-domain-and-application>-->
</tx-connection-factory>

  • If using JBoss 4, also do this 2 things:
  • in conf/login-config.xml, comment as follows:

<!-- Security domains for testing new jca framework
<application-policy name = "HsqlDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">
jboss.jca:service=LocalTxCM,name=DefaultDS
</module-option>
</login-module>
</authentication>
</application-policy>
<application-policy name = "JmsXARealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">guest</module-option>
<module-option name = "userName">guest</module-option>
<module-option name = "password">guest</module-option>
<module-option name = "managedConnectionFactoryName">
jboss.jca:service=TxCM,name=JmsXA
</module-option>
</login-module>
</authentication>
</application-policy> -->

  • and in deploy/hsqldb-ds.xml comment:

<!-- Use the security domain defined in conf/login-config.xml
<security-domain>HsqlDbRealm</security-domain> -->

If you are not using the Pooled Invoker (see tuning section, you may want to use the pooled invoker) then:

  • open server/slim/conf/jboss-service.xml in vi
  • remove:

<!--
<mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
name="jboss:service=invoker,type=pooled">
<attribute name="NumAcceptThreads">1</attribute>
<attribute name="MaxPoolSize">300</attribute>
<attribute name="ClientMaxPoolSize">300</attribute>
<attribute name="SocketTimeout">60000</attribute>
<attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
<attribute name="ServerBindPort">4445</attribute>
<attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
<attribute name="ClientConnectPort">0</attribute>
<attribute name="EnableTcpNoDelay">false</attribute>
<depends optional-attribute-name="TransactionManagerService">
jboss:service=TransactionManager</depends>
</mbean>

If you do not wish to use the BeanShell deployer

  • open server/slim/conf/jboss-service.xml in vi
  • remove or comment

<mbean code="org.jboss.varia.deployment.BeanShellSubDeployer"
name="jboss.scripts:service=BSHDeployer">
</mbean>

  • remove server/slim/bsh* (bsh-deployer.jar, bsh-1.3.0.jar)

If you do not hot deploy files into the server/slim/deploy directory without restarting JBoss:

  • open server/slim/conf/jboss-service.xml in vi
  • change this XML frament:

<!-- An mbean for hot deployment/undeployment of archives.
-->
<mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
name="jboss.deployment:type=DeploymentScanner,flavor=URL">
...
<attribute name="ScanPeriod">5000</attribute>
...
</mbean>

to read (by adding):

<!-- An mbean for hot deployment/undeployment of archives.
-->
<mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
name="jboss.deployment:type=DeploymentScanner,flavor=URL">
...
<attribute name="ScanPeriod">5000</attribute>
<attribute name="ScanEnabled">False</attribute>
...
</mbean>

  • see the tuning section for other advice regarding this from a performance perspective

If you do not use clustering

  • The best way to do this is to start from the "default" config rather than the "all" config. Then bring over from the "all" config any miscellaneous services that you are using that aren't in "default".
  • If you must to start from the "all" config:
    • Remove server/slim/farm
    • Remove server/slim/deploy-hasingleton
    • Remove server/slim/deploy/cluster-service.xml
    • Remove server/slim/deploy/tc5-cluster-service.xml (OR server/slim/deploy/tc5-cluster.sar on 4.0.4 or later)
    • Remove server/slim/deploy/deploy.last/farm-service.xml
    • Remove server/slim/deploy/deploy-hasingleton-service.xml
    • Go into the server/slim/deploy/jms folder, remove it's contents, and replace them with the contents of the server/default/deploy/jms folder.
    • Edit server/slim/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml to remove this fragment:

<!--
Needed if using HTTP Session Clustering or if the
ClusteredSingleSignOn valve is enabled in the tomcat server.xml file
-->
<depends>jboss.cache:service=TomcatClusteringCache</depends>

If you do not use distributed (clustered) web sessions

  • Remove server/slim/deploy/tc5-cluster-service.xml (OR server/slim/deploy/tc5-cluster.sar on 4.0.4 or later)
  • Edit server/slim/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml to remove this fragment:

<!--
Needed if using HTTP Session Clustering or if the
ClusteredSingleSignOn valve is enabled in the tomcat server.xml file
-->
<depends>jboss.cache:service=TomcatClusteringCache</depends>

If you do not use the Farm service (replicated deployments)

  • Remove server/slim/farm
  • Remove server/slim/deploy/deploy.last/farm-service.xml


Click here for a complete list of service dependencies.

posted on 2008-06-03 16:41 lancey 閱讀(1882) 評(píng)論(0)  編輯 收藏 引用 所屬分類: java

My Links

Blog Stats

常用鏈接

留言簿(2)

隨筆檔案

文章分類

文章檔案

我的鏈接

搜索

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美一区二区视频在线观看2020 | 夜夜嗨av一区二区三区中文字幕 | 国产精品婷婷午夜在线观看| 免费亚洲电影在线观看| 久久国产精品毛片| 久久久久久9| 欧美电影美腿模特1979在线看| 欧美高清视频| 国产精品v欧美精品v日本精品动漫| 国产精品久久久久久久午夜| 国产丝袜一区二区| 亚洲精品综合久久中文字幕| 亚洲一区免费网站| 亚洲久久在线| 欧美a级片一区| 欧美日韩国内自拍| 国产精品系列在线| 亚洲日本欧美| 亚洲欧美日韩精品在线| 欧美va亚洲va香蕉在线| av成人免费观看| 久久久久久网址| 欧美四级伦理在线| 亚洲国产欧美日韩| 欧美中文字幕精品| av成人动漫| 欧美a级一区| 有坂深雪在线一区| 久久国产一区| 中文精品视频| 欧美国产视频在线| 黄色日韩在线| 性欧美8khd高清极品| 亚洲激情在线观看| 亚洲男女自偷自拍图片另类| 欧美精品偷拍| 91久久精品www人人做人人爽| 午夜视频久久久久久| 亚洲人成网站999久久久综合| 久久精品91久久香蕉加勒比| 欧美日韩国产电影| 美女网站久久| 一区视频在线看| 亚洲黄色一区| 欧美在线亚洲| 亚洲精选一区| 欧美jizz19性欧美| 亚洲动漫精品| 久久综合激情| 久久成人精品电影| 国产一区二区三区日韩欧美| 先锋资源久久| 亚洲一区三区在线观看| 国产精品激情偷乱一区二区∴| 日韩视频永久免费| 91久久久久久久久| 欧美精品免费观看二区| 最新国产成人av网站网址麻豆| 男同欧美伦乱| 欧美成人精品1314www| 亚洲国产综合91精品麻豆| 蜜桃av一区二区三区| 久久久噜噜噜久噜久久| 亚洲国产另类久久久精品极度| 欧美国产大片| 欧美日韩亚洲另类| 西瓜成人精品人成网站| 欧美专区福利在线| 亚洲激情图片小说视频| 最近中文字幕日韩精品| 欧美视频亚洲视频| 欧美一区二区三区成人| 亚洲三级免费| 在线午夜精品| 欧美视频在线视频| 欧美激情一区二区三区蜜桃视频| 禁久久精品乱码| 欧美激情在线| 欧美色图麻豆| 欧美自拍偷拍午夜视频| 久久精品一二三区| 亚洲免费高清| 亚洲一区二区毛片| 黄页网站一区| 日韩视频中午一区| 国产在线拍揄自揄视频不卡99| 免费久久99精品国产| 欧美日韩不卡合集视频| 久久岛国电影| 欧美华人在线视频| 久久国产精品久久w女人spa| 免费不卡中文字幕视频| 午夜精品久久久久久久99樱桃| 久久成人羞羞网站| 亚洲美女黄网| 欧美在线看片a免费观看| 亚洲免费观看| 久久精品亚洲乱码伦伦中文 | 一区二区三区视频在线播放| 亚洲美女在线看| 日韩视频第一页| 国产一区二区三区自拍 | 亚洲欧洲三级| 国产乱码精品1区2区3区| 欧美大片专区| 国产日本亚洲高清| 亚洲精品系列| 在线不卡免费欧美| 亚洲一级片在线看| 亚洲老板91色精品久久| 欧美在线免费视频| 亚洲影视九九影院在线观看| 另类人畜视频在线| 亚洲成人直播| 欧美在线播放高清精品| 欧美 日韩 国产 一区| 欧美在线影院在线视频| 欧美片在线播放| 欧美激情一二三区| 激情久久久久久久| 午夜精品福利在线观看| 亚洲午夜羞羞片| 欧美日韩成人免费| 最新成人在线| 亚洲毛片在线免费观看| 欧美激情视频免费观看| 欧美激情一区二区三区在线视频观看| 国产一区二区三区日韩| 欧美亚洲视频| 久久精品日产第一区二区三区 | 欧美成人激情视频免费观看| 免费观看日韩av| 亚洲国产成人av在线| 久久免费国产| 免费成人高清视频| 亚洲国产精品ⅴa在线观看| 久久先锋资源| 亚洲国产另类精品专区| 日韩系列欧美系列| 欧美日韩一区二区在线| 一区二区三区你懂的| 亚洲欧美激情精品一区二区| 国产精品美女久久久| 午夜精品视频在线| 久久夜色精品| 亚洲精品小视频| 欧美性猛交xxxx乱大交蜜桃| 亚洲性人人天天夜夜摸| 久久精品人人做人人爽| 尤物九九久久国产精品的分类| 久久久亚洲一区| 亚洲精品一区二区三区在线观看| 一区二区免费看| 国产精品一区二区你懂得| 久久精品国产亚洲精品| 欧美国产一区二区| 亚洲视频一区在线| 国产亚洲综合在线| 玖玖国产精品视频| 一道本一区二区| 久久久99国产精品免费| 欧美亚洲综合久久| 可以看av的网站久久看| 亚洲国产精品久久久久秋霞蜜臀| 久久综合网络一区二区| 亚洲激情偷拍| 欧美在线视频免费播放| 尤物九九久久国产精品的特点 | 国产农村妇女精品一区二区| 欧美伊人久久久久久午夜久久久久| 久久综合狠狠综合久久综合88| 亚洲黄色影院| 国精品一区二区三区| 欧美国产日韩xxxxx| 亚洲一区网站| 亚洲电影专区| 久久狠狠亚洲综合| 在线亚洲一区| 国产伊人精品| 国产精品第一页第二页第三页| 久久不见久久见免费视频1| 欧美激情视频在线播放| 久久成人这里只有精品| 一本色道精品久久一区二区三区| 国产日韩视频| 欧美日一区二区在线观看| 欧美一区二区三区四区在线观看地址| 欧美国产免费| 久久综合网hezyo| 亚洲欧美三级在线| 亚洲精品自在久久| 亚洲高清不卡| 国产欧美一区二区三区视频| 欧美日韩美女| 裸体一区二区三区| 久久久久久尹人网香蕉| 午夜欧美大尺度福利影院在线看| 亚洲福利视频一区二区| 久久成人资源| 久久国产一区|