Performance Monitoring for the Cloud - Java2Days 2017

Werner Keil
Werner KeilCloud Architect, Java, Eclipse and Microservice Expert at Deutsche Bank
Copyright © 2016, Creative Arts & Technologies and others. All rights reserved.
Performance Monitoring
for the Cloud
Werner Keil
JSR 363 Maintenance Lead
@wernerkeil
October 18, 2017
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Agenda
1. Introduction
2. Performance Co-Pilot
3. Dropwizard Metrics
4. MicroProfile Metrics
5. Prometheus
6. StatsD
7. Demo
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Who am I?
Werner Keil
• Consultant – Coach
• Creative Cosmopolitan
• Open Source Evangelist
• Software Architect
• Spec Lead – JSR363
• Individual JCP Executive Committee Member
[www.linkedin.com/in/catmedia]
Twitter @wernerkeil
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
What is Monitoring?
Monitoring applications is observing, analyzing and
manipulating the execution of these applications, which gives
information about threads, CPU usage, memory usage, as well
as other information like methods and classes being used.
A particular case is the monitoring of distributed
applications, aka the Cloud where an the performance
analysis of nodes and communication between them pose
additional challenges.
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
A high-level view of Cloud
Monitoring
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Challenges at System Level
• Efficient Scalability
– Supporting tens of thousands of monitoring tasks
– Cost effective: minimize resource usage
• Monitoring QoS
– Multi-tenancy environment
– Minimize resource contention between monitoring tasks
• Implication of Multi-Tenancy
– Monitoring tasks: adding, removing
– Resource contention between monitoring tasks
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Performance vs Number of Hosts
Number of hosts Performance (values per second)
100 100
1000 1000
10000 10000
60 items per host, update frequency once per minute
Number of hosts Performance (values per second)
100 1000
1000 10000
10000 100000
600 items per host, update frequency once per minute
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Monitoring Tips
• Regularly apply “Little’s Law” to all data... generic
(queueing theory) form:
Q = λ R
• Length = Arrival Rate x Response Time
– e.g. 10 MB = 2 MB/sec x 5 sec
• Utilization = Arrival Rate x Service Time
– e.g. 20% = 0.2 = 100 msec/sec x 2 sec
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Types of Monitoring
Monitoring Logs
• Logstash
• Redis
• Elasticsearch
• Kibana Dashboard
Monitoring Performance
• Collectd
• Statsd
• PCP
• Graphite
• Database (eg: PSQL)
• Grafana Dashboard
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Monitoring Logs – Kibana
Dashboard
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Monitoring Performance
How is this traditionally done?
• rsyslog/syslog-ng/journald
• top/iostat/vmstat/ps
• Mixture of scripting languages (bash/perl/python)
• Specific tools vary per platform
• Proper analysis requires more context
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Performance Co-Pilot
PCP
http://www.pcp.io
GitHub
https://github.com/performancecopilot
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
What is PCP?
• Open source toolkit
• System-level analysis
• Live and historical
• Extensible (monitors, collectors)
• Distributed
• Unix-like component design
• Cross platform
• Ubiquitous units of measurement
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Basics
Agents and Daemons
At the core we have two basic
components:
1. Performance Metric
Domain Agents
• Agents
2. Performance Metric
Collection Daemon
• PMCD
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Architecture
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Metrics
• pminfo --desc -tT --fetch disk.dev.read
disk.dev.read [per-disk read operations]
Data Type: 32-bit unsigned int InDom: 60.1
Semantics: counter Units: count
Help: Cumulative count of disk reads since
boot time
Values:
inst [0 or "sda"] value 3382299
inst [1 or "sdb"] value 178421
16
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Agents
Webserver
(apache/nginx)
DBMS
Network
Kernel
PMCD
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Clients
Agents
PMCD
pmie
pmstat
pmval
pminfo
pmchart
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Remote Clients
Agents
PMCD
Clients
Remote
PMCD
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Data Model
• Metrics come from one source (host / archive)
• Source can be queried at any interval by any monitor tool
• Hierarchical metric names
e.g. disk.dev.read and aconex.response_time.avg
• Metrics are singular or set-valued (“instance domain”)
• Metadata associated with every metric
• Data type (int32, uint64, double, ...)
• Data semantics (units, scale, ...)
• Instance domain
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Performance Timeline
• Where does the time go?
• Where’s it going now?
• Where will it go?
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Performance Timeline – Toolkit
• Archives
• Live Monitoring
• Modelling and statistical
prediction
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Performance Timeline – PCP
Toolkit
• Yesterday, last week, last month, ...
• All starts with pmlogger
• Arbitrary metrics, intervals
• One instance produces one PCP archive for one host
• An archive consists of 3 files
• Metadata, temporal index, data volume(s)
• pmlogger_daily, pmlogger_check
• Ensure the data keeps flowing
• pmlogsummary, pmwtf, pmdumptext
• pmlogextract, pmlogreduce
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Custom Instrumentation
(Applications)
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP – Parfait
Parfait has 4 main parts (for now)
• Monitoring
• DXM
• Timing
• Requests
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Parfait – Monitoring
• This is the ‘original’ PCP bridge metrics (heavily modified)
• Simple Java objects (MonitoredValues) which wrap a value (e.g.
AtomicLong, String)
• MonitoredValues register themselves with a registry (container)
• When values changes, observers notice and output accordingly
• PCP
• JMX
• Other (Custom/Extended)
• Very simple to use
• ‘Default registry’ (legacy concept)
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Parfait – Timing
• Logs the resources consumed by a request (an individual user action)
• Relies on a single request being thread-bound (and threads being used
exclusively)
• Basically needs a Map<Thread, Value>
• Take the value for a Thread at the start, and at the end
• Delta is the ‘cost’ of that request
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Parfait – Timing Example
[2010-09-22 15:02:13,466 INFO ][ait.timing.Log4jSink][http-8080-Processor3
gedq93kl][192.168.7.132][20][] Top taskssummaryfeatures:tasks
taskssummaryfeatures:tasks Elapsed time: own 380.146316 ms, total
380.14688 ms Total CPU: own 150.0 ms, total 150.0 ms User CPU: own 140.0 ms,
total 140.0 ms System CPU: own 10.0 ms, total 10.0 ms Blocked count: own 40,
total 40 Blocked time: own 22 ms, total 22 ms Wait count: own 2, total 2
Wait time: own 8 ms, total 8 ms Database execution time: own 57 ms, total 57
ms Database execution count: own 11, total 11Database logical read count: own
0, total 0 Database physical read count: own 0, total 0 Database CPU time:
own 0 ms, total 0 ms Database received bytes: own 26188 By, total 26188 By
Database sent bytes: own 24868 By, total 24868 By Error Pages: own 0, total
0 Bobo execution time: own 40.742124 ms, total 40.742124 ms Bobo execution
count: own 2, total 2 Bytes transferred via bobo search: own 0 By, total 0 By
Super search entity count: own 0, total 0 Super search count: own 0, total 0
Bytes transferred via super search: own 0 By, total 0 By Elapsed time
during super search: own 0 ms, total 0 ms
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Parfait – Requests
• As well as snapshotting requests after completion, for many metrics we
can see meaningful ‘in-progress’ values
• Simple JMX bean which ‘walks’ in-progress requests
• Tie in with ThreadContext (MDC abstraction)
• Include UserID
• ThreadID
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP – Speed
Golang implementation of the PCP
instrumentation API
There are 3 main components
in the library
• Client
• Registry
• Metric
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP – Speed Metric
• SingletonMetric
• This type defines a metric with no instance domain and only one
value. It requires type, semantics and unit for construction, and
optionally takes a couple of description strings.
A simple construction
metric, err := speed.NewPCPSingletonMetric(
42, // initial value
"simple.counter", // name
speed.Int32Type, // type
speed.CounterSemantics, // semantics
speed.OneUnit, // unit
"A Simple Metric", // short description
"This is a simple counter metric to demonstrate the speed API", // long desc
)
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP for
Containers
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP for Containers – Cgroup
Accounting
• [subsys].stat files below /sys/fs/cgroup
• individual cgroup or summed over children
• blkio
• IOPs/bytes, service/wait time – aggregate/per-dev
• Split up by read/write, sync/async
• cpuacct
• Processor use per-cgroup - aggregate/per-CPU
• memory
• mapped anon pages, page cache, writeback, swap, active/inactive LRU
state
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP for Containers –
Namespaces
• Example: cat /proc/net/dev
• Contents differ inside vs outside a container
• Processes (e.g. cat) in containers run in different network, ipc, process,
uts, mount namespaces
• Namespaces are inherited across fork/clone
• Processes within a container share common view
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Container Analysis – Goals
• Allow targeting of individual containers
• e.g. /proc/net/dev
• pminfo --fetch network
• vs
• pminfo –fetch –container=crank network
• Zero installation inside containers required
• Simplify your life (dev_t auto-mapping)
• Data reduction (proc.*, cgroup.*)
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
PCP Container Analysis –
Mechanisms
• pminfo -f –host=acme.com –container=crank network
• Wire protocol extension
• Inform interested PCP collector agents
• Resolving container names, mapping names to cgroups, PIDs, etc.
• setns(2)
• Runs on the board, plenty of work remains
• New monitor tools with container awareness
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
What is Metrics?
• Code instrumentation
• Meters
• Gauges
• Counters
• Histograms
• Web app instrumentation
• Web app health check
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics Reporters
• Reporters
• Console
• CSV
• Slf4j
• JMX
• Advanced reporters
• Graphite
• Ganglia
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics 3rd Party Libraries
• AspectJ
• InfluxDB
• StatsD
• Cassandra
• Spring
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics Basics
• MetricsRegistry
• A collection of all the metrics for your application
• Usually one instance per JVM
• Use more in multi WAR deployment
• Names
• Each metric has a unique name
• Registry has helper methods for creating names
MetricRegistry.name(Queue.class, "items", "total")
//com.example.queue.items.total
MetricRegistry.name(Queue.class, "size", "byte")
//com.example.queue.size.byte
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics Elements
• Gauges
• The simplest metric type: it just returns a value
final Map<String, String> keys = new HashMap<>();
registry.register(MetricRegistry.name("gauge", "keys"), new
Gauge<Integer>() {
@Override
public Integer getValue() {
return keys.keySet().size();
}
});
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics Elements (2)
• Counters
• Incrementing and decrementing 64.bit integer
final Counter counter= registry.counter(MetricRegistry.name("counter",
"inserted"));
counter.inc();
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics Elements (3)
• Histograms
• Measures the distribution of values in a stream of data
final Histogram resultCounts = registry.histogram(name(ProductDAO.class,
"result-counts");
resultCounts.update(results.size());
• Meters
• Measures the rate at which a set of events occur
final Meter meter = registry.meter(MetricRegistry.name("meter", "inserted"));
meter.mark();
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics Elements (4)
• Timers
• A histogram of the duration of a type of event and a meter of the rate
of its occurrence
Timer timer = registry.timer(MetricRegistry.name("timer", "inserted"));
Context context = timer.time();
//timed ops
context.stop();
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics – Graphite Reporter
final Graphite graphite = new Graphite(new
InetSocketAddress("graphite.example.com", 2003));
final GraphiteReporter reporter = GraphiteReporter.forRegistry(registry)
.prefixedWith("web1.example.com")
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.filter(MetricFilter.ALL)
.build(graphite);
reporter.start(1, TimeUnit.MINUTES);
Metrics can be prefixed
Useful to divide environment metrics: prod, test
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Metrics – Grafana Application
Overview
What is Eclipse MicroProfile?
● Eclipse MicroProfile is an open-source community
specification for Enterprise Java microservices
● A community of individuals, organizations, and vendors
collaborating within an open source (Eclipse) project to
bring microservices to the Enterprise Java community
47
Specifications 1.2
48
MicroProfile 1.2
= New
= No change from last release
JAX-RS 2.0JSON-P 1.0CDI 1.2
Config 1.1
Fault
Tolerance
1.0
JWT
Propagation
1.0
Health
Check 1.0
Metrics 1.0
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Prometheus
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
What is Prometheus?
Prometheus is an open-source systems monitoring
and alerting toolkit originally
built at SoundCloud. It is now a standalone open
source project and maintained
independently of any company.
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Prometheus Components
• The main Prometheus server which scrapes and stores time series data
• Client libraries for instrumenting application code
• A push gateway for supporting short-lived jobs
• Special-purpose exporters (for HAProxy, StatsD, Graphite, etc.)
• An alertmanager
• Various support tools
• WhiteBox Monitoring instead of probing (aka BlackBox Monitoring)
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
What is StatsD?
A network daemon that runs on the Node.js platform
and listens for statistics, like counters and timers, sent
over UDP or TCP and sends aggregates to one or more
pluggable backend services (e.g., Graphite).
StatsD was inspired (heavily) by the project (of the
same name) at Flickr.
@YourTwitterHandle#DVXFR14{session hashtag} © 2016 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Images: Nu Image / Millennium Films
© 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
Links
Performance Co-Pilot
http://www.pcp.io
Dropwizard Metrics
http://metrics.dropwizard.io
Eclipse MicroProfile
http://microprofile.io
Prometheus
http://prometheus.io
StatsD
https://github.com/etsy/statsd/wiki
@YourTwitterHandle#DVXFR14{session hashtag} © 2016 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance
1 of 55

Recommended

MongoDB for Time Series Data: Schema Design by
MongoDB for Time Series Data: Schema DesignMongoDB for Time Series Data: Schema Design
MongoDB for Time Series Data: Schema DesignMongoDB
18.4K views43 slides
MongoDB for Time Series Data Part 1: Setting the Stage for Sensor Management by
MongoDB for Time Series Data Part 1: Setting the Stage for Sensor ManagementMongoDB for Time Series Data Part 1: Setting the Stage for Sensor Management
MongoDB for Time Series Data Part 1: Setting the Stage for Sensor ManagementMongoDB
35.7K views44 slides
Store stream data on Data Lake by
Store stream data on Data LakeStore stream data on Data Lake
Store stream data on Data LakeMarcos Rebelo
235 views39 slides
Building a data driven search application with LucidWorks SiLK by
Building a data driven search application with LucidWorks SiLKBuilding a data driven search application with LucidWorks SiLK
Building a data driven search application with LucidWorks SiLKLucidworks (Archived)
2.8K views18 slides
NetflixOSS Meetup season 3 episode 1 by
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1Ruslan Meshenberg
21.4K views90 slides
Planet-scale Data Ingestion Pipeline: Bigdam by
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamSATOSHI TAGOMORI
6.3K views46 slides

More Related Content

What's hot

Lambda Architecture Using SQL by
Lambda Architecture Using SQLLambda Architecture Using SQL
Lambda Architecture Using SQLSATOSHI TAGOMORI
8.1K views32 slides
MongoDB and the Internet of Things by
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB
3K views40 slides
MongoDB World 2018: Building a New Transactional Model by
MongoDB World 2018: Building a New Transactional ModelMongoDB World 2018: Building a New Transactional Model
MongoDB World 2018: Building a New Transactional ModelMongoDB
409 views79 slides
Perfect Norikra 2nd Season by
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd SeasonSATOSHI TAGOMORI
6.2K views37 slides
RedisConf18 - Implementing a New Data Structure for Redis by
RedisConf18 - Implementing a New Data Structure for Redis  RedisConf18 - Implementing a New Data Structure for Redis
RedisConf18 - Implementing a New Data Structure for Redis Redis Labs
305 views42 slides
History of Event Collector in Treasure Data by
History of Event Collector in Treasure DataHistory of Event Collector in Treasure Data
History of Event Collector in Treasure DataMitsunori Komatsu
2.6K views53 slides

What's hot(20)

MongoDB and the Internet of Things by MongoDB
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
MongoDB3K views
MongoDB World 2018: Building a New Transactional Model by MongoDB
MongoDB World 2018: Building a New Transactional ModelMongoDB World 2018: Building a New Transactional Model
MongoDB World 2018: Building a New Transactional Model
MongoDB409 views
RedisConf18 - Implementing a New Data Structure for Redis by Redis Labs
RedisConf18 - Implementing a New Data Structure for Redis  RedisConf18 - Implementing a New Data Structure for Redis
RedisConf18 - Implementing a New Data Structure for Redis
Redis Labs305 views
History of Event Collector in Treasure Data by Mitsunori Komatsu
History of Event Collector in Treasure DataHistory of Event Collector in Treasure Data
History of Event Collector in Treasure Data
Mitsunori Komatsu2.6K views
Sizing Your MongoDB Cluster by MongoDB
Sizing Your MongoDB ClusterSizing Your MongoDB Cluster
Sizing Your MongoDB Cluster
MongoDB2.6K views
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using... by Caserta
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
Caserta 1.6K views
It's a Dangerous World by MongoDB
It's a Dangerous World It's a Dangerous World
It's a Dangerous World
MongoDB767 views
MongoDB as a Data Warehouse: Time Series and Device History Data (Medtronic) by MongoDB
MongoDB as a Data Warehouse: Time Series and Device History Data (Medtronic)MongoDB as a Data Warehouse: Time Series and Device History Data (Medtronic)
MongoDB as a Data Warehouse: Time Series and Device History Data (Medtronic)
MongoDB8.5K views
Improved Applications with IPv6: an overview by Cisco DevNet
Improved Applications with IPv6: an overviewImproved Applications with IPv6: an overview
Improved Applications with IPv6: an overview
Cisco DevNet361 views
Open source monitoring systems by Forthscale
Open source monitoring systemsOpen source monitoring systems
Open source monitoring systems
Forthscale7.1K views
RedisConf18 - Writing modular & encapsulated Redis code by Redis Labs
RedisConf18 - Writing modular & encapsulated Redis codeRedisConf18 - Writing modular & encapsulated Redis code
RedisConf18 - Writing modular & encapsulated Redis code
Redis Labs266 views
Technologies, Data Analytics Service and Enterprise Business by SATOSHI TAGOMORI
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
SATOSHI TAGOMORI5K views
Meetup070416 Presentations by Ana Rebelo
Meetup070416 PresentationsMeetup070416 Presentations
Meetup070416 Presentations
Ana Rebelo528 views
Iot Toolkit and the Smart Object API - Architecture for Interoperability by Michael Koster
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Michael Koster6.4K views
MongoDB for Time Series Data: Setting the Stage for Sensor Management by MongoDB
MongoDB for Time Series Data: Setting the Stage for Sensor ManagementMongoDB for Time Series Data: Setting the Stage for Sensor Management
MongoDB for Time Series Data: Setting the Stage for Sensor Management
MongoDB5.4K views

Similar to Performance Monitoring for the Cloud - Java2Days 2017

Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog by
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDogRedis Labs
2K views76 slides
How to create custom dashboards in Elastic Search / Kibana with Performance V... by
How to create custom dashboards in Elastic Search / Kibana with Performance V...How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...PerformanceVision (previously SecurActive)
1.1K views18 slides
Cloud Security Monitoring and Spark Analytics by
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analyticsamesar0
1K views32 slides
Rakuten’s Journey with Splunk - Evolution of Splunk as a Service by
Rakuten’s Journey with Splunk - Evolution of Splunk as a ServiceRakuten’s Journey with Splunk - Evolution of Splunk as a Service
Rakuten’s Journey with Splunk - Evolution of Splunk as a ServiceRakuten Group, Inc.
1.9K views43 slides
The Art of Container Monitoring by
The Art of Container MonitoringThe Art of Container Monitoring
The Art of Container MonitoringDerek Chen
140 views52 slides
Add observability to your django application - PyCon FR 2019 by
Add observability to your django application - PyCon FR 2019Add observability to your django application - PyCon FR 2019
Add observability to your django application - PyCon FR 2019Bleemeo
563 views15 slides

Similar to Performance Monitoring for the Cloud - Java2Days 2017(20)

Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog by Redis Labs
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Redis Labs2K views
Cloud Security Monitoring and Spark Analytics by amesar0
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analytics
amesar01K views
Rakuten’s Journey with Splunk - Evolution of Splunk as a Service by Rakuten Group, Inc.
Rakuten’s Journey with Splunk - Evolution of Splunk as a ServiceRakuten’s Journey with Splunk - Evolution of Splunk as a Service
Rakuten’s Journey with Splunk - Evolution of Splunk as a Service
Rakuten Group, Inc.1.9K views
The Art of Container Monitoring by Derek Chen
The Art of Container MonitoringThe Art of Container Monitoring
The Art of Container Monitoring
Derek Chen140 views
Add observability to your django application - PyCon FR 2019 by Bleemeo
Add observability to your django application - PyCon FR 2019Add observability to your django application - PyCon FR 2019
Add observability to your django application - PyCon FR 2019
Bleemeo563 views
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ... by Landon Robinson
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
Landon Robinson140 views
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud by Rick Bilodeau
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Rick Bilodeau500 views
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud by Streamsets Inc.
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Streamsets Inc.3K views
Capacity Planning by MongoDB
Capacity PlanningCapacity Planning
Capacity Planning
MongoDB4.4K views
Conceptos básicos. Seminario web 6: Despliegue de producción by MongoDB
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
MongoDB1.6K views
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello by ITCamp
Azure tales: a real world CQRS and ES Deep Dive - Andrea SaltarelloAzure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
ITCamp1K views
Cytoscape: Now and Future by Keiichiro Ono
Cytoscape: Now and FutureCytoscape: Now and Future
Cytoscape: Now and Future
Keiichiro Ono2.4K views
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either! by Teamstudio
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
Teamstudio2.9K views
Apache Spark Listeners: A Crash Course in Fast, Easy Monitoring by Databricks
Apache Spark Listeners: A Crash Course in Fast, Easy MonitoringApache Spark Listeners: A Crash Course in Fast, Easy Monitoring
Apache Spark Listeners: A Crash Course in Fast, Easy Monitoring
Databricks3.5K views
Monitorama 2015 Netflix Instance Analysis by Brendan Gregg
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance Analysis
Brendan Gregg34.8K views
2020 07-30 elastic agent + ingest management by Daliya Spasova
2020 07-30 elastic agent + ingest management2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest management
Daliya Spasova247 views
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg... by Imperva Incapsula
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
Imperva Incapsula1.9K views

More from Werner Keil

Securing eHealth, eGovernment and eBanking with Java - DWX '21 by
Securing eHealth, eGovernment and eBanking with Java - DWX '21Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21Werner Keil
136 views40 slides
OpenDDR and Jakarta MVC - JavaLand 2021 by
OpenDDR and Jakarta MVC - JavaLand 2021OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021Werner Keil
108 views42 slides
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021 by
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021Werner Keil
184 views35 slides
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual by
OpenDDR and Jakarta MVC - Java2Days 2020 VirtualOpenDDR and Jakarta MVC - Java2Days 2020 Virtual
OpenDDR and Jakarta MVC - Java2Days 2020 VirtualWerner Keil
177 views39 slides
NoSQL Endgame - Java2Days 2020 Virtual by
NoSQL Endgame - Java2Days 2020 VirtualNoSQL Endgame - Java2Days 2020 Virtual
NoSQL Endgame - Java2Days 2020 VirtualWerner Keil
65 views57 slides
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR by
JCON 2020: Mobile Java Web Applications with MVC and OpenDDRJCON 2020: Mobile Java Web Applications with MVC and OpenDDR
JCON 2020: Mobile Java Web Applications with MVC and OpenDDRWerner Keil
218 views38 slides

More from Werner Keil(20)

Securing eHealth, eGovernment and eBanking with Java - DWX '21 by Werner Keil
Securing eHealth, eGovernment and eBanking with Java - DWX '21Securing eHealth, eGovernment and eBanking with Java - DWX '21
Securing eHealth, eGovernment and eBanking with Java - DWX '21
Werner Keil136 views
OpenDDR and Jakarta MVC - JavaLand 2021 by Werner Keil
OpenDDR and Jakarta MVC - JavaLand 2021OpenDDR and Jakarta MVC - JavaLand 2021
OpenDDR and Jakarta MVC - JavaLand 2021
Werner Keil108 views
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021 by Werner Keil
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
Werner Keil184 views
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual by Werner Keil
OpenDDR and Jakarta MVC - Java2Days 2020 VirtualOpenDDR and Jakarta MVC - Java2Days 2020 Virtual
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
Werner Keil177 views
NoSQL Endgame - Java2Days 2020 Virtual by Werner Keil
NoSQL Endgame - Java2Days 2020 VirtualNoSQL Endgame - Java2Days 2020 Virtual
NoSQL Endgame - Java2Days 2020 Virtual
Werner Keil65 views
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR by Werner Keil
JCON 2020: Mobile Java Web Applications with MVC and OpenDDRJCON 2020: Mobile Java Web Applications with MVC and OpenDDR
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
Werner Keil218 views
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020 by Werner Keil
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
Werner Keil1K views
Money, Money, Money, can be funny with JSR 354 (Devoxx BE) by Werner Keil
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Werner Keil171 views
Money, Money, Money, can be funny with JSR 354 (DWX 2019) by Werner Keil
Money, Money, Money, can be funny with JSR 354 (DWX 2019)Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Werner Keil503 views
NoSQL: The first New Jakarta EE Specification (DWX 2019) by Werner Keil
NoSQL: The first New Jakarta EE Specification (DWX 2019)NoSQL: The first New Jakarta EE Specification (DWX 2019)
NoSQL: The first New Jakarta EE Specification (DWX 2019)
Werner Keil150 views
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day by Werner Keil
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR DayHow JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
Werner Keil1.1K views
JNoSQL: The Definitive Solution for Java and NoSQL Databases by Werner Keil
JNoSQL: The Definitive Solution for Java and NoSQL DatabasesJNoSQL: The Definitive Solution for Java and NoSQL Databases
JNoSQL: The Definitive Solution for Java and NoSQL Databases
Werner Keil188 views
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases by Werner Keil
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabasesEclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Werner Keil142 views
Physikal - Using Kotlin for Clean Energy - KUG Munich by Werner Keil
Physikal - Using Kotlin for Clean Energy - KUG MunichPhysikal - Using Kotlin for Clean Energy - KUG Munich
Physikal - Using Kotlin for Clean Energy - KUG Munich
Werner Keil1K views
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017 by Werner Keil
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Werner Keil478 views
Eclipse Science F2F 2016 - JSR 363 by Werner Keil
Eclipse Science F2F 2016 - JSR 363Eclipse Science F2F 2016 - JSR 363
Eclipse Science F2F 2016 - JSR 363
Werner Keil1K views
Java2Days - Security for JavaEE and the Cloud by Werner Keil
Java2Days - Security for JavaEE and the CloudJava2Days - Security for JavaEE and the Cloud
Java2Days - Security for JavaEE and the Cloud
Werner Keil437 views
Apache DeviceMap - Web-Dev-BBQ Stuttgart by Werner Keil
Apache DeviceMap - Web-Dev-BBQ StuttgartApache DeviceMap - Web-Dev-BBQ Stuttgart
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Werner Keil1K views
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg by Werner Keil
The First IoT JSR: Units of Measurement - JUG Berlin-BrandenburgThe First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
Werner Keil611 views
JSR 354: Money and Currency API - Short Overview by Werner Keil
JSR 354: Money and Currency API - Short OverviewJSR 354: Money and Currency API - Short Overview
JSR 354: Money and Currency API - Short Overview
Werner Keil566 views

Recently uploaded

Serverless computing with Google Cloud (2023-24) by
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)wesley chun
11 views33 slides
Business Analyst Series 2023 - Week 3 Session 5 by
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5DianaGray10
300 views20 slides
Kyo - Functional Scala 2023.pdf by
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
400 views92 slides
NET Conf 2023 Recap by
NET Conf 2023 RecapNET Conf 2023 Recap
NET Conf 2023 RecapLee Richardson
10 views71 slides
Case Study Copenhagen Energy and Business Central.pdf by
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdfAitana
16 views3 slides
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
34 views35 slides

