toward a generic and concurrency-aware pipes & filters framework symposium on software...

20
Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf , Nils Christian Ehmke, and Wilhelm Hasselbring ― 28.11.2014 Software Engineering Group Kiel University, Germany

Upload: angelina-mcdaniel

Post on 11-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

Symposium on Software Performance 2014

Christian Wulf, Nils Christian Ehmke, and Wilhelm Hasselbring ― 28.11.2014

Software Engineering GroupKiel University, Germany

Page 2: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Current State of Kieker

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

2

already optimized [Wa14]

Analysis component originally made for a modular offline analysisÞ Too slow for live analysis and more complex offline analysisÞ Not that modular anymore due to software erosion

Page 3: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Design Limitations of Kieker‘s Analysis Component

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

3

• Determination of target stage at runtime• Using Java’s Reflection API• Causing unnecessary and high synchronization overhead

• Check for type safety on each deliver• Using annotation-based ports

• Only readers are executed in a separate thread• Limited support for stage composition

pipes are no first-class entities [Shaw93]

Page 4: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Related P&F Frameworks

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• ExplorViz‘ trace processing component [FWBH13]– Tailored to trace processing– Not intended as generic P&F framework

• Java 8 streams [Oracle14]– No support for ports– Limited configuration options

• Akka [Akka14] – No direct support for ports– Less efficient due to its actor-based design

• e.g., due to MpSc mailbox

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.20144

Page 5: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Requirements

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• Abstraction from platform/implementation details (Abs)• Focus on efficiency and scalability (E&S)• Type safety (TS)• Compositional, reusable stages (CompS)

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.20145

Page 6: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Agenda

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• Motivation• Proposal for a P&F Software Architecture• Preliminary Performance Results• Conclusion

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.20146

Page 7: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Pipe as First-Class Entity

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• Pros:– Encapsulates stage scheduling– Encapsulates synchronization– Allows the compiler to perform further optimizations

• Cons:– Increases runtime overhead due to delegation

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.20147

typed port

stage

pipe

queue

Stage only defines its ports and logic

(Abs, TS)

Page 8: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Stage Scheduling & Synchronization

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

Thread • Unsynchronized• Direct method call• Backpressure technique

Thread BThread A• Lock-free SpSc queue1

• All IPC protocols possible(e.g., asynch send + polling)

1 Java Concurrency Tools: https://github.com/JCTools/JCTools

No additional global scheduler necessary:each thread decides for itself what to execute

8

(Abs, E&S)

Page 9: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Multi-Threaded Execution

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

9

Our sample pipeline using a hybrid thread assignment approach

• Flexible thread assignment: distinct [SQKP10], shared [SLY+11], and duplicated execution• Minimal communication overhead by using intra- and inter-thread pipes

(Abs, E&S)

Page 10: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Stage Composition

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

10

A stage composed of multiple other stages

(CompS)

Page 11: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Basic, Reusable Stages

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• Distributor/Merger• File system stages:

– Reader/writer, text file line processing

• Generic stages:– Repeater, delay, throughput, instanceOf

• Further stages:– Clock, word counter, en-/decryption, (de)compress

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.201411

(CompS)

Distributor

Throughput

trigger

Page 12: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

P&F Software Architecture

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

12

Page 13: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Preliminary Performance Evaluation

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

13

Monitoring (S1) TCP Reading (S2) Reconstruction (S3) Reduction (S4)

Mean 2.7370 16.2016 1578.8127 1566.1206

Ci95 0.0326 0.0395 38.2491 37.9230

Throughput 365360 61722 633 638

Monitoring (S1) TCP Reading (S2) Reconstruction (S3) Reduction (S4)

Mean 2.7594 17.5330 17.1577 17.3352

Ci95 0.0075 0.0095 0.0202 0.0245

Throughput 362395 57035 58282 57686

Kieker‘s analysis

component

Performance results of Kieker’s analysis component with MooBench [Wa14] as load driver

TeeTime

91x

Performance results of TeeTime with MooBench [Wa14] as load driver

Monitoring (S1) TCP Reading (S2) Reconstruction (S3) Reduction (S4)

Mean - 2.3995 9.3671 7.4789

Ci95 - 0.0062 0.0463 0.0389

Throughput - 416748 106756 133710168x

Performance results of TeeTime with a faster load driver

211x

TeeTime

Page 14: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Conclusion

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• Flexible P&F software architecture including an open source implementation• Optimized in terms of abstraction, efficiency & scalability, type safety, and

