performance modelling with process algebrasjb/pub/jeh_slides_051102.pdf · transition system...

30
Performance Modelling with Process Algebras Jane Hillston Laboratory for Foundations of Computer Science The University of Edinburgh, Scotland Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Upload: others

Post on 13-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

Performance Modelling with Process Algebras

Jane HillstonLaboratory for Foundations of Computer Science

The University of Edinburgh, Scotland

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 2: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

1

Structure of this talk

• Stochastic Process Algebra (PEPA)

• Benefits of Compositionality:

– Model Construction– Model Manipulation– Model Solution

• Quasi-reversibility

• Term-rewriting to uncover quasi-reversible PEPA models

• Conclusions

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 3: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

2

Performance Modelling using CTMCModel Construction

• describing the system using a high level modellingformalism

• generating the underlying CTMC

Model Manipulation

• model simplification• model aggregation

Model Solution

• solving the CTMC to find steady state probabilitydistribution

• deriving performance measures

MARKOV PROCESS

Q =

..........

..........

.....

...............

SYSTEM

HIGH LEVEL MODEL(GSPN, SPA, etc.)

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 4: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

3

Stochastic Process AlgebraAttractive features of process algebras

• Compositionality• Formal definition• Parsimony

+ Quantification

• Actions have duration• Probabilistic branching

Models are constructed from components who engage in activities with anassociated stochastic delay

(α, F ).P�

���* HHHHY

6

action typeor name

component/derivative

prob. distributionfunction governing

delay due to activity)

SPA MODEL LABELLED MULTI-TRANSITION SYSTEM

STOCHASTICPROCESS

- -SOS rules state transitiondiagram

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 5: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

4

Markovian Process AlgebraWhen we are interested in a Continuous Time Markov Chain (CTMC) as theunderlying stochastic process we must restrict all delays to be governed by anegative exponential distribution:

(α, r).P�

���*H

HHHY6

action typeor name

component/derivative

activity rate(parameter of an

exponential distribution)

Performance Evaluation Process Algebra (PEPA)

In PEPA probabilistic branching is introduced by the race policy: there are noexplicitly probabilistic combinators.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 6: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

5

PEPAS ::= (α, r).S | S + S | AP ::= S | P ��

LP | P/L

PREFIX: (α, r).S designated first actionCHOICE: S + S competition between components (race policy)

CONSTANT: Adef= S assigning names to components

COOPERATION: P ��L

P α /∈ L concurrent activity (individual actions)

α ∈ L cooperative activity (shared actions)HIDING: P/L abstraction α ∈ L ⇒ α → τ

PEPA MODEL LABELLED MULTI-TRANSITION SYSTEM

CONTINUOUS TIMEMARKOV CHAIN Q

- -SOS rules state transitiondiagram

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 7: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

6

Example

Browserdef= (display, p1λ).(cache, m).Browser +

(display, p2λ).(get, g).(download,>).(rel, r).Browser

Serverdef= (get,>).(download, µ).(rel,>).Server

W EBdef=

((Browser ‖ Browser

)/{cache}

)��

LServer

where L = {get, download, rel}

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 8: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

7

Benefits of Formality

Model Construction: Compositionality leads to

• ease of construction• reusable submodels• easy to understand models

Model Manipulation: Equivalence relations lead to

• term rewriting/state space reduction techniques• aggregation techniques based on lumpability

Model Solution: Characterisation of “ideal” forms: identifying classes of modelssusceptible to efficient solution based on compositional structure.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 9: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

8

Model Manipulation

Model simplification: replace one model by another which is more attractivefrom a solution point of view, e.g. smaller state space, special class of model,etc. Here we look for a model-model equivalence to justify the substitution.

Model aggregation: establish a partition of the state space of a model, andreplace each set of states by one macro-state, i.e. take a different stochasticrepresentation of the same model. Here we look for a state-state equivalenceto define a sensible partition.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 10: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