Recently uploaded(20)

Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10300 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson92 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman36 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab21 views

Performance Monitoring for the Cloud - Java2Days 2017

  • 1. Copyright © 2016, Creative Arts & Technologies and others. All rights reserved. Performance Monitoring for the Cloud Werner Keil JSR 363 Maintenance Lead @wernerkeil October 18, 2017
  • 2. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Agenda 1. Introduction 2. Performance Co-Pilot 3. Dropwizard Metrics 4. MicroProfile Metrics 5. Prometheus 6. StatsD 7. Demo
  • 3. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Who am I? Werner Keil • Consultant – Coach • Creative Cosmopolitan • Open Source Evangelist • Software Architect • Spec Lead – JSR363 • Individual JCP Executive Committee Member [www.linkedin.com/in/catmedia] Twitter @wernerkeil
  • 4. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance What is Monitoring? Monitoring applications is observing, analyzing and manipulating the execution of these applications, which gives information about threads, CPU usage, memory usage, as well as other information like methods and classes being used. A particular case is the monitoring of distributed applications, aka the Cloud where an the performance analysis of nodes and communication between them pose additional challenges.
  • 5. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance A high-level view of Cloud Monitoring
  • 6. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Challenges at System Level • Efficient Scalability – Supporting tens of thousands of monitoring tasks – Cost effective: minimize resource usage • Monitoring QoS – Multi-tenancy environment – Minimize resource contention between monitoring tasks • Implication of Multi-Tenancy – Monitoring tasks: adding, removing – Resource contention between monitoring tasks
  • 7. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Performance vs Number of Hosts Number of hosts Performance (values per second) 100 100 1000 1000 10000 10000 60 items per host, update frequency once per minute Number of hosts Performance (values per second) 100 1000 1000 10000 10000 100000 600 items per host, update frequency once per minute
  • 8. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Monitoring Tips • Regularly apply “Little’s Law” to all data... generic (queueing theory) form: Q = λ R • Length = Arrival Rate x Response Time – e.g. 10 MB = 2 MB/sec x 5 sec • Utilization = Arrival Rate x Service Time – e.g. 20% = 0.2 = 100 msec/sec x 2 sec
  • 9. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Types of Monitoring Monitoring Logs • Logstash • Redis • Elasticsearch • Kibana Dashboard Monitoring Performance • Collectd • Statsd • PCP • Graphite • Database (eg: PSQL) • Grafana Dashboard
  • 10. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Monitoring Logs – Kibana Dashboard
  • 11. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Monitoring Performance How is this traditionally done? • rsyslog/syslog-ng/journald • top/iostat/vmstat/ps • Mixture of scripting languages (bash/perl/python) • Specific tools vary per platform • Proper analysis requires more context
  • 12. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Performance Co-Pilot PCP http://www.pcp.io GitHub https://github.com/performancecopilot
  • 13. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance What is PCP? • Open source toolkit • System-level analysis • Live and historical • Extensible (monitors, collectors) • Distributed • Unix-like component design • Cross platform • Ubiquitous units of measurement
  • 14. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Basics Agents and Daemons At the core we have two basic components: 1. Performance Metric Domain Agents • Agents 2. Performance Metric Collection Daemon • PMCD
  • 15. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Architecture
  • 16. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Metrics • pminfo --desc -tT --fetch disk.dev.read disk.dev.read [per-disk read operations] Data Type: 32-bit unsigned int InDom: 60.1 Semantics: counter Units: count Help: Cumulative count of disk reads since boot time Values: inst [0 or "sda"] value 3382299 inst [1 or "sdb"] value 178421 16
  • 17. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Agents Webserver (apache/nginx) DBMS Network Kernel PMCD
  • 18. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Clients Agents PMCD pmie pmstat pmval pminfo pmchart
  • 19. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Remote Clients Agents PMCD Clients Remote PMCD
  • 20. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Data Model • Metrics come from one source (host / archive) • Source can be queried at any interval by any monitor tool • Hierarchical metric names e.g. disk.dev.read and aconex.response_time.avg • Metrics are singular or set-valued (“instance domain”) • Metadata associated with every metric • Data type (int32, uint64, double, ...) • Data semantics (units, scale, ...) • Instance domain
  • 21. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Performance Timeline • Where does the time go? • Where’s it going now? • Where will it go?
  • 22. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Performance Timeline – Toolkit • Archives • Live Monitoring • Modelling and statistical prediction
  • 23. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Performance Timeline – PCP Toolkit • Yesterday, last week, last month, ... • All starts with pmlogger • Arbitrary metrics, intervals • One instance produces one PCP archive for one host • An archive consists of 3 files • Metadata, temporal index, data volume(s) • pmlogger_daily, pmlogger_check • Ensure the data keeps flowing • pmlogsummary, pmwtf, pmdumptext • pmlogextract, pmlogreduce
  • 24. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Custom Instrumentation (Applications)
  • 25. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP – Parfait Parfait has 4 main parts (for now) • Monitoring • DXM • Timing • Requests
  • 26. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Parfait – Monitoring • This is the ‘original’ PCP bridge metrics (heavily modified) • Simple Java objects (MonitoredValues) which wrap a value (e.g. AtomicLong, String) • MonitoredValues register themselves with a registry (container) • When values changes, observers notice and output accordingly • PCP • JMX • Other (Custom/Extended) • Very simple to use • ‘Default registry’ (legacy concept)
  • 27. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Parfait – Timing • Logs the resources consumed by a request (an individual user action) • Relies on a single request being thread-bound (and threads being used exclusively) • Basically needs a Map<Thread, Value> • Take the value for a Thread at the start, and at the end • Delta is the ‘cost’ of that request
  • 28. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Parfait – Timing Example [2010-09-22 15:02:13,466 INFO ][ait.timing.Log4jSink][http-8080-Processor3 gedq93kl][192.168.7.132][20][] Top taskssummaryfeatures:tasks taskssummaryfeatures:tasks Elapsed time: own 380.146316 ms, total 380.14688 ms Total CPU: own 150.0 ms, total 150.0 ms User CPU: own 140.0 ms, total 140.0 ms System CPU: own 10.0 ms, total 10.0 ms Blocked count: own 40, total 40 Blocked time: own 22 ms, total 22 ms Wait count: own 2, total 2 Wait time: own 8 ms, total 8 ms Database execution time: own 57 ms, total 57 ms Database execution count: own 11, total 11Database logical read count: own 0, total 0 Database physical read count: own 0, total 0 Database CPU time: own 0 ms, total 0 ms Database received bytes: own 26188 By, total 26188 By Database sent bytes: own 24868 By, total 24868 By Error Pages: own 0, total 0 Bobo execution time: own 40.742124 ms, total 40.742124 ms Bobo execution count: own 2, total 2 Bytes transferred via bobo search: own 0 By, total 0 By Super search entity count: own 0, total 0 Super search count: own 0, total 0 Bytes transferred via super search: own 0 By, total 0 By Elapsed time during super search: own 0 ms, total 0 ms
  • 29. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Parfait – Requests • As well as snapshotting requests after completion, for many metrics we can see meaningful ‘in-progress’ values • Simple JMX bean which ‘walks’ in-progress requests • Tie in with ThreadContext (MDC abstraction) • Include UserID • ThreadID
  • 30. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP – Speed Golang implementation of the PCP instrumentation API There are 3 main components in the library • Client • Registry • Metric
  • 31. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP – Speed Metric • SingletonMetric • This type defines a metric with no instance domain and only one value. It requires type, semantics and unit for construction, and optionally takes a couple of description strings. A simple construction metric, err := speed.NewPCPSingletonMetric( 42, // initial value "simple.counter", // name speed.Int32Type, // type speed.CounterSemantics, // semantics speed.OneUnit, // unit "A Simple Metric", // short description "This is a simple counter metric to demonstrate the speed API", // long desc )
  • 32. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP for Containers
  • 33. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP for Containers – Cgroup Accounting • [subsys].stat files below /sys/fs/cgroup • individual cgroup or summed over children • blkio • IOPs/bytes, service/wait time – aggregate/per-dev • Split up by read/write, sync/async • cpuacct • Processor use per-cgroup - aggregate/per-CPU • memory • mapped anon pages, page cache, writeback, swap, active/inactive LRU state
  • 34. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP for Containers – Namespaces • Example: cat /proc/net/dev • Contents differ inside vs outside a container • Processes (e.g. cat) in containers run in different network, ipc, process, uts, mount namespaces • Namespaces are inherited across fork/clone • Processes within a container share common view
  • 35. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Container Analysis – Goals • Allow targeting of individual containers • e.g. /proc/net/dev • pminfo --fetch network • vs • pminfo –fetch –container=crank network • Zero installation inside containers required • Simplify your life (dev_t auto-mapping) • Data reduction (proc.*, cgroup.*)
  • 36. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance PCP Container Analysis – Mechanisms • pminfo -f –host=acme.com –container=crank network • Wire protocol extension • Inform interested PCP collector agents • Resolving container names, mapping names to cgroups, PIDs, etc. • setns(2) • Runs on the board, plenty of work remains • New monitor tools with container awareness
  • 37. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance What is Metrics? • Code instrumentation • Meters • Gauges • Counters • Histograms • Web app instrumentation • Web app health check
  • 38. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics Reporters • Reporters • Console • CSV • Slf4j • JMX • Advanced reporters • Graphite • Ganglia
  • 39. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics 3rd Party Libraries • AspectJ • InfluxDB • StatsD • Cassandra • Spring
  • 40. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics Basics • MetricsRegistry • A collection of all the metrics for your application • Usually one instance per JVM • Use more in multi WAR deployment • Names • Each metric has a unique name • Registry has helper methods for creating names MetricRegistry.name(Queue.class, "items", "total") //com.example.queue.items.total MetricRegistry.name(Queue.class, "size", "byte") //com.example.queue.size.byte
  • 41. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics Elements • Gauges • The simplest metric type: it just returns a value final Map<String, String> keys = new HashMap<>(); registry.register(MetricRegistry.name("gauge", "keys"), new Gauge<Integer>() { @Override public Integer getValue() { return keys.keySet().size(); } });
  • 42. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics Elements (2) • Counters • Incrementing and decrementing 64.bit integer final Counter counter= registry.counter(MetricRegistry.name("counter", "inserted")); counter.inc();
  • 43. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics Elements (3) • Histograms • Measures the distribution of values in a stream of data final Histogram resultCounts = registry.histogram(name(ProductDAO.class, "result-counts"); resultCounts.update(results.size()); • Meters • Measures the rate at which a set of events occur final Meter meter = registry.meter(MetricRegistry.name("meter", "inserted")); meter.mark();
  • 44. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics Elements (4) • Timers • A histogram of the duration of a type of event and a meter of the rate of its occurrence Timer timer = registry.timer(MetricRegistry.name("timer", "inserted")); Context context = timer.time(); //timed ops context.stop();
  • 45. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics – Graphite Reporter final Graphite graphite = new Graphite(new InetSocketAddress("graphite.example.com", 2003)); final GraphiteReporter reporter = GraphiteReporter.forRegistry(registry) .prefixedWith("web1.example.com") .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .filter(MetricFilter.ALL) .build(graphite); reporter.start(1, TimeUnit.MINUTES); Metrics can be prefixed Useful to divide environment metrics: prod, test
  • 46. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Metrics – Grafana Application Overview
  • 47. What is Eclipse MicroProfile? ● Eclipse MicroProfile is an open-source community specification for Enterprise Java microservices ● A community of individuals, organizations, and vendors collaborating within an open source (Eclipse) project to bring microservices to the Enterprise Java community 47
  • 48. Specifications 1.2 48 MicroProfile 1.2 = New = No change from last release JAX-RS 2.0JSON-P 1.0CDI 1.2 Config 1.1 Fault Tolerance 1.0 JWT Propagation 1.0 Health Check 1.0 Metrics 1.0
  • 49. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Prometheus
  • 50. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance What is Prometheus? Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. It is now a standalone open source project and maintained independently of any company.
  • 51. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Prometheus Components • The main Prometheus server which scrapes and stores time series data • Client libraries for instrumenting application code • A push gateway for supporting short-lived jobs • Special-purpose exporters (for HAProxy, StatsD, Graphite, etc.) • An alertmanager • Various support tools • WhiteBox Monitoring instead of probing (aka BlackBox Monitoring)
  • 52. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance What is StatsD? A network daemon that runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP or TCP and sends aggregates to one or more pluggable backend services (e.g., Graphite). StatsD was inspired (heavily) by the project (of the same name) at Flickr.
  • 53. @YourTwitterHandle#DVXFR14{session hashtag} © 2016 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Images: Nu Image / Millennium Films
  • 54. © 2017 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance Links Performance Co-Pilot http://www.pcp.io Dropwizard Metrics http://metrics.dropwizard.io Eclipse MicroProfile http://microprofile.io Prometheus http://prometheus.io StatsD https://github.com/etsy/statsd/wiki
  • 55. @YourTwitterHandle#DVXFR14{session hashtag} © 2016 Creative Arts & Technologies and others. All rights reserved.#Monitoring #Performance

Editor's Notes

  1. Config 1.1 introduces minor (documentation) changes to Config 1.0