Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Monitoring of Perl-based webapplications usingKieker
Nis Wechselberg
Institut für InformatikChristian-Albrechts-Universität zu Kiel
2013-06-28
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 1 / 37
Outline
1 Motivation
2 Technologies and methods
3 Perl.Kieker implementation
4 Instrumentation
5 Testing
6 Results
7 Conclusion
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 2 / 37
Outline
1 MotivationSystemProblems with Kielprints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 3 / 37
Kielprints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 4 / 37
Project summary
Open access system for scientific research data and publications(self archiving)Expanded and heavily modified Version of EPrintsOperated at GEOMAR | Helmholtz Zentrum für OzeanforschungKielExpanded the original System OceanRep GEOMARAt time of writing about 15.000 documents from more than 1.000Authors
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 5 / 37
User Perspective
Searching for documents on the platform:
High Latency, slow responsesSlow processing of seraches by division
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 6 / 37
Administration/Data Entry
Extreme latency when changing pages in backendExample: Generation of drop-down menus for authors takes morethan 10 seconds
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 7 / 37
Outline
2 Technologies and methodsKieker-FrameworkThe programming language PerlPerformance monitoring
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 8 / 37
Kieker Monitoring Framework
Tool for dynamic software analysis, created at the research groupfor Software EngineeringRecommended tool at SPEC RG Software Repository
AnalysisPlugin
AnalysisController
Monitoring Reader
Monitoring Probe
Monitoring Controller
Monitoring Writer
Monitoring Log/Stream
Monitoring Record
Kieker.TraceAnalysis
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 9 / 37
Kieker Overview
Two-part structure: Kieker.Monitoring and Kieker.AnalysisKieker.Monitoring for monitoring and data generationKieker.Analysis for analysis and presentationLoosely coupled by monitoring log or stream
At time of writing no perl support
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 10 / 37
The programming language Perl
imperative, platform independent, interpretedFirst published 1987, recent version 5.16 availableSupport for objectoriented programming via CPAN availableVery free syntax, "There’s always one more way to do it"Strong support for string manipulation and regular expressionsDirect support in webservers with mod_perl
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 11 / 37
Performance monitoring step-by-step
1 Instrumentation of the code with probes2 Execution of the system under observation3 Logging of monitoring data4 Analysis of generated data
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 12 / 37
Gathered data
Application specific dataFunction calls and dependenciesFrequency of callsResponse times
System dataCPU usageRAM usageactive processes...
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 13 / 37
Outline
3 Perl.Kieker implementationArchitectureBase moduleKieker-Data-Bridge
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 14 / 37
Architectural view
<<executionEnvironment>>
JVM
<<component>>
<<library>>
kieker.jar
<<component>>
<<executable>>
DataBridge.jar
<<executionEnvironment>>
Perl Interpreter
<<component>>
<<executable>>
Perl Applikation
<<component>>
<<library>>
Kieker.pm
RecordEvent
Nachrich
ten
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 15 / 37
Perl module
+new()
+EntryEvent()
+ExitEvent()
Kieker
+time()
Kieker::Util+instance()
+getTrace()
+getOrderIndex()
Kieker::Controlling
+instance()
+write()
<<Interface>>
Kieker::Writer
+new()
+genoutput()
<<Interface>>
Kieker::Record
Kieker::JMSWriterKieker::FileWriterKieker::Record::Trace Kieker::Record::OperationEntryEvent Kieker::Record::OperationExitEvent
Support for monitoring records, monitoring writer and controllingMinimal subset of records: OperationEntryEvent,OperationExitEvent, TraceAnalysis with Kieker.Analysis
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 16 / 37
Kieker in perl
KiekerEncapsulation of the functions. InterfaceManages Kieker::Writer and Kieker::Controlling instances
Kieker::ControllingManages Trace-IDs and Order-IndicesCreates new traces when requested
Kieker::UtilCurrently only manages time samplingConverts Perl-microseconds to nanoseconds
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 17 / 37
Kieker in Perl - Writer
Kieker::Writer::FileWriterWrites generated records to file systemOnly used for early testing
Kieker::Writer::JMSWriterUses STOMP for Java Message ServiceConnection to Kieker via Kieker-Data-Bridge
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 18 / 37
Kieker in Perl - Records
Kieker::Record::TraceKieker::Record::OperationEntryEvent // OperationExitEvent
Event based records for begin and end of executionRecord data: function, package, timestamp, trace, orderIndexTrace reconstruction in Kieker.Analysis
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 19 / 37
Kieker-Data-Bridge I
Kieker Monitoring
JMX InterfacePeriodic
Sampling
Logging Monitoring Controller
Monitoring Writer
TCP Server JMS Client...
ServiceContainer
Service Connector
Kieker Data Bridge
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 20 / 37
Kieker-Data-Bridge II
By-product at MENGES-projectUniversal interface for future expansionsMultiple connectors(TCP Client, TCP Server, JMS Client, JMS Embedded)Accepts both binary data or text messages
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 21 / 37
Kieker-Data-Bridge III
Text messages are seperated by semicolonsRecords identification via mapping fileAmount and type of parameter determined by record typeExample: 1;1362747533540734000;6889;5;EPrints.current_repository;EPrints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 22 / 37
Outline
4 Instrumentation
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 23 / 37
Automatic instrumentaion
Using CPAN module Sub::WrapPackagesAOP based creation of wrappersuse Sub::WrapPackages packages => [qw(EPrints EPrints::*)], pre => sub { use Kieker; my $kieker = Kieker->new(); $\_[0] =~ s/::/./g; $\_[0] =~ /^(.*)\..*?$/; $kieker->EntryEvent($\_[0],$1); }
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 24 / 37
Outline
5 TestingSystemRequests
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 25 / 37
Comparison between Systems
Virtual machine using Ubuntu 12.04 LTSDatabase dump from GEOMAR dated 2013-02-07Comparison between EPrints 3.2 and Kielprints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 26 / 37
Components
VirtualBox
<<component>>PostgreSQL
<<component>>Apache
<<component>>
HTTPmod_perl
SQLEPrints/Kielprints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 27 / 37
5 selected requests at admin interfaceScetching Use-Case New document4 "normal" requests, 1 AJAX request
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 28 / 37
Outline
6 ResultsDependenciesTimingFunction callsMost active modules
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 29 / 37
"Call Tree" EPrints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 30 / 37
Dependency graph EPrints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 31 / 37
Condensed dependency graph
EPrints.DataSet
EPrints.Utils
EPrints.ScreenProcessor
EPrints.Config
$
EPrints.BoxEPrints.Session
EPrints.Storage
EPrints.List
/cgi/user/homeEPrints.URL
EPrints.OpenArchives
EPrints.Repository
EPrints.MetaField
EPrints.Database
EPrints.XMLEPrints.Search
EPrints.Apache.Rewrite
EPrints.Workflow
EPrints
EPrints.DataObj
EPrints.Script
EPrints.Paginate
EPrints.Plugin
EPrints.Index
EPrints.XHTML
28
20854
115
15
73
4
72
48157
316
5
44
13
608
5
17
3
16
2
4
2
2
6
158
156
3
10
8
824
12
404
12
3
186
288 4
2
6
33347
39
10
12
16533
12
181
115
176
24
30208
60416
8
87
26
261
5
8
6
1
21
1
12
1
20
67
5039
4170
54516
21
136
5
5
591
4
3
6
327
3
6
30
110
1
58
5
10
110
10
21
8
16
5
3
2
2
4
775
4
4
33
3
5
769
4
3
86
2
964
2903
22
896
677
9
2
11
30
7
10
1
10
444
1047
1
1
3
310
283
20
1
13
2
1
1
50
4
1
13432
48
226
112
24
4
361
357
132
4
4
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 32 / 37
Timings
Request 1 2 3 4 5EP norm. 402 ms 220 ms 136 ms 413 ms 348 msEP inst. 15389 ms 15043 ms 18408 ms 23430 ms 7066 msKP norm. 10270 ms 227 ms 166 ms 13420 ms 18890 msKP inst. 28505 ms 16623 ms 17414 ms 280927 ms 342662 msF1 25,5 1,0 1,2 32,5 54,3F2 1,8 1,1 0,9 11,9 48,5
Table: Timings of Eprints and Kielprints before and after instrumentation
Requests1 Admin homepage after login2 New Entry3 File upload (no file provided)4 Metadata5 AJAX: More authors
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 33 / 37
Function calls
Request 1 2 3 4 5 SumEprints 20875 28590 33171 43056 16980 142672Kielprints 31742 36681 40165 905580 934760 1948928Factor 1,5 1,3 1,2 21,0 55,1 13,7
Table: Function calls at EPrints and Kielprints
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 34 / 37
Most active modules
EPrints Aufrufe Kielprints AufrufeEPrints.Script.Compiler 30304 EPrints.MetaField 501872EPrints.Repository 25980 EPrints.DataSet 253493EPrints.MetaField 18374 EPrints.Repository 243699EPrints.XML 12486 EPrints.Database 189624EPrints.DataSet 7488 EPrints.DataObj 156391EPrints.Utils 7220 EPrints.MetaField.Id 155978EPrints.XML.EPC 5703 EPrints.Utils 118036EPrints.DataObj 5439 EPrints.XML 107939EPrints.Database 3466 EPrints.MetaField.Multilang 45312EPrints.Script.Compiled 3404 EPrints.Script.Compiler 39550
Table: The 10 most active modules
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 35 / 37
Outline
7 Conclusion
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 36 / 37
Conclusion
An monitoring system for Perl based webapplications has beencreatedComparison between EPrints and KielprintsDiscovery: High amount of database queries at KielprintsDiscovered optimization options both at EPrints and Kielprints.
Nis Wechselberg (CAU Kiel) Perl-Monitoring 2013-06-28 37 / 37