andrea camesi, jarle hulaas [email protected] software engineering laboratory swiss federal...

25
Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland Joint work with Walter Binder Advances in Portable Resource Management

Post on 20-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

Andrea Camesi, Jarle Hulaas [email protected] Engineering LaboratorySwiss Federal Institute of Technology in Lausanne (EPFL)Switzerland

Joint work with Walter Binder

Advances in Portable Resource Management

Page 2: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

2© Andrea Camesi and Jarle Hulaas

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Portable Resource Management

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Page 3: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

3© Andrea Camesi and Jarle Hulaas

Portable Resource Management

Physical resources

CPU, Memory, Network bandwidth, Battery power

What is Resource Management ?

Logical / conceptual resources

Threads, Sockets, etc.

Resource Management ViewsFrom outside (e.g. by the middleware)

Accounting (non-intrusive monitoring) of consumption

Controlling (possibly limiting) the consumption

From inside

Adaptive Resource-Aware applications

Units of Measurement

Bytecode instructions(CPU), Byte(Memory, Network bandwidth,..)

Page 4: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

4© Andrea Camesi and Jarle Hulaas

Portable Resource Management

What is it good for ?Software development

Monitoring and profiling of Distributed Applications

Benefits of Resource Management

Quality of Service

Billing for resource consumption

Provisioning, load balancing

Security with respect to Mobile Code

Detecting/terminating Denial-of-Service attacks

Page 5: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

5© Andrea Camesi and Jarle Hulaas

Portable Resource Management

What is it good for ?

Benefits of Resource Management

Reliability and Flexibility

Adapt behavior (algorithm) in front of resource saturation

especially in Embedded Devices, Resource-Awareness

Reliability

Accountability (liability) for resource consumption

interrupt a component and reclaim all its resources

Page 6: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

6© Andrea Camesi and Jarle Hulaas

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Portable Resource Management

Resource AwarenessHeterogeneous Distributed System

Page 7: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

7© Andrea Camesi and Jarle Hulaas

Resource Awareness

Heterogeneous Distributed System

No programming model for Resource-Awareness

No available platform (java or other) to support Resource-AwarenessNeed portability

Why portable ?

Devise methods that are portable even across platforms/languages

.Net, Resilient (?)

Explore potential of portable Resource-Awareness strategies, portable units of measurement

Page 8: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

8© Andrea Camesi and Jarle Hulaas

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Portable Resource Management

Resource AwarenessHeterogeneous Distributed System

Programming models

Page 9: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

9© Andrea Camesi and Jarle Hulaas

Resource Awareness

Programming modelsTraditional Java thread-based

Event-based (lower level)

Programmer must provide fine grained applications

Reactive model

Page 10: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

10© Andrea Camesi and Jarle Hulaas

Per-thread andper-component

accounting objectsNet Mem CPUCPUCPU CPU

Resource-reified Multi-threaded Component

(‘has a’ relation) invokes

invokes

Resource Awareness

callbacks

Mem CPU

Per-domainextensible

management objects

Net domain Memory domain CPU domain

Programming models

Page 11: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

11© Andrea Camesi and Jarle Hulaas

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Portable Resource Management

Resource AwarenessHeterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Page 12: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

12© Andrea Camesi and Jarle Hulaas

J-RAF2

Our solution: portable resource management through bytecode rewriting schemes

Our General Approach with J-RAF2

The Java Resource Accounting Framework, 2nd edition

www. .org+ =

As easy to deploy as any Java application

across all kinds of devices

If the overhead is reasonable,

why not favor a portable approach ?

Page 13: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

13© Andrea Camesi and Jarle Hulaas

J-RAF2

Execute

OriginalJava Application

(compiled)

Rewritebytecode

Transformed, Resource-reified

Version of Application

Per-thread or per-component

accounting objects

Net CPUMem

Meta-level

Execution hooks

Our General Approach with J-RAF2

Page 14: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

14© Andrea Camesi and Jarle Hulaas

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Portable Resource Management

