java parametejava r set for weblogic start
DESCRIPTION
java parameterTRANSCRIPT
Java parameter set for WebLogic start
Garbage collection (GC) is the the JVM release of Java heap memory occupied by the object is no longer used process Java heap (Heap)
Refers to the living space of the Java application objects. Heap size determines the GC frequency and time. Heap bigger GC frequency is low and slow.
The smaller the heap, GC frequency and high speed. GC and heap size is a set of contradictions. In order to obtain the ideal Heap heap size, you need to make
-Verbosegc parameters (Sun jdk:-Xloggc: <file>) to open the detailed output of the GC. Analysis of GC's frequency and time, Results
Together the maximum load required memory situations, draw the size of the heap.
Usually the case, we recommend the use of available memory (memory) in addition to the operating system and other applications occupy 70-80% for the avoidance
Free heap size adjustment due to overhead, the minimum value equal to the maximum value that:-Xms =-Xmx to set the memory heap. In order to prevent memory overflow,
Proposed in the production environment heap size of at least 256M (Platform least 512M) 512M ~ 1G performance in the real environment
Jia, 2G is not desirable, the memory adjustment may need to adjust the core parameters of the process allows the maximum amount of memory. For sun
And hp the jvm permanent domain is too small (default 4M) may also cause memory overflow, should increase the parameter-XX: MaxPermSize = 128m. Build
Meeting to set the size of the temporary domain-Xmn the-Xmx 1/4 1/3 SurvivorRatio The 8
Stack memory optimization, modify the configuration file:
WL_HOME = C: \ bea \ weblogic81 "% WL_HOME% \ common \ bin \ commEnv.cmd"
: On bea bea # If the JDK
# JVM Heap (heap memory) minimum size 96M, and the maximum size of 256M
set MEM_ARGS =-Xms96m-Xmx256m
: Sun # If the sun's JDK
# JVM Heap (heap memory) minimum size 32M, and the maximum size of 200M
# Public variable object memory limit: PermSize: Minimum size MaxPermSize: maximum allowable allocation size
set MEM_ARGS =-Xms32m-Xmx200m-XX: MaxPermSize = 128m
Monitor stack usage:
Download JRockit JDK, the JDK comes with JRockit Mission Control tools, it seems to have no single
Sole place to download JRockit Mission Control, JRockit JDK bind download;
In C: \ bea \ jrockit81sp5_142_08 \ console directory run:
C: \ bea \ jrockit81sp5_142_08 \ bin \ java-Xmanagement-jar ManagementConsole.jar
How to monitor weblogic?
Modify weblogic startup script the startWebLogic.cmd, startup parameters inside-Xmanagement:
% JAVA_HOME% \ bin \ java-Xmanagement% JAVA_VM%% MEM_ARGS%% JAVA_OPTIONS%
-Dweblogic.Name =%
SERVER_NAME%
-Djava.security.policy = "%
-Dweblogic.ProductionModeEnabled =% PRODUCTION_MODE%
WL_HOME% \ server \ lib \ weblogic.policy "weblogic.Server
Setting performance related configuration parameters
1. The following table lists the parameters affecting server performance.
Name
Parameter
Location
Effect
Cache
max-beans-in-cache
"% JAVA_HOME% \ bin \ java"
weblogic-ejb-jar.xml entity bean cache empty
Between the size, if slow
Save the space is too small,
Some bean stranded
In the database, the next
You must re-call
New loaded from the database
startWLS.cmd for high performance
-hotspot
-Xmx512m
-Xms512m
/ startWLS.sh
Throughput, the Java heap
Most small value and the largest
-classpath% CLASSPATH%
-
Parameters in the
2.console console
Value is set to be equal.
Name
NativeIOEnable
d
SocketReaders
Maximum Open
Sockets
Stuck Thread
MaxTime
Type
server
Location
mydomain-> Servers-> myserver-> Configu
ration-> Tuning-> "Enable Native IO"
server-> configuration-> tuning
Value
TRUE, indicating the
Server using the ground
I / O
Is provided in the thread of execution
Exclusively used Socket
Readers percentage of
Largest open Socket number
Plug threads time, ultra-
Over this time did not return
Back to the thread of execution, the Department of
System will be considered to be clogged line
Journey
If weblogic
A queue of all
All clogging of the thread
Then, weblogic will
Increasing the number of execution threads
Stuck Thread
Timer Interval
Low Memory
GC Threshold
Low Memory
Granularity
Level
Low Memory
Sample Size
Low Memory
Time Interval
Accept Backlog
Amount.
Note: The thread of execution
Once the number increased, mesh
Before weblogic not go
Reduce his increase
Some threads later
Occurrence of overflow
Warning, weblogic
Continue to increase the thread of execution
The number, until it reaches the
Far to the ceiling.
The system checks clogged thread
The time interval
When the available memory is less than the
Percentage, the garbage back
Closing start
Available when two detection
The memory change more than the one hundred
Points than garbage collection
Start
Taken in a detection
Number of injections
Detection interval
Up in the waiting queue
The number of TCP connections
Waiting to be processed, if
Many client connections are
Rejected, while the server
The client does not have error display
Explanation This value is set too
Is low.
If received in connection
connection refused
Message stating that should improve
This value, every time increase
25%
ThreadCount
ExecuteQ
ueue
console: mydomain-> Servers-> myserver
-> Monitoring-> Monitor all Active
Queues ...
-> Configuration-> weblogic.kernel.Defaul
t->
Server initially created
Number of execution threads
Setting principles: increased machine
The maximum concurrent threads
Digital processor utilization
Maximum. For clothing
- Side operation more
QueueLength
QueueLengthThr
esholdPercent
ThreadsIncrease
ThreadsMaximu
m
Threads
Minimum
ThreadPriority
The thread should be reduced
Thread count; off
Compared to client operating
Should be increased thread
Count. The number of concurrent threads
Theoretically equal to the "local
A number of the host CPU
+ Stuck number of threads, enough
Over the General Assembly can drop
Low system performance
Waiting for the queue please
Seeking number ideal state
Is 0
A percentage of the number, when
request the number reaches
This ratio of the length of the queue
Cases when, weblogic
Will be issued overflow
Flag information
If weblogic issue
the overflow the flag letter
Interest, weblogic will taste
Try to increase this number of
Thread of execution, in order to solve
Deal with conflicts
The maximum number of threads of execution
Minimum number of threads of execution
Thread priority
Initial Capacity JDBC
mydomain->
JDBC
Connection
Initial database physically connected
MaxCapacity
Capacity
Increment
Statement Cache
Type
Pools-> Configuration-> Connections
The few
Maximum database physically connected
The few
Each database physical connection
Connected to increase the number of
prepared statements
The cache policy, LRU
Algorithm in a new statement
Arrival and will most without
Statement is often used to adjust
The cache. FIXED count
Act as the first-in, first-out count
Law
TestConnections
OnReserve
Statement Cache
Size
Login Delay
And
Third, adjust the development mode with default value products mode
TestConnectionsOn
Reserve is set to
false (the default setting).
If this parameter is set to
True (true), the even
Connection is assigned to the caller
Before that, go through the measured
Trial, which will be an additional requirement
Repeatedly connected with the database
Meet
The macro statement setting static
Cache size by JDBC
Even when the connection pool configuration refers
Set, adjust this value
Size, there are conducive Uploader
High efficiency of the system
Create a database physical connection
Then when the delay time
You can specify the domain for the development environment or a production environment. WebLogic will be used depending on the type of environment you specify different mime
Recognize the value of the different services.
The following table lists the default values in the two modes
Optimization parameters
mydomain> Servers> myserver> Execute
Queue> weblogic.kernel.Default Thread Count
Development model
15 threads
Product model
25 threads
mydomain> JDBC Connection Pools> MyJDBC
Connection Pool-> Connections in the Maximum
Capacity
3.1 Change the run mode
15 connections 25 connections
Can be changed according to the following steps to create a domain, the domain where all services run-time mode:
1. Open with a text editor to change the running host a WebLogic domain runtime mode
WL_HOME \ common \ bin \ commEnv.cmd (Windows) or WL_HOME, is \ common \ bin \ the commEnv.sh
(UNIX), WL_HOME is the path to install WebLogic.
For the specified domain change run mode, use a text editor to open the domain-name \ StartWebLogic.cmd
(Windows) or domain-name \ StartWebLogic.sh (UNIX), domain-name domain created directory.
2. If you want the server to run in production mode, refers in this script, change the value of the PRODUCTION_MODE
Given a value of TRUE. Or inside mydomain-> General Production Mode selected
Change the product model and boot.properties (stored username and password) file deleted, then Kai
Automatically when you need to enter a user name and password.
3. Restart all the servers.
3.2 two modes of different
The following table lists the difference between development mode with product the mode several key items:
Function name
SSL
Deploy applications
Log File Rotation
Execute Queues
JDBC Connection
Pool Capacity
Development model
You can use the WebLogic Security service
Service provided validation of digital certificates. This
These certificates, you develop applications
Running under SSL to protect the environment.
WEBLOGIC instance automatically Ministry
The Department and the update is located
domain_name / applications
Application directory
(Domain_name domain name
Name).
After starting the server, the server automatically
Rename local log file
server-name.log.n, in order to stranded
Session, as long as the log file
Reach 500kb, the log file will roll
Turn once.
The default execution threads as 15.
The default capacity is 15.
Product model
If you use to verify the digital certificate
Books, you will receive a warning message.
You can not use the automatic deployment capabilities
Must use the WebLogic console
Or WebLogiceblogic
The Deployer tools.
When the log file reaches 500kb
Will roll.
Thread of execution of the default 25.
The default capacity is 25.
Fourth, the use of WebLogic "own IO" performance package
When you use its own package of performance, the benchmark that the main performance improvement. Performance package optimization platform and multi-
Thread Socket to improve the performance of the server. For example, the local Socket read multi-threaded execution queue without
Need to borrow the default execute queue thread, so you can let the default execution threads very calmly to deal with the application.
However, if you must use pure Java socket read running on the host, you can still configure each server real
Appropriate in cases and client socket to read the number of threads, to improve the performance of socket communication.
Set the method of operation of the performance package:
By default, the load in the config.xml own performance package. To verify this, check the configuration file
Whether the investigation NativeIOEnabled attribute set to "true" (NativeIOEnabled = true).
Management Console, you can also verify that the steps are as follows:
1, start the management server.
Access management console.
Servers node, expand the left panel to display the domain service.
4, click the service you want to configure instance.
5 Select the Configuration-> Tuning tab.
6, if the Enable Native IO check box is not selected, can be selected.
7, click Apply.
8, restart the server.
V. optimize default execute queue thread
By default, a new configuration of WebLogic instance a development model execution queue weblogic.kernel.default
It contains 15 threads. In addition, WebLogic provides two pre-configured queue:
n weblogic.admin.HTTP-- only only on the management server, the queue for the management console through
Credit, you can not configure it.
n weblogic.admin.RMI-- management server and managed server has the queue, it is for management
Transportation purposes, nor can configure it.
If you do not configure additional execute queues, and specify the application to these queues, web applications and RMI object to
With default queue weblogic.kernel.default.
Note; comes with the implementation of the package is not in your platform, you might need to adjust the default number of threads of execution queue and
As a percentage of the thread socket Reading, to achieve optimum performance.
5.1 You should change the default number of threads?
Adding more threads to the default execute queue does not mean you can handle more work. Even more threads,
Still limit the ability of the processor. Because threads consume memory, so as to increase the value of the properties of the number of threads unnecessary reduce sexual
Can. A high number of execution threads lead to more memory is occupied and the increase in the context of the conversion process, it will also reduce sexual
Can.
Type is closely related to the value of the property and the application of the number of threads that process work. For example, if your client application compare
Small, remote call processing work more so, the client will spend more time connected, therefore, to complete
Customers of a large number of client tasks compared to the application, will need more number of threads.
If you do not need to use more than 15 threads (default development mode) or 25 threads (product mode by default)
Do not change the value of this property. Typically, if your application accesses the database to spend a long time before returning results, and
A very short period of time to access the database application return comparison, you will need more threads of execution. From the latter point of view, with less
Point the number of threads that may improve performance.
5.2 the need to modify the default number of threads
Queue to determine a number of threads in order to perform, when all applications running in the queue at the maximum load
Next, to monitor the throughput of the queue. Increase the number of threads, repeated load test, until you reach the best throughput. (In some cases
Case, increasing the number of threads will produce enough context conversion program, so that the throughput of the queue starts to decrease. )
Note: WebLogic management console displays all servers in the execution queue cumulative throughput. In order to get this value,
Later introduced.
The following table lists the adjustment of the threads in a WebLogic domain associated with the number of CPU circumstances, these cases also assume that
WebLogic running at maximum load, and use the default execute queue to meet the request of the thread. If you're with
Set additional execute queues and assign applications to specific queues, you need to get results based on a connection pool.
If the result should be:
The number of threads <number of CPU threads too few, if:
CPU is waiting for work, but the work was completed.
CPU utilization can reach 100%. Increase the number of threads.
The number of threads = number of CPUs theoretically ideal, but the CPU is still low use. Increase the number of threads.
Number of threads (appropriate)> CPU number actually ideal context appropriate number of conversion process and high CPU
Utilization. Appropriate to adjust the number of threads and compare performance results.
The number of threads (large)> CPU excessive number of context conversion process can lead to significant performance degradation.
When you reduce the number of threads, the performance can be enhanced. Reduce the number of threads, so that it is equal to the number of the CPU, then just increase has
Having come to "jam" the number of threads.
For example, if you have four processors, they are running at the same time, and gridlock thread, so you want the thread of execution
4 + number of clogging threads
5.3 steps to modify the default number of threads
Management Console to modify the default execute queue thread number as follows:
1. If the management server is not running, start first.
2. Access Management Console.
3. Servers node, expand the left panel displays the domain service.
4. Right-click on the name of the service, in the pop-up menu, select View Execute Queues, will be displayed in the right panel
The execution queue table used to modify.
Note: you can only modify the default execute queue or user-defined execution queue.
5. Name column, just click the default execution queue name, Display Configuration tab is used to modify the execution queue number.
6. Fill in the appropriate number of threads.
7. Click Apply to save just changes.
8. Restart the server, so that the entry into force of the new execute queue settings.
5.4 assign an application to the execution queue
Although you can configure the default execute queue, the optimal number of threads for all WebLogic applications, but is off
The key to the application configuration multiple to execution queues can provide more management control. Performed by using the multi-queue, you can maintain the
Permit application the right to occupy a fixed number of threads, regardless of WebLogic server much load.
5.5 create execution queue
An execution queue named set represents a thread of execution, a thread pointing to one or more Servlet, JSP, EJB, RMI objects.
Execution queue in config.xml file description, as part of the server element. As described in the config.xml file
Described a 4-thread queue named CriticalAppQueue, as follows:
...
<Server
Name = "examplesServer"
ListenPort = "7001"
NativeIOEnabled = "true" />
<ExecuteQueue Name = "default"
ThreadCount = "15" />
<ExecuteQueue Name = "CriticalAppQueue"
ThreadCount = "4" />
...
</ Server>
Another to create a queue via the management console, the configuration steps are as follows:
1. Boot Manager server, access the console.
2. Expand the left panel in the Servers node, display the domain you want to configure the service.
3. Right-click the queue you want to increase service instance, from the pop-up menu, select View Execute Queues.
4. In the queue configuration tab, click configure a new execution queue link.
5. Queue configuration tab, change the following attributes or accept the default value of the system:
The thread name (Name): You can enter the name of threads, such as CriticalAppQueue.
queue length (Queue Length): usually leave the default value of 65536, that at the same time sent a request queue length most
Large numbers, 65,536 requests is a big number, even if the maximum number is reached is also rare.
If the maximum queue length, WebLogic automatically doubling the size of the queue, in order to handle the additional work. Note
Italy: more than 65,536 requests indicative of the threads in the queue, not just queue the length of the problem, the real
The practice showed that the blockage thread or number of threads in the queue.
The queue the length restrictions percentage (Queue Length Threshold Percent): reach the queue length percentage (1-99)
When constitutes produce overflow condition. The actual queue size under the percentage limitations when considered to be normal;
Overflow occurs above the limit percentage. When an overflow occurs, WebLogic logs will produce an error message,
Increase the number of threads, and the value of the property according to the number of threads increment (Threads Increase) in order to help reduce the load.
default queue length limit is 90%. Normal circumstances, should be retained in the 90% or so, in order to deal with some of the latent
In the case, so there are additional threads can be to deal with some exception request. Remember, the queue length limit percentile
Than as an automatic optimization of parameters not necessarily - because under normal operating conditions, this limit is never triggered.
number of threads (Tread Count): number of threads assigned to this queue. If you do not need to use more than 15 threads (default
Recognition), you do not have to change the value of this property.
incremental number of threads (Threads Increase): WebLogic to detect when there is overflow, increased execution queue
The number of threads. When you specify 0 (the default), an overflow occurs, WebLogic will run good status changed to "Warning"
And it will not assign additional threads to reduce the amount of load.
Note: WebLogic instance the number of threads in response to the overflow, then these additional threads will be stranded in the implementation of
Queue, until the server is restarted. Monitor the error log to determine the the overflow causes of so based on the need to re-configure
The number of threads, to prevent future similar situation. Do not use both as a percentage of the incremental number of threads and queue length limit since
Activity optimization tool. To do so usually results will produce more than the normal need also thread assigned execute queue, so
The context transformation program causes the server to suffer poor performance.
maximum number of threads: the implementation of the run queue, the value of the protected WebLogic in response to frequent overflow, creating
Built the excessive number of threads. By default, the maximum number of threads to 400.
thread priority: the thread priority of this queue. The default value is 5.
6. Click Create, to create the queue.
7. Restart the server.
5.6 assigned Servlet and JSP to perform queue
You can allocate the servlet or JSP to specify the configuration of the execution queue, just in the initial parameter identifies the queue name
Said. Init-param element in the deployment descriptor file web.xml initial parameters appear in Servert or JSP. In order to sub-
With a queue, the queue name as wl-dispatch-policy value of the parameter. Such as:
<servlet>
<servlet-name> MainServlet </ servlet-name>
<jsp-file> / myapplication / critical.jsp </ jsp-file>
<init-param>
<param-name> wl-dispatch-policy </ param-name>
<param-value> CriticalAppQueue </ param-value>
</ Init-param>
</ Servlet>
5.7 assign EJB and RMI object to the execution queue
Order EJB assigned to a specified queue, you can use the dispatch-policy element in weblogic-ejb-jar.xml file.
However, you can by using appc the compiler-dispatchPolicy option to set the dispatch strategy, BEA strongly recommended to make
Deployment descriptor elements. Because in this way, if the EJB recompile during deployment use cases, this setting does not
Lost.
RMI object is assigned to a specified queue, you can use the rmic compiler-dispatchPolicy options, such as:
java weblogic.rmic-dispatchPolicy CriticalAppQueue ...
5.8 assigned to perform queue served Socket read
In order to get a better socket performance, BEA recommended that you use its own socket read execution tools, it is better than pure Java
Implementation tools. If, however, you must read pure Java socket on the host, you still can configure the appropriate
The number of execution threads to improve socket communication performance for each server instance and client machine shoulder socket reader thread
Tasks.
The Socket read accounted thread pool percentage (ThreadPoolPercentSocketReader) attributes can be set to read from the socket
The maximum percentage of the message thread of execution. The optimal value of this property is specified in accordance with the needs of the application. The default value is
33, the effective range between 1-99.
Allocation execution threads as socket read server processing speed and the ability to accept customer request. The need to balance the executive
Line number of threads to focus on reading the message from the socket, and also the need to balance the server handle the actual task execution
Thread.
5.9 socket to read the number of threads operating settings for the server instance
1. Boot Manager server, the domain console.
2. Expand the left panel Servers node, Domain Services configuration.
3. Click on the name of the service you want to configure.
4. Select the configuration (Configuration) -> adjust (Tuning) tab.
5. Socket Reader Edit the percentage of Java reader thread. Java socket reader thread is based on enforcement
Calculated as a percentage of the line number of threads.
6. Application (Apply) to adjust.
5.10 Socket read client set the number of threads
On the client, you can configure the the socket read number of threads running on the JVM (Java Virtual Machine). Specified Socket read,
Need to define the following parameters by using java command line:
-Dweblogic.ThreadPoolSize = value
-Dweblogic.ThreadPoolPercentSocketReaders = value
5.11 to optimize the execution queue overflow condition
You can configure WEBLOGIC to monitor and ready to respond to a potential overflow, regardless of its occurrence in the default execute queue or
The user-defined queue. Once the current queue size to achieve user-defined fast percentage, WebLogic that a queue
Possible overflow.
When this limit is reached, the server changes it's in good condition "warning", then allocate additional threads to handle ultra-negative
Charge of the work, so as to restore its size.
In order to automatically monitor and respond to the overflow, you can configure the following items:
1. The queue length limit percentages, this value is the percentage of the queue size.
2. When the overflow occurs, added to the queue, the number of threads. These additional threads to restore the queue to the normal operating
Size.
3. The maximum number of threads, in exceptional circumstances, the thread largest number used to protect the server in response to the overload, excessive
The allocation of the number of threads.
5.12 to optimize the implementation of the queue monitoring behavior
When a thread in the queue to become clogged, WebLogic will automatically monitored. It can not complete blockage thread
The current work or accept new work, the server each time the diagnosis a blockage thread, entered in a message to the log. As
If a queue, all threads become clogged server to change the good condition as "warning" or "crisis", depending on the
The following situations:
n If all threads in the default queue becomes clogged, the server state into a "crisis". (You can set up section
Point Manager (Node Manager) application to automatically shut down and restart the server. )
n If weblogic.admin.HTTP, weblogic.admin.RMI or user-defined queue threads
Become clogged, the server status becomes "warning".
The WebLogic Diagnostic to a blocked thread, if it is a continuous work within the specified time (no idle). You
Server threads that can be adjusted to monitor behavior, it is by changing the length of time before clogging the thread was diagnosed and server verification blocking
Plug threads frequency.
Note: Although you can change the the standard WebLogic decision a thread is blocked, but you can not change the default behavior,
Gridlock server settings "warning" or "crisis" behavior.
Configure the WebLogic plug the thread monitoring behavior steps:
1. Start WebLogic, access the management console.
2. You want a modified to improve clogged line monitoring and the name of the server instance.
3. Select the configuration (Configuration) -> adjust (Tuning) tab.
4. Modify the following parameters:
n clogged the thread maximum time (Stuck Thread Max Time): Enter the number of seconds, the thread must be continuous operation
Line, the server will diagnose this thread as a blockage. By default, WebLogic thread continuously running 600
Seconds after set to clogging.
n clogging threads interval (Stuck Thread Timer Interval): Enter the number of seconds, this time
WebLogic periodically scan threads to achieve in order to discern whether they are continuously running a thread through a clogging
Thread maximum time attribute specifies the length of time. The default interval is 600 seconds.
5. Application (Apply) set.
6. Restart the server.
Timeout time of 5.13 set HTTP submitted
In console in weblgoic the: MyDomain-> Servers-> MyServer-> Protocols-> HTTP has a shut
Post Timeout configuration is used to set the time submitted using HTTP, but the parameters generally use the default values can be
Sixth, to optimize the connection cache
The elements in the Config.xml file to accept the cache number (AcceptBacklog) of property is used to set the request WebLogic instance
The number of connections refused additional requests to accept a set number of cache. AcceptBacklog attribute specifies the number of
TCP connection cache in the waiting queue, the fixed queue storing the TCP stack has received but the application has not yet received
To the connection request. The default value is 50, and the maximum value is determined by the operating system.
The console adjustment to accept a the caching number of steps:
1. Start WebLogic, access the console.
2. Expand the left panel Servers node.
3. Click on the name of the server instance you want to configure.
4. Select the configuration (Configuration) -> adjust (Tuning) tab.
5. Acceptance of the need to modify the default the caching number (Accept Backlog):
n during operation, if many clients are connected not respond to or denied, and the server side there is nothing wrong with
Erroneous message stating that the value may be too small cache.
n If you receive when you access the WebLogic reject the connection (connection refused) "prompt,
Should be increased to 25% of the value of the default cache. Continue to increase to 25% of its value, this prompts until it stops.
6. Click Apply (Apply), to save the settings.
How to improve the performance of the JDBC connection pool
Create a JDBC connection with the DBMS is very slow. If the application requires a database connection and disconnect
This created a major cause performance problems. WebLogic connection pool provides an efficient solution to
Solve this problem.
When you start WebLogic open a connection pool, in order to connect to all customers. When a client closes a connection, this
The connection is returned to the connection pool for use by other customers. Connection itself is not closed. So with minimal cost to achieve
Connect and disconnect the connection pool.
In the connection pool should create connect? Connection pool based on the maximum number and the minimum number of configuration parameters between increase or
Reduce connection. The best performance should be the same as the number of connections and the number of the current client session (Session).
Adjustment of 7.1 JDBC connection pool initial capacity
In the connection pool configuration, the in JDBCConnectionPool element InitialCapacity attributes can set the number of connections, create
Physical database connection. If the server can not create the number of connections, the connection pool creation will fail.
During development, in order to enable the server to start up faster, you can easily set InitialCapacity property value is small.
Product system, it should the value of InitialCapacity is set with same value MaxCapacity, default product models
The value of the formula is 25. In this way, when the server starts, all connections will be created. If you adjust the MaxCapacity
Value, must be convinced that InitialCapacity value the same the setting MaxCapacity value.
If InitialCapacity less than MaxCapacity value, when the load increases, the server needs to create additional database even
Connection. When the server is in the low-load, all resources should be done as soon as the request, instead of creating a new database links
Connection.
7.2 to adjust the maximum capacity of the JDBC connection pool
In MaxCapacity property JDBCConnectonPool elements set the connection pool contains the largest physical database connection
Number. Different JDBC drivers and database servers may limit the number of physical connections.
The default maximum capacity equal to the default number of threads: development mode 15, the products mode for 25. However, in the product
, Recommended that the number of connections is equal to the number of the current client session (Session). Capacity and execute the server-side connection pool
The row number of threads that is independent of the user session in progress for more than a thread of execution.
7.3 reserved JDBC connection and recycling activities not connected
Services-> JDBC-> Connection Pools-> MyConnection (the name of the connection pool you created)
Inactive Connection Timeout -> Configration-> Connections (Advanced Options) of this parameter
Number to set the default to 0, unlimited connection time. You can set up a time value, connecting more than this
The time value, it will connect to force back into the connection pool.
Services-> JDBC-> Connection Pools-> MyConnection (the name of the connection pool you created)
-> Configration-> Connections (Advanced Options) Connection Reserve Timeout, set
Connection hold time, default is 10s
Eight, set the Java compiler
Compiled JSP Servlet standard Java compiler javac. You can set the java compiler si or jikes instead of javac
This can greatly improve performance. Discussed below, a set of steps and the matters to be considered.
8.1 compiler changed through the console
1. Start the server, access the console.
2. Expand the left panel Servers node.
3. Click on the name of the server instance you want to configure.
4. Select the configuration (Configuration) -> conventional (General) edit box compile Java Compiler
Is the full path. Such as: c: \ visualcafe31 \ bin \ sj.exe
5. Click on the Advanced Options (Advanced Option) -> Show, show other properties.
6.
Full path by adding (Append) the Classpath box to enter into the JRE rt.jar library. Such as:
BEA_HOME \ jdk141_02 \ jre \ lib \ rt.jar
7. Click Apply.
8. Restart the server.
8.2 the Weblogic.xml file compiler
n use compileCommand parameter to specify the Java compiler.
n use procompile parameter configured WebLogic, JSP precompiled start WebLogic.
<jsp-descriptor>
<jsp-param>
<param-name> compileCommand </ param-name>
<param-value> javac </ param-value>
</ Jsp-param>
</ Jsp-descriptor>
8.3 compile EJB container classes
EJB2.0 and 1.1 container classes to compile use Weblogic.appc the function. If you compile Jar files deployed EJB container
You must use weblogic.appc to generate container classes. By default, EJB javac compiler. In order to get with good
Performance, specify a different compiler (such as Symantec's sj) using the-compiler flag
8.4 compiler in UNIX environment
Compile JSP files on a UNIX machine, if you receive the following error message:
failed: java.io.IOException: Not enough space
Try some or all of the following solution:
n If you have only 256MB of memory, add more memory.
n limited file description file, such as:
set rlim_fd_max = 4096
set rlim_fd_cur = 1024
n Start the JVM-native flag to use its own thread.
IX WebLogic cluster to improve performance
WebLogic cluster is a group of WebLogic instances together with anti-overload and its own copy of the function to use a
Domain for all customer support scalable high availability run. Cluster for the client is a single server, but actually
A group of servers to improve reliability and scalability.
9.1 Scalability and high availability - Cluster
Scalability is a system to increase the ability of one or more components as a system resource. Typically, these components enable concurrent
Households are supported, concurrent transactions can be processed in a specific unit of time.
Assumed that the application is well-designed, it can add more resources to improve performance. In order to increase the WebLogic
Processing load, simply add a WebLogic instance to your cluster - without changing the application. Cluster to improve
Two key benefits: scalability and availability, which is unmatched by a single server.
WebLogic cluster to J2EE scalability and high availability, and is transparent to application developers
's. Scalability extends the capacity of the intermediate layer, more than a single WebLogic server or single computer can handle
's. The only restriction is that all WebLogic cluster members must use IP multicast communication. WebLogic dynamic
The state increased cluster, in order to increase the processing capacity.
WebLogic cluster to ensure high availability through redundancy of multiple servers to reduce the customer's request failed. Cluster
A server can provide the same service. If a server stops running, the other can take over the running. This functions as a client
Increased availability.
Warning: If you want to solve the neck bottles of applications and environments, adding additional servers to the cluster should provide linear
Scalability. Benchmarks and initial configuration of the test run, before you moved to a clustered environment, the application isolation in a separate
Tested on the server.
9.2 multi-server instances running on multi-CPU machines, the performance should be considered to ask
Title
On multi-processor machines, you must consider to clustered WebLogic number of instances should be proportional to the number of the CPU. Because the WebLogic
There is no built-in limit of the number of server instances in a cluster, large-scale, multi-processor servers, such as Sun's Sun
Enterprise 10000, has as a very large clusters or multiple clusters host of potential.
Thoroughly test your application and determine the best server and the CPU ratio is determined as follows:
network requirements if you find Web applications are mainly affected by the network I / O limitations in the number on the CPU before, consider
Test network throughput. If the actual network I / O limitations, installing a faster network interface card (NIC) can
To provide performance, rather than adding additional CPUs, because waiting to read socket, more CPU is in idle
Position.
disk I / O requirements if you find Web applications by disk I / O limitations. Configure additional CPU
Should consider increasing disk speed or single disk.
In short, configure additional CPU must make sure that the Web application is subject to the CUP restrictions, rather than by the network
Or disk I / O limitations.
For CPU-bound applications, each CPU on the initial performance testing on a WebLogic instance. If the CPU
Utilization is the same or close to 100%, and then increase the CPU specific gravity (eg, configured for a WebLogic instance
A CUP), remember the product mode, there should be some idle CPU cycles to perform administrative tasks.
Web application processing needs changing, but BEA ideal found the WebLogic instances with CPU
The ratio is 1:2.
10, monitor WebLogic domain
Health status and performance tools for monitoring WebLogic domain management console. Through the console, you can observe
The WebLogic resource status and statistical information, such as servers, HTTP, JTA subsystem, JNDI, security, CORBA
Connection pools, EJB, JDBC and JMS.
For example, the Server -> Monitoring -> Performance for the current server instance and wait for and shipped
The request of the state of the line performance reference. It includes the following information:
queue idle threads.
queue requests waiting for the longest time.
throughput, measured according to the number of requests processed.
queue length, according to the number of requests waiting in the queue to measure.
JVM heap memory amount.
11, weblogic cluster
10.1 Introduction
Managed Server icon
Explanation of terms:
1. Domain is the basic administrative unit of the WebLogic Server instance. By Administrator Server is configured to
WebLogic Server instances management logic unit, this unit is a collection of all resources. Central configuration file
Pieces called config.xml. A domain that contains one or more WebLogic Server instances, these instances can be group
Set of instances, non-clustered instance, or a combination of clustered and non-clustered instance. A domain can contain more than one cluster. Group
Centralized server instance must reside in the same domain; cluster - split "into multiple domains. Similarly,
Configured resource or subsystem can not be shared between domains. For example, if in one domain to create a JDBC connection slow
Buffer pool, can not be used in another domain server instance or cluster. (But must be created in another domain
Similar connection pool).
2. Managed Server, Management Server is used to deploy to run a variety of applications. A domain of one or more
Stage management server in a production environment, the domain consists of a management server and managed server. At the start of this
The domain managed server, you must first start the management server, the managed server startup, will be ordered from the management
The server configuration information. In this way, the management server configuration control center for the entire domain. A domain can have
An active management server. Server management server and management server is a many-to-one, and managed by management
Server unified management
3. Administrator Server, Management Server is used to manage the configuration domain center point, in general, management server
Is not on the deployment of the application (the application should be deployed to the managed server: Managed Server), while
Is used to unified management, configuration, monitoring, management server and deploy applications to the management server. A
Domain and only one management server, management server and the domain is a one-to-one. In each domain, there is only one
WebLogic Server instance acts as a management server: This server instance configuration, management and monitoring of domain the
Other managed server instances and resources. Each management server only manage a domain. If a domain contains more
Clusters, each cluster in the domain has the same management server
4. Machine, the machine is a physical concept, on behalf of a running WebLogic application server is the machine
Including its IP address and other information. A domain may include multiple machines.
5 agent
cluster by the agent to achieve load balancing. Forwards the request to a different management server up.
The proxy is used to distribute the user request, the agent can be a hardware device may also be a software Web server. Generally hard
Some powerful, pieces of agent performance and stability better than software agents.
The main the hardware manufacturers: F5 Networks, Radware, array, waves of trends
software agents: IIS, Apache, weblogic HTTP server.
10.2. Cluster diagram
To weblogic as agent to configure the cluster to better improve performance, you can use the hardware as their agent
Agent diagram:
Physical diagram:
Schematic: management server reads the configuration information to manage the service instances in the cluster
10.3 Create Cluster
Deployment table (IP, PORT)
Machine name
Machine type
Configuration
Role
Machine49 Window XP
Machine49 Window XP
Machine49 Window XP
Machine49 Window XP
Machine48 Window XP
192.168.8.49:7001
192.168.8.49:7008
192.168.8.49:7009
192.168.8.49:7000
192.168.8.48:7001
Administrator Server
Managed Server
Managed Server
Proxy Server
Managed Server
10.3.1 create a management server (Manager Server)