9

Model Manipulation in PEPAVarious equivalence relations have been defined for PEPA and their suitability formodel manipulation established.

Simplification: weak isomorphism allows intermediate states in a sequence of τactions to be eliminated and thus allows the state space to be reduced.

Aggregation: strong equivalence detects repeated patterns of behaviour andallows one representative of each such pattern to be chosen.

Since these equivalence relation are congruences the techniques are complementaryto the compositional structure

⇒ submodels may be simplified or aggregated in isolation and then replacedwithin the original model expression

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 11: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

10

Decomposed Solution of MPA models

������������������������������������������������������������

������������������������������������������������������������

��������������������������������������

��������������������������������������

������������������

����

������������������

� � � ���������

������������

������������ ������������

π(M)

M

M = (m1, m2, ...., mn)

m1 m2

A

Partition the model M inton submodels m1, m2, . . . , mn.Treating each submodel as a singlestate form the aggregated model A.

In isolation, find the steady statedistribution π for each of thesubmodels mi and for the aggregatedmodel A.

Apply disaggregation function fto the π(mi) and π(A) to find thesteady state distribribution ofthe original model M (approximately).

To what extent do the submodels relate to existing components within SPA models.....?

π(M) = f(π(m1), π(m2), ..., π(mn), π(A))

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 12: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

11

MPA models with Product Form Distribution

������������������������������������������������������������

������������������������������������������������������������

��������������������������������������

��������������������������������������

π(M)

M

M = (m1, m2, . . . , mn)

m2m1

Partition the model M into nstatistically independentsubmodels m1, m2, . . . , mn

In isolation, find the steady statedistribution π for each of thesubmodels mi

Form the steady state distribution of Mas the product of the solutions for eachsubmodel mi and a normalising constant

When do SPA components behave as if they were statistically independent.....?

π(M) = G × π(m1) × π(m2) × . . . × π(mn)

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 13: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

12

Product Form MPA ModelsP ≡ S1 ‖ S2

�������

HHHHHHj

Add direct interaction of a restrictedtype between components with aparticular structure

P ≡ S1 ��L

S2

S1, S2 and L all restricted

• Quasi-reversibility• Reversibility• Routing process approach

Add indirect interaction via anothercomponent which has a particularstructure and type of interaction

P ≡ (S1 ‖ S2) ��L

R

L and R restricted (wrt S1 and S2)

• ”Boucherie” resource contention• Queueing discipline models• Quasi-separability

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 14: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

13

Quasi-Reversibility (QR)Quasi-reversibility: the conditions under which the stations of a queueing networkbehave as if they were independent

PEPA components

interactions flow between queues

queues

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 15: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

14

Recognising QR Product Form in PEPA

• define a notion of action α and complementary action −α

• a QR component is a component which enables actions α1, . . . αn at constantrates in all derivatives and each αi-derivative enables a complementary actions−αi

• in the component P ��L

Q, α ∈ L is a channel from P to Q if α is an actionof Q and a complementary action of P

• P ��L

Q is termed a flow cooperation if every α ∈ L, which is an action of Por Q, forms a channel

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 16: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

15

Theorem(Open Interactions)In steady state, an (open) flow cooperation of QR components has the followingproperties:

1. the underlying Markov process is quasi-reversible2. the marginal states of the individual components are independent3. for each component the steady state distribution is as it would be if the

component were in isolation4. in time reversal the model is also a flow cooperation of QR components

Consequences

”Traffic equations” can be used to determine the influence of the rest of the modelon each component (input rates). Then each component may be solved separatelyand the results combined to obtain the complete steady state distribution.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 17: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

16

Characterising QR PEPA models

PEPA models with quasi−reversible MP

Quasi−reversible

PEPA QR processes

Markov processes

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 18: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

17

Expanding the characterisation

PEPA models with quasi−reversible MP

Markov processesQuasi−reversible

