Experimental Evaluation of Distributed Middleware with a Virtualized - - PowerPoint PPT Presentation

experimental evaluation of distributed middleware with a
SMART_READER_LITE
LIVE PREVIEW

Experimental Evaluation of Distributed Middleware with a Virtualized - - PowerPoint PPT Presentation

Experimental Evaluation of Distributed Middleware with a Virtualized Java Environment Nuno A. Carvalho, Joo Bordalo, Filipe Campos and Jos Pereira HASLab / INESC TEC Universidade do Minho MW4SOC11 December 12, 2011 2011 Nuno Alexandre


slide-1
SLIDE 1

2011 Nuno Alexandre Carvalho

Experimental Evaluation of Distributed Middleware with a Virtualized Java Environment

MINHA

Nuno A. Carvalho, João Bordalo, Filipe Campos and José Pereira HASLab / INESC TEC Universidade do Minho

MW4SOC’11 December 12, 2011

slide-2
SLIDE 2

2011 Nuno Alexandre Carvalho MINHA

Motivation

Service oriented architectures span a wide range of application scenarios Geographically dispersed Deployed outside enterprise information systems Comprehensive evaluation requirements Correctness Performance

2

slide-3
SLIDE 3

2011 Nuno Alexandre Carvalho MINHA

Motivation

Current evaluation solutions Simulation models: useful while the whole system isn’t available, but can only validate design and not the middleware and service implementation Actual deployment: most realistic but costly and time consuming, also requires the availability of the entire system

3

slide-4
SLIDE 4

2011 Nuno Alexandre Carvalho MINHA

Overview

Traditional experimental middleware evaluation

4

Network JVM n Java Interpreter / JIT Compiler Platform libraries (java.*) Target middleware Target application JVM 2 Java Interpreter / JIT Compiler Platform libraries (java.*) Target middleware Target application JVM 1 Java Interpreter / JIT Compiler Platform libraries (java.*) Target middleware Target application

...

slide-5
SLIDE 5

2011 Nuno Alexandre Carvalho MINHA

Overview

Traditional experimental middleware evaluation

5

Network JVM n Java Interpreter / JIT Compiler Platform libraries (java.*) Target middleware Target application JVM 2 Java Interpreter / JIT Compiler Platform libraries (java.*) Target middleware Target application JVM 1 Java Interpreter / JIT Compiler Platform libraries (java.*) Target middleware Target application

...

Multiple instances of an application are deployed in multiple JVMs JVMs are scattered across multiple physical hosts The amount of the required hardware resources is ofen prohibitive

slide-6
SLIDE 6

2011 Nuno Alexandre Carvalho MINHA

Overview

MINHA middleware evaluation

6

JVM Bytecode instrumentation Java Interpreter / JIT Compiler Platform libraries (java.*) MINHA Virtual JVM n Target middleware Target application Virtual JVM 1 Target middleware Target application Virtual JVM 1 Target middleware Target application

...

slide-7
SLIDE 7

2011 Nuno Alexandre Carvalho MINHA

Overview

MINHA middleware evaluation

7

Reproduces the same distributed run within a single JVM Application and middleware classes for each vJVM are automatically transformed Some simulation models are developed from scratch,

  • thers are produced by

translating native libraries

JVM Bytecode instrumentation Java Interpreter / JIT Compiler Platform libraries (java.*) MINHA Virtual JVM n Target middleware Target application Virtual JVM 1 Target middleware Target application Virtual JVM 1 Target middleware Target application

...

slide-8
SLIDE 8

2011 Nuno Alexandre Carvalho MINHA

Overview

MINHA middleware evaluation advantages

8

Global observation without interference Simulated components Large scale scenarios Automated “What-If” analysis

JVM Bytecode instrumentation Java Interpreter / JIT Compiler Platform libraries (java.*) MINHA Virtual JVM n Target middleware Target application Virtual JVM 1 Target middleware Target application Virtual JVM 1 Target middleware Target application

...

slide-9
SLIDE 9

2011 Nuno Alexandre Carvalho MINHA

Agenda

9

Simulation Kernel Virtualized JVM Input/Output Models Calibration Case Study

slide-10
SLIDE 10

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

Event-based simulation kernel Abstract resource management primitives

10

JVM Java Interpreter / JIT Compiler Platform libraries (java.*) Virtual JVM n Target middleware Target application Virtual JVM 1 Target middleware Target application Virtual JVM 1 Target middleware Target application

...

Simulated events and resources

slide-11
SLIDE 11

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