reusability• 90-200x performance increase w.r.t. Kieker‘s current analysis component

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.201414

Future work:• Further performance experiments• Automatize as much as possible:

– pipe instantiation, thread assignment, and exception handling

• Support for Kieker‘s WebGUI via save/load of pipeline structures [E13]• Migration of legacy P&F architectures [Wu14]

Open source implementation TeeTime: https://sourceforge.net/p/teetime/

Page 15: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

References

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

[vHWH12] André van Hoorn, Jan Waller, and Wilhelm Hasselbring. Kieker: A Framework for Application Performance Monitoring and Dynamic Software Analysis. In Proceedings of the 3rd joint ACM/SPEC International Conference on Performance Engineering (ICPE 2012), pages 247–248. ACM, April 2012.

[FWBH13] Florian Fittkau, Jan Waller, Peer Christoph Brauer, and Wilhelm Hasselbring. Scalable and Live Trace Processing with Kieker Utilizing Cloud Computing. In Proceedings of the Symposium on Software Performance: Joint Kieker/Palladio Days 2013, volume 1083, pages 89–98. CEUR Workshop Proceedings, November 2013.

[Akka14] Akka. URL: http://doc.akka.io

[Oracle14] Java 8 Stream API. URL: https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html

[SLY+11] D. Sanchez, D. Lo, R.M. Yoo, J. Sugerman, and C. Kozyrakis. Dynamic Fine-Grain Scheduling of Pipeline Parallelism. In Proceedings of the 20th International Conference on Parallel Architectures and Compilation Techniques (PACT), pages 22–32, October 2011.

[SQKP10] M. Aater Suleman, Moinuddin K. Qureshi, Khubaib, and Yale N. Patt. Feedback directed Pipeline Parallelism. In Proceedings of the 19th International Conference on Parallel Architectures and Compilation Techniques (PACT), PACT ’10, pages 147–156, New York, NY, USA, 2010. ACM.

[Wa14] Jan Waller. Performance Benchmarking of Application Monitoring Frameworks. PhD Thesis. Department of Computer Science, Kiel University, Germany. 2014

[E13] Ehmke, N. C. Everything in Sight: Kieker’s WebGUI in Action. In Proceedings of the Symposium on Software Performance 2013, November 27-29, 2013, Karlsruhe, Germany.

[Wu14] Wulf, C. Pattern-based Detection and Utilization of Potential Parallelism in Software Systems. In Proceedings of the Software Enginnering 2014, 26.02.2014, Kiel.

[Shaw93] Mary Shaw. Procedure Calls Are the Assembly Language of Software Interconnection: Connectors Deserve First-Class Status. In Selected papers from the Workshop on Studies of Software Design (ICSE '93), David Alex Lamb (Ed.). Springer-Verlag, London, UK, UK, 17-32. 1993.

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.201415

Page 16: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Thread Assignment Strategies

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

Two common thread assignment strategies:• Assign each worker thread on a distinct set of stages [e.g.,

SQKP10]• Assign each worker thread to all stages sharing the pipes [e.g.,

SLY+11]

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.201416

Shared pipes

Page 17: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Signal Concept

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

17

Start signal

• Automatic passing of signals by the framework• Signal encapsulates the logics• Integrated signals for starting, validating, terminating• Arbitrary signals possible

Page 18: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Example Stage

Toward a Generic and Concurrency-Aware Pipes & Filters FrameworkChristian Wulf, Nils C. Ehmke,

and Wilhelm Hasselbring ― 28.11.2014

18

Page 19: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

Performance Evaluation - Setup

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

• Kieker (11.07.2014) vs. TeeTime (01.09.2014)• Load: 2 resp. 200 million traces each with a depth of 10• Four scenarios: S1-S4• Single-threaded execution of the analysis side

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.201419

Page 20: Toward a Generic and Concurrency-Aware Pipes & Filters Framework Symposium on Software Performance 2014 Christian Wulf, Nils Christian Ehmke, and Wilhelm

More Efficient and Scalable

Toward a Generic and Concurrency-Aware Pipes & Filters Framework

Static connection of ports– No dynamic search of annotation-based ports

Single type check phase on initialitation– No dynamic type check on each delivery

Direct stage invocation– No reflection call

Flexible thread assignment– No limitation to readers

Christian Wulf, Nils C. Ehmke, and Wilhelm Hasselbring ―

28.11.201420