Planning Number Of Instance And Thread In Web Application Server

21
Determine number of wls threads and instances BEA Systems Korea Byungwook Cho Date 10/May 2004

description

Describes how to estimate number of thread and number of instance of Web Application Server in J2EE World.

Transcript of Planning Number Of Instance And Thread In Web Application Server

Page 1: Planning Number Of Instance And Thread In Web Application Server

Determine number of wls threads and instances

BEA Systems Korea

Byungwook Cho

Date 10/May 2004

                                       

Page 2: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 2

AGENDA

Determine # of WebLogic Instance1

Determine # of WebLogic Process2

3 Q&A

Michael Duarte
need something to add some kick to this, nothing extravagent
Page 3: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 3

Determine number of WLS Thread

Page 4: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 4

1. Response Time & Think Time

Response Time

Think Time

Request Interval

Visit Time

Response Time Think Time

Transaction Time

Response Network Time

Request Network Time

ClickClick

Request Interval

Page 5: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 5

2. Concurrent User

What is concurrent user?

We will define – the user who is in front of computer to use system

10 분시간

사용자 A

사용자 B

사용자 C

사용자 D

사용자 E

Think Time

Response Time

각각의 다른 IP

10 분간 동시 사용자 3 명

Visit Time

Page 6: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 6

3. Active User

시간

사용자 A

사용자 B

사용자 C

사용자 D

사용자 E

Response Time

순간 Active User 3 명 ( 사용자 A,B,C)동시 사용자 5 명

What is active user?

We will define – the user who is in transaction

It is almost same as “number of WLS thread”

Page 7: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 7

3. Active User

Active User from Concurrent User Active User = (Concurrent User) * (Response Time /

Request Interval)

시간

사용자 A

사용자 B

사용자 C

사용자 D

사용자 E

Request Interval

Page 8: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 8

4. TPS

What is TPS Throughput(Active User) Per Second (TT=0 으로 하고 측정가 )

Measured by access log and Weblogic MBean

사용자 A

사용자 B

사용자 C

사용자 D

사용자 E

Response Time (ex 2sec) TPS=5/2 = 2.5 TPS

Page 9: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 9

4. TPS

 

TPS = Throughput / measured time [seconds]

= number of response / measured time [seconds]

= number of request / measured time [seconds]

= (Active User) / (Average Response Time) – F1

= (Concurrent User) / (Request Interval) – F2

= (Concurrent User) / (AVRT + AVTT)

 

Page 10: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 10

4. TPS

Measuring TPS From Access Log (# of request)

From WebLogic Console/Monitoring

From WebLogic MBean

Page 11: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 11

5. Formula

TPS = (Active User) / (Average Response Time) – F1

TPS = (Concurrent User) / (Request Interval) – F2

Active User = TPS * (Average Response Time) – F3

Active User = (Concurrent User) * (Average Response Time) / (Request Interval) – F4

Active User = (Concurrent User) * (Average Response Time) / [ (Average Response Time) + (Average Think Time) ] – F5

Example) 동시에 사용자 300 명 , 응답시간은 3 초이내 , Think Time 은 15 초

F5 에 따라서 Active User = 300 * 3 / (3+15) = 50 적정 쓰레드는 50 개 이상

Page 12: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 12

6. Test

# of thread from formula is just basic (min value)

You must find max value by STRESS TEST

And You must find appropriate value by monitoring WLS and tune it. – depends on JVM & AP

※ big number of thread could reduce performance. (normally 50~100 thread per instance is recommended)

Page 13: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 13

Determine number of WLS Instance

Page 14: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 14

1. Determine # of WLS instance

There is no formula but many factors exist.

Normally just one instance per box is fastest.

Page 15: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 15

2. # of Instance Determine Factor

Memory Size

Number Of Threads

Number Of GC and Time Of GC

Number Of CPU

Fail Over

Page 16: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 16

3. Factors

Memory Size JVM Heap size is less than 1GB

When (Logical memory size > Physical memory size) DISK SWAP OCCURRED It brings slow down or other trouble

Number of Threads Number of Threads is related on # of active users.

50~100 threads per instance recommended.

Page 17: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 17

3. Factors

Number of GC and Time of GC When Full GC occurred, Application is stopped.

Number of GC 3~5 Times in a day (WAS)

Time of GC 3~5 seconds recommended (WAS)

Number of CPU One instance required 1~2 CPU needed.

Fail Over Prepare for crash

Clustering, Domain

Page 18: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 18

4. Determine # of WLS Instance Summary

1 Instance One domain should be consists of more than two instance

Java Heap should be less than 1GB.

Number of threads in one WLS instance are recommended to 50~100

Number of Full GC is about 5times per day.

Time of Full GC is about 3~4 seconds

Page 19: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 19

How to?

Define performance Objective

Making Test scenario

Determine # of threads and instances

Test

Tuning

Monitoring in production

Tuning

•# of GC•GC Time•Response Time•CPU Usage•# of idle threads

•Concurrent User,AVTT,AVRT

•# of GC•GC Time•Response Time•CPU Usage•# of idle threads•E-AVTT,E-AVRT,E-Concurrent User

•Stress Test Tool / Load Runner•Field Test

Very Important!!

Page 20: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 20

Q&A

Page 21: Planning Number Of Instance And Thread In Web Application Server

©2003 BEA Systems, Inc. | 21

Thank you~~

BEA Systems Korea

Customer Support Team

WebLogic Specialist

Byungwook Cho