Combination of real and simulated code: Measuring the time of execution and management of a simulated processor Allowing sequential Java code to execute by eliminating the inversion of control resultant from the event simulation

11

JVM Java Interpreter / JIT Compiler Platform libraries (java.*) Virtual JVM n Target middleware Target application Virtual JVM 1 Target middleware Target application Virtual JVM 1 Target middleware Target application

...

Simulated events and resources Time virtualization

slide-12
SLIDE 12

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

slide-13
SLIDE 13

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

class load

JVM

start

slide-14
SLIDE 14

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

For simplicity, let’s assume that this segment is a thread

class load

JVM

start

slide-15
SLIDE 15

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

start()

Thread

For simplicity, let’s assume that this segment is a thread

class load

JVM

start

slide-16
SLIDE 16

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

start()

Thread

For simplicity, let’s assume that this segment is a thread

class load

JVM

start event.run()

slide-17
SLIDE 17

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

start()

Thread

For simplicity, let’s assume that this segment is a thread

class load

JVM

start event.run() st.pause()

Simulation Thread

startTime() st.wakeup() stopTime() st.pause()

slide-18
SLIDE 18

2011 Nuno Alexandre Carvalho MINHA

Simulation Kernel

12

public class Foo { public static void main(...){ int i = 0; while (i<100) i++; } }

start()

Thread

For simplicity, let’s assume that this segment is a thread

class load

JVM

start event.run() simulation time delta real time delta st.pause()

Simulation Thread

startTime() st.wakeup() stopTime() st.pause()

slide-19
SLIDE 19

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Reflect real time of execution of a sequence of code in the occupation of a simulated processor Blocking operations (thread synchronization and I/O) must be intercepted and translated into corresponding simulation primitives Code executing in different virtual instances cannot interfere directly through shared variables

13

slide-20
SLIDE 20

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Bytecode manipulation: custom class loader that uses ASM Java bytecode manipulation and analysis framework to rewrite classes Isolation: each virtual JVM has its own separate instance of the class loader acting like a sandbox Interaction: A subset of classes, containing the simulation kernel and models, are kept global providing a controlled channel for virtual JVMs to interact

14

