您的位置:首页 > 其它

中间件参数设置推荐--性能诊断调优

2011-03-30 10:14 309 查看
WebSphere provides JVM tunings that can help you increase throughput for your application. Default settings by WebSphere usually do NOT provide such increased throughput because they assume your hardware is not the most high-end. To take advantage of your large memory, and more CPUs, you will be better off set some tuning parameters to larger values.

You should apply the following parameters and try measuring your application again. Then find the settings that best fit you.

推荐指标

Tuning Parameter
Values used for AIX
Values used for Solaris
Values used for Windows
JVM Settings (WebSphere Administrative Console -> Servers -> Application Servers -> myapp -> Process Definition -> Java Virtual Machine)
Initial heap size (MB)
1280
1024
1024
Maximum heap size (MB)
1280
1024
1024
Garbage collection options
-Xgcpolicy:optavgpause
NA
-Xgcpolicy:optavgpause
Generic JVM arguments
-Xnoclassgc
-Xnoclassgc
-server
-XX:NewSize=200M
-XX:MaxNewSize=200M
-XX:SurvivorRatio=12
-Xnoclassgc
Web Container Service Settings WebSphere Administrative Console -> Servers -> Application Servers -> myapp -> Web Container -> Thread Pool)
Minimum active threads (in pool)
70 threads
35 threads
75 threads
Maximum active threads (in pool)
70 threads
35 threads
75 threads
Allow threads allocated beyond maximum
No
no
no
Thread inactivity timeout
100 sec.
100 sec.
100 sec.
Maximum (connections) keep alive
135 conn.
25 conn.
25 conn.
Connection backlog
500 conn.
500 conn.
500 conn.
Session (WebSphere Administrative Console -> Servers -> Application Servers -> myapp -> Web Container -> Session Management)
Session Timeout
10 min
10 min
10 min
Special environmental variables (WebSphere Administrative Console -> Servers -> Application Servers -> myapp -> Process Definition -> Environment Entries -> New)
LDR_CNTRL
MAXDATA=0x40000000
(None)
(None
The meaning of some of the above parameters:

Setting the JVM heap size larger than 256MB For the best and most consistent throughput, set the (-Xms) starting minimum and (-Xmx) maximum the same size. Also, remember that the value for the JVM heapsize is directly related to the amount of physical memory for the system. Never set the JVM heap size larger than the physical memory on the system to avoid disk I/O caused by swapping.

Session timeout 10 minutes The default value of Session Timeout is 30 minutes. Reducing this value to a lower number can help reduce memory consumption requirements, allowing a higher user load to be sustained for longer periods of time. Reducing the value too low can interfere with the user experience. Please determine this based on your end user requirements: if they mostly have quick tasks to finish, set this low; if they have long tasks to finish, set this higher.

Class Garbage Collection -Xnoclassgc Using the "-Xnoclassgc" parameter will allow for more class reuse, thus causing less garbage collections to occur.

Servlet engine thread pool size 70 In our testing, we used 70 for both the minimum and maximum settings. Ideally, set this value and monitor the results using the Tivoli Performance Viewer. Increase this value if all the servlet threads are busy most of the time.

Solaris-specific tuning parameters HotSpot option -server The "server" mode offers higher throughput than the "client" mode, at an expense of slightly longer startup times. We recommend using "server" mode for higher throughput.

Garbage collection tuning: NewSize and MaxNewSize 200M To help optimize Java garbage collection duration and frequency, we set the parameters -XX:NewSize and -XX:MaxNewSize to 200 MB.

Garbage collection tuning: SurvivorRatio 12 To help optimize Java garbage collection duration and frequency, we set the parameter -XX:SurvivorRatio to 12. The above two Solaris-specific parameters are especially helpful if garbage collection is showing high frequency and takes several seconds to finish under heavy workloads.

AIX-specific tuning parameters By default, the application server will not start on AIX with a heap size larger than 1GB. To allow larger a JVM heap size, set the environment variable LDR_CNTRL=MAXDATA=0xn0000000 where n is the number of segments you need. For a 2GB heap, use n=2. For 1792MB, use n = 3 and so on. Set it to 0 for 1.3.x to go to 2560MB. For example, for a 1.5 GB heap: LDR_CNTRL=MAXDATA=0x40000000 The application server will fail to start if this parameter is not set properly (i.e., a 1536MB heap size for JVM without the parameter will not allow you to start the eClient_Server on AIX).

This environment variable is available in AIX 4.3.3.10 and later. If you are using an older 4.3.3 version, you must upgrade to get this support.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: