work manager

Upload: ashish10mca9394

Post on 07-Jul-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 Work Manager

    1/47

    WebLogic Server 9/10 Administration L2

    Work Manager

    Prachi Joshi

  • 8/18/2019 Work Manager

    2/47

    2

    Objectives

     At the end of this session, participant should be able to

    Explain WebLogic thread pool Describe the concept of Work Manager 

    Use Work Managers to Optimize cheduled Work

  • 8/18/2019 Work Manager

    3/47

    3

    Contents

    WebLogic er!er "hread #ools

    $ntroduction to Work ManagersWork Manager %omponents

    %onfiguring Work Manager 

    &e'uest %lasses

    %onstraints

    tuck "hread (andling

    Work Manager cope Default Work Manager

    )lobal Work Managers

     Application*scoped Work Managers

    Deplo+ment Descriptor Examples

  • 8/18/2019 Work Manager

    4/47

    4

    Thread oo! in O!der "ersions

    #rocessing as performed in multiple execute 'ueues

    Different classes of ork ere executed in different'ueues, based on priorit+ and ordering re'uirements, and

    to a!oid deadlocks

    $n addition to the default execute 'ueue,

    eblogic-kernel-default, there ere pre*configured 'ueuesdedicated to internal administrati!e traffic, such as

    eblogic-admin-(""# and eblogic-admin-&M$

    "hread usage as controlled b+  Altering the number of threads in the default 'ueue

    %onfiguring custom execute 'ueues to ensure that particular

    applications had access to a fixed number of execute threads,

    regardless of o!erall s+stem load

  • 8/18/2019 Work Manager

    5/47

    5

    WebLogic Server Thread oo!s

    WebLogic er!er uses a single thread pool, in hich all

    t+pes of ork are executed

    Work is prioritized based on rules defined, and run*time

    metrics, including  Actual time it takes to execute a re'uest

    &ate at hich re'uests are entering and lea!ing the pool

    "he common thread pool changes its size automaticall+ to

    maximize throughput

    "he 'ueue monitors throughput o!er time and based on

    histor+, determines hether to ad.ust the thread count

    /or example

    $f historical throughput statistics indicate that a higher

    thread count increased throughput, WebLogic

    increases the thread count

  • 8/18/2019 Work Manager

    6/47

    6

    WebLogic Server Thread oo!s Contin#ed$

    "his strateg+ makes it easier for administrators to

     Allocate processing resources Manage performance

    $t a!oids effort and complexit+ in!ol!ed in %onfiguring

    Monitoring

    "uning

    custom executes 'ueues

  • 8/18/2019 Work Manager

    7/477

    %ntrod#ction to Work Managers

    WebLogic er!er prioritizes ork and allocates threads

    based on an execution model $t takes into account  Administrator*defined parameters

     Actual run*time performance and throughput

     Administrators can configure a set of schedulingguidelines and associate them ith One or more applications

    #articular application components

     At run time, WebLogic er!er uses these guidelines to

    assign pending ork and en'ueued re'uests to execution

    threads

  • 8/18/2019 Work Manager

    8/478

    Work Manager Com&onents

    "o manage ork in applications, folloing Work Manager

    components can be defined0

    /air hare &e'uest %lass

    &esponse "ime &e'uest %lass

    Min "hreads %onstraintMax "hreads %onstraint

    %apacit+ %onstraint

    %ontext &e'uest %lass

  • 8/18/2019 Work Manager

    9/47

  • 8/18/2019 Work Manager

    10/4710

    Con'ig#ring Work Manager

    Work Manager can be configured at

    Domain le!el  Application le!el

    Module le!el

    $t can be configured in config-xml3 %an be assigned to an+ application, or application

    component, in the domain

    eblogic*application-xml3 %an be assigned to that application, or

    an+ component of that application

    eblogic*e.b*.ar-xml or eblogic-xml3 %an be assigned to that

    component eblogic-xml3 Work Managers specified for a Web application

    Or b+ using Administration %onsole

  • 8/18/2019 Work Manager

    11/4711

    Sam&!e Work Manager

    4ork*manager5

    4name5highpriorit+6orkmanager47name54fair*share*re'uest*class5

    4name5high6priorit+47name5

    4fair*share589947fair*share5

    47fair*share*re'uest*class5

    4min*threads*constraint5

    4name5Min"hreads%ount/i!e47name5

    4count5:47count5

    47min*threads*constraint5

    47ork*manager5

  • 8/18/2019 Work Manager

    12/4712

    (e'erencing Work Manager in Web A&&!ication

    4init*param5

    4param*name5l*dispatch*polic+47param*name54param*!alue5highpriorit+6orkmanager47param*!alue5

    47init*param5

  • 8/18/2019 Work Manager

    13/4713

    (e)#est C!asses

     A re'uest class expresses a scheduling guideline that

    WebLogic er!er uses to allocate threads to re'uests

    &e'uest classes help ensure that high priorit+ ork is

    scheduled before less important ork, e!en if the high

    priorit+ ork is submitted after the loer priorit+ ork

    WebLogic er!er takes into account ho long it takes forre'uests to each module to complete

    "here are multiple t+pes of re'uest classes, each of hich

    expresses a scheduling guideline in different terms

     A Mork Manager ma+ specif+ onl+ one re'uest class

  • 8/18/2019 Work Manager

    14/4714

    'air*share*re)#est*c!ass

    pecifies the a!erage thread*use time re'uired to process

    re'uests

    /air share is a relati!e !alue and not actual percentage

    /or example, "he Work Manager for ModuleA specifies a fair*share*re'uest*

    class of ;9

    "he Work Manager for Module< specifies a fair*share*re'uest*

    class of =9

    During a period of sufficient demand, ith a stead+ stream of

    re'uests for each module such that the number re'uests exceed

    the number of threads, WebLogic er!er ill allocate ;9> and=9> of the thread*usage time to ModuleA and Module

  • 8/18/2019 Work Manager

    15/47

    15

    Sam&!e

    4ork*manager5

    4name5highpriorit+6orkmanager47name54fair*share*re'uest*class5

    4name5high6priorit+47name5

    4fair*share589947fair*share5

    47fair*share*re'uest*class5

    47ork*manager5

  • 8/18/2019 Work Manager

    16/47

    16

    res&onse*time*re)#est*c!ass

    pecifies a response time goal in milliseconds

    &esponse time goals are not applied to indi!idualre'uests

    WebLogic er!er computes a tolerable aiting time for

    re'uests ith that class

    $t is computed b+ subtracting the obser!ed a!eragethread use time from the response time goal

    $t schedules re'uests so that the a!erage ait for

    re'uests ith the class is proportional to its tolerable

    aiting time

  • 8/18/2019 Work Manager

    17/47

    17

    res&onse*time*re)#est*c!ass Contin#ed$

    /or example, ModuleA and Module< ha!e response time goals of =999 ms and

    :999 ms, respecti!el+

    actual thread use time for an indi!idual re'uest is less than its

    response time goal

    During a period of sufficient demand, ith a stead+ stream of

    re'uests for each module such that the number of re'uestsexceed the number of threads, and no ?think time@ dela+s

    beteen response and re'uest

    WebLogic er!er ill schedule re'uests for ModuleA and

    Module< to keep the a!erage response time in the ratio =3:

    "he actual a!erage response times for ModuleA and Module<might be higher or loer than the response time goals, but ill be

    a common fraction or multiple of the stated goal

    $f the a!erage response time for ModuleA re'uests is 8,999 ms-,

    the a!erage response time for Module< re'uests is =,:99 ms-

  • 8/18/2019 Work Manager

    18/47

    18

    Sam&!e

    4ork*manager5

    4name5responsetime6orkmanager47name54response*time*re'uest*class5

    4name5m+6response6time47name5

    4goal*ms5=99947goal*ms5

    47response*time*re'uest*class5

    47ork*manager5

  • 8/18/2019 Work Manager

    19/47

    19

    conte+t*re)#est*c!ass

     Assigns re'uest classes to re'uests based on context

    information, such as the current user or the current user1s

    group

    Lets +ou define re'uest classes in an application1s

    deplo+ment descriptor based on a user1s context

  • 8/18/2019 Work Manager

    20/47

    20

    Sam&!e

    4ork*manager5

    4name5context6orkmanager47name54context*re'uest*class5

    4name5test6context47name5

    4context*case5

    4user*name5s+stem47user*name54re'uest*class*name5high6fairshare

    47re'uest*class*name5

    47context*case5

    4context*case54group*name5e!er+one47group*name5

    4re'uest*class*name5lo6fairshare

    0

  • 8/18/2019 Work Manager

    21/47

    21

    Constraints

     A constraint defines minimum and maximum numbers of

    threads allocated to execute re'uests

     Also the total number of re'uests that can be 'ueued or

    executing before WebLogic er!er begins re.ecting

    re'uests

    "+pes of constraints max*threads*constraint

    min*threads*constraint

    capacit+

  • 8/18/2019 Work Manager

    22/47

    22

    ma+*threads*constraint

    Limits the number of concurrent threads executing

    re'uests from the constrained ork set

    Default is unlimited

    $t can be defined in terms of a the a!ailabilit+ of the

    resource that re'uests depend upon, such as a

    connection pool

    $t might pre!ent a re'uest class from taking its fair share

    of threads or meeting its response time goal

    Once the constraint is reached the ser!er does not

    schedule re'uests of this t+pe until the number ofconcurrent executions falls belo the limit

    "he ser!er then schedules ork based on the fair share

    or response time goal

  • 8/18/2019 Work Manager

    23/47

    23

    min*threads*constraint

    )uarantees the number of threads the ser!er ill allocate

    to affected re'uests to a!oid deadlocks

    Default is zero

     A min*threads*constraint !alue of one is useful

    /or example, for a replication update re'uest, hich is

    called s+nchronousl+ from a peer  A min*threads*constraint might not necessaril+ increase a

    fair share

    "his t+pe of constraint has an effect primaril+ hen the

    ser!er instance is close to a deadlock condition $t ill cause WebLogic er!er to schedule a re'uest e!en

    if re'uests in the ser!ice class ha!e gotten more than its

    fair share recentl+

  • 8/18/2019 Work Manager

    24/47

    24

    ca&acit,

    %auses the ser!er to re.ect re'uests onl+ hen it has

    reached its capacit+

    Default is *8

    $ncludes all re'uests, 'ueued or executing, from the

    constrained ork set

    Work is re.ected either hen an indi!idual capacit+threshold is exceeded or if the global capacit+ is

    exceeded

    "his constraint is independent of the global 'ueue

    threshold

  • 8/18/2019 Work Manager

    25/47

    25

    St#ck Thread -and!ing

    $n response to stuck threads, a tuck "hread Work

    Manager component can be defined

    $t can shut don the Work Manager 

    Mo!e the application into admin mode

    Mark the ser!er instance as failed

  • 8/18/2019 Work Manager

    26/47

    26

    .+am&!e

    /olloing Work Manager shuts don the Work Manager

    hen to threads are stuck for longer than 9 seconds

    4ork*manager5

    4name5stuckthread6orkmanager47name5

    4ork*manager*shutdon*trigger54max*stuck*thread*time5947max*stuck*thread*time5

    4stuck*thread*count5=47stuck*thread*count5

    47ork*manager*shutdon*trigger5

    47ork*manager5

  • 8/18/2019 Work Manager

    27/47

    27

    Work Manager Sco&e

    "hree t+pes of Work Managers

    %haracterized b+ its scope and ho it is defined and used

    Default Work Manager 

    )lobal Work Managers

     Application*scoped Work Managers

  • 8/18/2019 Work Manager

    28/47

    28

    e'a#!t Work Manager

    (andle thread management and perform self*tuning

    $t is used b+ an application hen no other Work Managersare specified in the application1s deplo+ment descriptors

    Default Work Manager ma+ be sufficient for most

    application re'uirements

     Applications are gi!en e'ual priorit+ for threads and arepre!ented from monopolizing them

    Default Work Manager can be o!erriden b+ creating and

    configuring a global Work Manager called default

    "his allos to control the default thread*handling beha!iorof WebLogic er!er

  • 8/18/2019 Work Manager

    29/47

    29

    When to se Work Managers

    "he default fair share is not sufficient

     A response time goal is re'uired

     A minimum thread constraint needs to be specified to

    a!oid ser!er deadlock

  • 8/18/2019 Work Manager

    30/47

    30

    !oba! Work Managers

    )lobal Work Managers are a!ailable to all applications

    and modules deplo+ed on a ser!er, in the WebLogic

     Administration %onsole and in config-xml

     An application uses a globall+*defined Work Manager as a

    template

    Each application creates its on instance hich handles

    the ork associated ith that application and separates

    that ork from other applications

    "his separation is used to handle traffic directed to to

    applications hich are using the same dispatch polic+

     Although each application implements its on Work

    Manager instance, the underl+ing components are shared

  • 8/18/2019 Work Manager

    31/47

    31

    Con'ig#ring !oba! Work Managers

  • 8/18/2019 Work Manager

    32/47

  • 8/18/2019 Work Manager

    33/47

    33

    Con'ig#ring !oba! Work Managers Contin#ed$

  • 8/18/2019 Work Manager

    34/47

    34

    Con'ig#ring !oba! Work Managers Contin#ed$

  • 8/18/2019 Work Manager

    35/47

    35

    Con'ig#ring !oba! Work Managers Contin#ed$

  • 8/18/2019 Work Manager

    36/47

    36

    Con'ig#ring !oba! Work Managers Contin#ed$

  • 8/18/2019 Work Manager

    37/47

    37

    Con'ig#ring !oba! Work Managers Contin#ed$

  • 8/18/2019 Work Manager

    38/47

    38

    Con'ig#ring !oba! Work Managers Contin#ed$

  • 8/18/2019 Work Manager

    39/47

    39

    Con'ig#ring !oba! Work Managers Contin#ed$

    'i i ! b ! k i d

  • 8/18/2019 Work Manager

    40/47

    40

    Con'ig#ring !oba! Work Managers Contin#ed$

    A !i i d W k M

  • 8/18/2019 Work Manager

    41/47

    41

    A&&!ication*sco&ed Work Managers

    Work Managers that are a!ailable onl+ to a specific

    application or module

     Application*scoped Work Managers can be defined in the

    WebLogic Administration %onsole and in the folloing

    descriptors3 eblogic*application-xml

    eblogic*e.b*.ar-xml

    eblogic-xml

    $f +ou do not explicitl+ assign a Work Manager to an

    application, it uses the default Work Manager 

     A method is assigned to a Work Manager, using the4dispatch*polic+5 element in the deplo+ment descriptor

    C 'i i A !i i d W k M

  • 8/18/2019 Work Manager

    42/47

    42

    Con'ig#ring A&&!ication*sco&ed Work Managers

    C 'i i A !i ti d W k M C ti d

  • 8/18/2019 Work Manager

    43/47

    43

    Con'ig#ring A&&!ication*sco&ed Work Managers Contin#ed$

    C 'i i A !i ti d W k M C ti d

  • 8/18/2019 Work Manager

    44/47

    44

    Con'ig#ring A&&!ication*sco&ed Work Managers Contin#ed$

    ! t i t . !

  • 8/18/2019 Work Manager

    45/47

    45

    e&!o,ment escri&tor .+am&!es

    eblogic*e.b*.ar-xml

    eblogic*e.b*.ar-xml  With %onnection #ool

  • 8/18/2019 Work Manager

    46/47

    46

    S#mmar,

    $n this session, e co!ered

    WebLogic er!er "hread #ools

    $ntroduction to Work Managers

    Work Manager %omponents

    %onfiguring Work Manager 

    &e'uest %lasses%onstraints

    tuck "hread (andling

    Work Manager cope

    Default Work Manager )lobal Work Managers

     Application*scoped Work Managers

    Deplo+ment Descriptor Examples

  • 8/18/2019 Work Manager

    47/47