JVM Bytecode Translat Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Platform libraries (java. Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Simulated events and Time virtualization

slide-21
SLIDE 21

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Bytecode manipulation: custom class loader that uses ASM Java bytecode manipulation and analysis framework to rewrite classes Isolation: each virtual JVM has its own separate instance of the class loader acting like a sandbox Interaction: A subset of classes, containing the simulation kernel and models, are kept global providing a controlled channel for virtual JVMs to interact

14

JVM Bytecode Translat Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Platform libraries (java. Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Simulated events and Time virtualization

slide-22
SLIDE 22

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Bytecode manipulation: custom class loader that uses ASM Java bytecode manipulation and analysis framework to rewrite classes Isolation: each virtual JVM has its own separate instance of the class loader acting like a sandbox Interaction: A subset of classes, containing the simulation kernel and models, are kept global providing a controlled channel for virtual JVMs to interact

15

JVM Bytecode Translat Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Platform libraries (java. Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Simulated events and Time virtualization

slide-23
SLIDE 23

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Bytecode manipulation: custom class loader that uses ASM Java bytecode manipulation and analysis framework to rewrite classes Isolation: each virtual JVM has its own separate instance of the class loader acting like a sandbox Interaction: A subset of classes, containing the simulation kernel and models, are kept global providing a controlled channel for virtual JVMs to interact

15

JVM Bytecode Translat Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Platform libraries (java. Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Simulated events and Time virtualization

slide-24
SLIDE 24

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Bytecode manipulation: custom class loader that uses ASM Java bytecode manipulation and analysis framework to rewrite classes Isolation: each virtual JVM has its own separate instance of the class loader acting like a sandbox Interaction: A subset of classes, containing the simulation kernel and models, are kept global providing a controlled channel for virtual JVMs to interact

16

JVM Virtual JVM n Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Compiler Platform libraries (java.*) Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Simulated events and resources Time virtualization Simulation models (network,...)

slide-25
SLIDE 25

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Platform libraries Java prohibits the transformation

  • f classes under java.* package

Rewrite classes that contains native methods Overwrite special static methods, like System.nanoTime() The remaining classes are analyzed and processed automatically

17

JVM Bytecode Translat Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Platform libraries (java. Stubbed Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Stubbed platform libraries (fake.java.*) Translated platform libraries (moved.java.*) Simulated events and Time virtualization

slide-26
SLIDE 26

2011 Nuno Alexandre Carvalho MINHA

Virtualized JVM

Synchronization Primitives in java.util.concurrent.* Rewrite to fake.* Java monitor operations and implicit mutex/condition variables Inject a special fake.java.lang.Object ancestor on all translated classes and rewrite monitor operations to invocations to methods on this class static synchronized methods are solved in a similar way with a singleton object

18

JVM Bytecode Translat Virtual JVM 2 Bytecode instrumentation Translated platform libraries (moved.java.*) Target middleware Target application Java Interpreter / JIT Platform libraries (java. Stubbed Virtual JVM 1 Target middleware Target application

...

Bytecode instrumentation Stubbed platform libraries (fake.java.*) Translated platform libraries (moved.java.*) Simulated events and Time virtualization

slide-27
SLIDE 27

2011 Nuno Alexandre Carvalho MINHA

Input/Output Models

Filesystem Reads and writes are intercepted in order to avoid direct invocation of native methods, thus providing separate filesystems to different virtual JVMs Network Modeled as a resource shared by all communication channels with a finite capacity Access control is performed by the leaky bucket algorithm TCP and UDP sockets, including Multicast, supported through the java.net API

19

slide-28
SLIDE 28

2011 Nuno Alexandre Carvalho MINHA

Calibration

Network Bandwidth Sending and receiving overheads Latency Performed by running two benchmarks: Flood Round-trip

20

slide-29
SLIDE 29

2011 Nuno Alexandre Carvalho MINHA

Calibration

21

200 400 600 800 1000 1200 1000 2000 3000 4000 5000 BW (Mbit/s) Size (bytes) Real Minha 200 400 600 800 1000 1200 1000 2000 3000 4000 5000 BW (Mbit/s) Size (bytes) Real Minha

a) Writing b) Reading

Bandwidth with realistic behavior

slide-30
SLIDE 30

2011 Nuno Alexandre Carvalho MINHA

Calibration

22

c) Latency

0.1 0.2 0.3 0.4 0.5 0.6 0.7 1000 2000 3000 4000 5000 Round Trip (ms) Size (bytes) Real Minha

Latency with realistic behavior

slide-31
SLIDE 31

2011 Nuno Alexandre Carvalho MINHA

Case Study Devices Profile for Web Services (DPWS) Standard that defines a set of protocols for devices to achieve seamless networking and interoperability through Web Services Proposed as the base for large scale smart grids and safety critical medical devices Used on recent operating systems, home automation, assembly lines and car industry Web Services for Devices (WS4D-JMEDS) Framework that implements DPWS standard Supports J2SE and J2ME

23

slide-32
SLIDE 32

2011 Nuno Alexandre Carvalho MINHA

Case Study

Membership notification Manager finds peers through multicast Manager sends producers addresses to peers Peers register themselves on producers Producers initiate notification rounds Number of peers go from 10 to 300

24

Producer Manager C C C C C C C ... Rounds of events

slide-33
SLIDE 33

2011 Nuno Alexandre Carvalho MINHA

Case Study

In a normal WS4D deploy we would have Each peer on a different device Each device with only one CPU core

25

slide-34
SLIDE 34

2011 Nuno Alexandre Carvalho MINHA

Case Study

In a normal WS4D deploy we would have Each peer on a different device Each device with only one CPU core Due to hardware restrictions we deployed 300 devices on multiple JVMs on a single host with 24 CPU cores Localhost network with minimal latency Producer can send up to 24 notifications in parallel (biasing the results)

25

slide-35
SLIDE 35

2011 Nuno Alexandre Carvalho MINHA

Case Study

26

250 500 750 1000 1250 1500 1750 2000 50 100 150 200 250 300 Duration (s) Devices Multiple JVMs Minha (sim) Minha (real) 50 100 150 200 250 300 50 100 150 200 250 300 Latency (ms) Devices Multiple JVMs Minha

a) Latency b) Duration

MINHA eliminates false latency when all peers run on a single host MINHA is faster than real deployments on I/O bound scenarios (up to 50 times)

slide-36
SLIDE 36

2011 Nuno Alexandre Carvalho MINHA

Conclusion

27

Allows off-the-shelf code (bytecode) to run unchanged including threading, concurrency control and networking Manages a simulated timeline which is updated using accurate measurements of time spent executing real code fragments Provides simulation models of networking primitives and an automatic calibrator Allows off-the-shelf middleware stack evaluation deployed on a large scale system with hundred of devices

slide-37
SLIDE 37

2011 Nuno Alexandre Carvalho MINHA

Conclusion

28

http://gitorious.org/minha