PEPA QR processes equivalent, alternativePEPA models

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 19: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

18

Transformation Approach

• The objective is to take a model (which does give rise to a quasi-reversible Markov process but which is not evidently a QR PEPA model) andsystematically transform it using the equivalence relation strong equivalence.

• Previous general attempts at defining transformation systems have not beensuccessful.

• Here we work within a more constrained system since we assume that all themodels considered are QR in some representation, e.g. all cooperations arechannels etc.

• If the considered model is not QR this will become apparent because applyingthe rules will lead to inconsistent conclusions about channels and/or states.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 20: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

19

State vectors• Given that we often want to separate components from a sequential form it is

useful to work in terms of vectors of states.

• In the case we know that there are two or more components the entries in thevector represent the local states of the individual components.

• In the case where we are presented with a single component which we suspectof being compound we use the vector in a purely syntactic way.

For a model expression, we define the vector form inductively over the structureof the expression: let P and Q be expressions and C be a constant denoting asequential component.

1. vf(P ��L

Q) = (vf(P ), vf(Q))L

2. vf(C) = C

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 21: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

20

PEPA operational semantics for state vectors (1)

Prefix

(α, r).(P,Q)L

(α,r)−−−→ (P,Q)L

Choice

(P,Q)L

(α,r)−−−→ (P ′, Q′)L

(P,Q)L + (R,S)K

(α,r)−−−→ (P ′, Q′)L

(R,S)K

(α,r)−−−→ (R′, S′)K

(P,Q)L + (R,S)K

(α,r)−−−→ (R′, S′)K

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 22: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

21

Cooperation

(P,Q)L

(α,r)−−−→ (P ′, Q′)L

((P,Q)L, (R,S)K)M

(α,r)−−−→ ((P ′, Q′)L, (R,S)K)M

(α /∈ M)

(R,S)K

(α,r)−−−→ (R′, S′)K

((P,Q)L, (R,S)K)M

(α,r)−−−→ ((P,Q)L, (R′, S′)K)M

(α /∈ M)

(P,Q)L

(α,r1)−−−→ (P ′, Q′)L (R,S)K

(α,r2)−−−→ (R′, S′)K

((P,Q)L, (R,S)K)M

(α,s)−−−→ ((P ′, Q′)L, (R′, S′)K)M

(α ∈ M),

where s =r1

rα(P ��L

Q)r2

rα(R ��K

S)min(rα(P ��

LQ), rα(R ��

KS))

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 23: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

22

Rule 1: State Vector PrefixAssume P and Q are a pair of flow cooperating components, in the cooperationP ��

LQ, with derivative state vector (P ′, Q′)L.

Rule 1.1 If α is a channel, such that α ∈ ~A(P ) ∪ ~A(Q) and α ∈ L, then

((α, r).P ′, (α, r).Q′)L = (α, r).(P ′, Q′)L

Rule 1.2 If α /∈ L, then

((α, r).P ′, Q)L = (α, r).(P ′, Q)L

Rule 1.3 If α /∈ L, then

(P, (α, r).Q′)L = (α, r).(P,Q′)L

This rule dictates when a state vector may be prefixed by an activity.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 24: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

23

Rule 2: State Vector ChoiceAssume P and Q are a pair of flow cooperating components, in the cooperationP ��

LQ, with derivative state vectors (P ′, Q′)L and (P ′′, Q′′)L. If α and β are

channels such that {α, β} ⊂ ~A(P ) ∪ ~A(Q) and {α, β} ⊂ L, then

((α, r).P ′+(β, s).P ′′, (β, s).Q′′+(α, r).Q′)L = (α, r).(P ′, Q′)L+(β, s).(P ′′, Q′′)L

This rule shows how choice between state vectors arises, when there are twochannels between the components.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 25: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

24

Rule 3: Activity BlockingAssume P and Q are a pair of flow cooperating components, in the cooperationP ��

