Professional Documents
Culture Documents
Page 1 of 12
TABLE OF CONTENTS
OVERVIEW...........................................................................................................................................................3 TUNING WEBLOGIC SERVER.........................................................................................................................3 USING WEBLOGIC SERVER PERFORMANCE PACKS ........................................................................................................3 SETTING THREAD COUNT..........................................................................................................................................3 ASSIGNING APPLICATIONS TO EXECUTE QUEUES..........................................................................................................4 ALLOCATING THREADS TO ACT AS SOCKET READER......................................................................................................4 CONNECTIONPOOLS ENHANCE PERFORMANCE..............................................................................................................4 PREPARED STATEMENT CACHE...................................................................................................................................5 TUNING JDBC CONNECTIONPOOL INITIAL CAPACITY...................................................................................................5 TUNING JDBC CONNECTIONPOOL MAXIMUM SIZE......................................................................................................5 TUNE THE CHUNK SIZE..............................................................................................................................................5 TUNING CONNECTION BACKLOG BUFFERING................................................................................................................6 TUNING PARAMETERS FOR STARTING WEBLOGIC SERVER...............................................................................................6 TUNING JAVA VIRTUAL MACHINES............................................................................................................6 JVM HEAP SIZE.....................................................................................................................................................6 GOAL FOR TUNING HEAP SIZE.....................................................................................................................................7 DETERMINE OPTIMAL HEAP SIZE...............................................................................................................................7 ANALYZE THE FOLLOWING DATA POINTS......................................................................................................................7 YOU MIGHT SEE THE FOLLOWING JAVA ERROR IF YOU ARE RUNNING OUT OF HEAP SPACE.....................................................7 TURNING ON VERBOSE GARBAGE COLLECTION............................................................................................................7 SPECIFYING HEAP SIZE VALUES.................................................................................................................................8 JAVA HEAP SIZE OPTIONS.........................................................................................................................................8 CONTROL PERMANENT GENERATION AREA SIZE EXPLICITLY ............................................................................................9 OTHERS.................................................................................................................................................................9 OPERATING SYSTEM MONITORING..............................................................................................................................9 EJBS.....................................................................................................................................................................9 PERFORMANCE TERMS AND DEFINITIONS...................................................................................................................11 CONCLUSION.....................................................................................................................................................11 REFERENCES.....................................................................................................................................................11
Page 2 of 12
Overview
This document gives a brief overview of how to tune the components in a Weblogic Server Platform for which we will focus on tuning Weblogic Server and Java Virtual machines. The first step in performance tuning is isolating the hot spots. Performance bottlenecks can exist in any part of the entire system - the network, the database, the clients, or the app server. It's important to first determine which system component is contributing to the performance problem. Tuning the wrong component may even make the situation worse. There are some great profilers tools like ( OptimizeIt, JProbe, Wily Introscope ) which can help detect performance bottlenecks in the application code itself. The following sections describe how to tune WebLogic Server to match the application needs.
Environment>>Server (Select your server) >>Tuning>>Check the "Enable Native IO" Then Re-Start the weblogic server.
Setting Thread Count
The value of the ThreadCount attribute of an ExecuteQueue element in the config.xml file equals the number of simultaneous operations that can be performed by applications that use the execute queue. As work enters a WebLogic Server instance, it is placed in an execute queue. This work is then assigned to a thread that does the work on it. These threads consume resources. Note: Performance will be degraded by increasing the value unnecessarily. By default, a new WebLogic Server instance is configured with a default execute queue (named default) that contains 15 threads
Page 3 of 12
Weblogic Server Performance Tuning o Practically ideal, resulting in a moderate amount of context
switching and a high CPU utilization rate.
Environment>>Server (Select your server) >>Tuning>> Specify Socket Readers" Then Re-Start the weblogic server.
The number of Java socket readers is computed as a percentage of the number of total execute threads (as shown in the Thread Count field for the Execute Queue).
Page 4 of 12
Page 5 of 12
Page 6 of 12
You might see the following Java error if you are running out of heap space
Page 7 of 12
Example:
The default size for these values is measured in bytes. Append the letter k or K to the value to indicate kilobytes, m or M to indicate megabytes, and g or G to indicate gigabytes.
Page 8 of 12
Others
Operating System Monitoring
Unix provides many tools for monitoring system sar: system activity mpstat: per-processor statistics vmstat: virtual memory statistics netstat: network statistics iostat: Input/Output statistics
EJBs
Page 9 of 12
This optimization does not apply to calls across different applications Transaction Avoid using the Rtransaction parameter. Using Rcauses the EJB container to start a e e new transaction after suspending any current transactions. This means additional resources, including a separate data base connection are allocated IdleBeanCount The number of EJBs currently idle within a pool that is managed by the Bean Container, which provides services to EJBs, including creating bean instances, managing pools of instances, and destroying instances. It also handles threading, transaction support, data storage, and retrieval for the beans. While a steady count of Idle Beans is normal, a climbing graph can be a strong indicator that the container needs to destroy beans at a faster rate. A possible reason for an increased bean count is that a new application may have been deployed, or an existing one modified so that the EJBs are stateful (contain session information across session restarts; a valid application method but not always necessary). This parameter should be monitored closely for anomalous conditions. Caching Caching is one of the ways the WLS improves response time for the application and the end user. It places user session information in memory in the form of EJBs. These session beans containing the users session information are quickly and readily retrieved the next time the user visits that website. The administrator has control over how much session information is stored in the cache and needs to be mindful of striking a balance.
Page 10 of 12
From a user perspective, it would be ideal if their session information was always found in the cache, ensuring a rapid response time when they visited the website. Isnt this the goal of IT managers? Perhaps it is also the managers goal to optimize the use of WebLogic and ensure that the software is tuned to deliver the best service to all users. This means removing old session beans from the cache and properly configuring the cache size so that it does not consume too much memory of the JVM. HTTP Sessions In terms of pure performance, in-memory session persistence is a better overall choice when compared to JDBC-based persistence for session state. If you use a single large attribute that contains all the session data and only 10% of that data changes, the entire attribute has to be replicated. This causes unnecessary serialization/deserialization and network overhead. You should move the 10% of the session data that changes into a separate attribute. So during developing the application need to take care the above fact. For the cluster environment make sure that the objects which are participating in the session need to be serialized.
Performance can be defined as: how the systems response time and throughput
are affected by adding load. Capacity can be defined as: what the maximum threshold for the system is under a given set of conditions. Scalability can be defined as: how well the system responds to increasing load by adding additional resources. Most commonly we use the response time of the system and the throughput of the system as measurements for these terms.
Conclusion
The above are only some of the various ways that the server can be tuned. Bear in mind, however, that a poorly designed, poorly written application will usually have poor performance, regardless of tuning. Performance must always be a key consideration throughout the stages of the application development life cycle - from design to deployment. It happens too often that performance takes a back seat to functionality, and problems are found later that are difficult to fix.
References
http://edocs.bea.com/wls/docs91/perform/index.html http://www.javaperformancetuning.com/tips/appservers.shtml http://whitepapers.techrepublic.com.com/whitepaper.aspx?docid=110328 http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=40
Page 11 of 12
Page 12 of 12