Resource AwarenessHeterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Page 15: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

15© Andrea Camesi and Jarle Hulaas

Graphical Monitoring tool

What is Graphical Monitoring ?

Benefits of Graphical Monitoring

Visualize the behavior of a server application

Internet applications

Quality of Service, Security, Reliability

Enforce limits, reduce threads priority

High-level layer code

User-defined: Accounting, Control and Profiling applications

Page 16: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

16© Andrea Camesi and Jarle Hulaas

Graphical Monitoring tool

VM Native Code (unmanaged)

(partly unmanaged native code)

Bytecode rewriting engine

CPU-manageable runtime

Adaptable CPU management libraries

Sample CPU-monitoring policy

Layer structure

Page 17: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

17© Andrea Camesi and Jarle Hulaas

Graphical Monitoring tool

Monitoring the

Java 2D Demo

application:

- Standalone

- Applet Viewer

- Netscape browser

- Tomcat Servlet

Page 18: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

18© Andrea Camesi and Jarle Hulaas

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Portable Resource Management

Resource AwarenessHeterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

CPU Load Prediction

Approach of CPU Load

Measurements

Page 19: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

19© Andrea Camesi and Jarle Hulaas

CPU Load Prediction

What is CPU Load Prediction?Bytecode instruction counting (BIC) and CPU time

They are distinct metrics for different purposes

Profile based on BIC are precise, platform-independent, directly comparable across different environment, independent of CPU

BIC could be useful to fix absolute limit of execution time

BIC could be useful to evaluate algorithm complexity

Estimate CPU time

Number of executed bytecode instructions / elapsed CPU time

Relationship between BIC and CPU time

Intuitive relation: proportional, but not so simple

No previous workGoal: find the exact relationship

Use profiles based on BIC to accurately estimate CPU time

Difficulties:

JIT, GC, Bytecode weight

Page 20: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

20© Andrea Camesi and Jarle Hulaas

CPU Load Prediction

Benefits of CPU time Prediction

J-RAF2

Increase the value of our tools

Resource Aware

Cross development: embedded device, e.g. PDA

Heterogeneous Environment with mobile code: evaluate execution time of an application in a portable way

User defined deterministic scheduler based on BIC as application specific

ProsBetter understanding of java applications and java environment

Continuous metric give more information

Page 21: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

21© Andrea Camesi and Jarle Hulaas

CPU Load Prediction

Samples taken during a run of 201_compress on Linux machine

Measurements

Page 22: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

22© Andrea Camesi and Jarle Hulaas

CPU Load Prediction

Number of bytecodes executed per millisecond of CPU time(with Sun JDK 1.5.0 in interpreted mode, on a Sun Sparc 500 MHz machine under Solaris 9)

Number of bytecodes executed per millisecond of CPU time(with Sun JDK 1.5.0 in interpreted mode, on an Intel Pentium 2.6 GHz machine under Linux)

Page 23: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

23© Andrea Camesi and Jarle Hulaas

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

Plan

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Resource Awareness

Heterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Portable Resource Management

Resource AwarenessHeterogeneous Distributed System

Programming models

Our General Approach with J-RAF2

Graphical Monitoring tool

Layer structure

Monitoring CPU consumption

CPU Load Prediction

Approach of CPU Load

Measurements

Future research directions

Page 24: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

24© Andrea Camesi and Jarle Hulaas

Future research directions

Associate different weights to sequences of bytecode instructionsIncrease the level of precision of measurements

Use profiles based on BIC to accurately estimate CPU time

Explore aspect-oriented programming as a way of defining Resource-Awareness strategies

Explore different programming models for Resource-Aware systems

Memory accounting

Short-term

Mid-term

Long-term

Page 25: Andrea Camesi, Jarle Hulaas Firstname.Lastname@epfl.ch Software Engineering Laboratory Swiss Federal Institute of Technology in Lausanne (EPFL) Switzerland

0

7/0

7/2

005

25© Andrea Camesi and Jarle Hulaas

Thank you for your attention !