LQ, with derivative state vector (P ′, Q)L, Q ≡ (β, s).Q′. If β is a channel

such that β ∈ ~A(Q) and β ∈ L, then

((α, r).P ′, (β, s).Q′)L = (α, r).(P ′, Q)L

where α 6= β and α /∈ L

This rule defines how progress may be blocked by the cooperation set. The activity(β, s) affects only the state of the Q component (left hand side). Behaviourallythis is not possible as (β, s) is a channel : it must affect the state of bothcooperating components. Since (β, s) does not appear in both tuple elements thetransformation rule discards its effect on the combined state as invalid.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 26: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

25

Rule 4: Choice and CooperationAssume P and Q are a pair of flow cooperating components, in the cooperationP ��

LQ, with derivative state vectors (P ′, Q)L,and (P ′′, Q′′)L, Q ≡ (β, s).Q′′. If

β is a channel such that β ∈ ~A(P ) ∪ ~A(Q) and β ∈ L, then

((α, r).P ′ + (β, s).P ′′, (β, s).Q′′)L = (α, r).(P ′, Q)L + (β, s).(P ′′, Q′′)L

where α 6= β and α /∈ L.

Here (β, s) appears in both tuple elements hence the transformation rule accountsfor its effect on the combined state. Note that the term (β, s).(P ′′, Q′) describesa flow transition whose input-output nature is reflected in the fact that both thestate of the source P and that of the destination Q must change.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 27: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

26

Rule 5: Choice, Cooperation and BlockingAssume P and Q are a pair of flow cooperating components, in the cooperationP ��

LQ, with derivative state vectors (P ′, Q)L,and (P ′′, Q′′)L, Q ≡ (γ, t).Q′. If

β and γ are channels such that {β, γ} ⊂ L, β ∈ ~A(P ) ∪ ~A(Q) and γ ∈ ~A(Q)then

((α, r).P ′+(β, s).P ′′, (β, s).Q′′+(γ, t).Q′)L = (α, r).(P ′, Q)L+(β, s).(P ′′, Q′′)L

where α 6= β 6= γ and α /∈ L.

This rule is a generalisation of Rule 3 and Rule 4.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 28: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

27

Implementation

• Having now developed a set of formally defined transformations on PEPAmodels we have implemented these in a term rewriting system which checksthe correct application of each of these rules.

• Our system is called the PEPA Term Kit and we have used it to check severalexample derivations.

• The PEPA Term Kit is implemented in the strongly-typed functional languageStandard ML which provides a metalanguage for defining other formallanguages, whether they are programming languages or modelling languagesas is the case for PEPA here.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 29: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

28

Using the PEPA Term Kit

• The PEPA Term Kit presents users with an interactive top-level loop whichallows them to enter model definitions, fold and unfold definitions and applyrewriting rules.

• After experimenting with the interactive application of the rules to strengthenunderstanding, the user can define tactics as in the style of Edinburgh LCF.

• These tactics can be used to apply combinations of rules in a single step.

• The necessary uses of rules and tactics to prove a desired goal can be storedin a proof script which can be replayed as needed.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002

Page 30: Performance Modelling with Process Algebrasjb/pub/jeh_slides_051102.pdf · TRANSITION SYSTEM STOCHASTIC PROCESS SOS rules state transition diagram Jane Hillston Performance Modelling

29

Conclusions

• Stochastic process algebras have many attractive features for performancemodelling and are gaining acceptance within the performance community.

• Our experience with PEPA has been that the combination of a well-definedformal semantics for the language and (modest, but usable) tool support forthe language enabled us and others to use it effectively.

• The compositional structure of the process algebra can be exploited to findefficient solution techniques for some PEPA models.

• However the usefulness of characterisations of ideal forms for solution willalways be limited and further work is needed on transformation systems andapproximation techniques based on these characterisations.

Jane Hillston Performance Modelling with Process Algebras 6th Nov 2002