Microservice monitoring

32

Transcript of Microservice monitoring

Page 1: Microservice monitoring
Page 2: Microservice monitoring

Microservice monitoring

Marek Koniew

Page 3: Microservice monitoring

Reactive manifesto

0

http://www.reactivemanifesto.org/

Bulkheads

https://github.com/Netflix/Hystrix/wiki

Page 4: Microservice monitoring

Cascading failures

2Circuit breaker, bulkhead pattern, cascading failures

Page 5: Microservice monitoring

Back pressure

4

https://github.com/Netflix/Hystrix/wiki

Circuit breaker, back pressure, bulkhead pattern, cascading failures, http 429 too many requests

Page 6: Microservice monitoring

Hystrix

9

- Circuit Breaker

- Request Collapsing

- Request Caching

- Monitoring

Page 7: Microservice monitoring

Hystrix Dashboard

12Real time information. To store information use Graphite.

Page 8: Microservice monitoring

Hystrix Command Widget

14

Page 9: Microservice monitoring

Hello World

17

Page 10: Microservice monitoring

Migrating a Library to Hystrix

19

- External service call should be wrapped into a HystrixCommand

- Configure thread pools

- Fine grained command names

Circuit breaker, Timeouts, queue size, thread pool size

Page 11: Microservice monitoring

Patterns and anti-patterns: naming convention

22

https://wiki.hybris.com/display/prodandtech/Hystrix+commands+naming+convention+-+draft

docu-repo-v2.deleteType.db

Service nameversion Command name

External service

Page 12: Microservice monitoring

Patterns and anti-patterns: thread pools

22

https://github.com/Netflix/Hystrix/wiki/Configuration#threadpool-properties

- Netflix API has 30+ of its threadpools

set at 10, 2 at 20 and 1 at 25

- Queue size affect request times !

Page 15: Microservice monitoring

Dynatrace

Dynatrace architecture

https://www.youtube.com/watch?v=judLcsVns-s

Memory analysis:

https://www.youtube.com/watch?v=dUn4iBM6Hik

28

Page 16: Microservice monitoring

Dynatrace

31

Page 17: Microservice monitoring

Dynatrace

35

Wiki:

https://wiki.hybris.com/display/INFRA/OnDemand+performance+testing+setup

Configure java agent:

java

–agentpath:libdtagent.so=

name=app,

server=dynatrace.yrd.fra.hybris.com,wait=45,

storage=.

Page 18: Microservice monitoring

Dynatrace – advantages

Direct access to agent machine

Memory dumps

CPU sampling

Much more

JVM and system monitoring

Request tracing across services

Hot sensor placement – class instrumentation can be changed without restart

38

Page 19: Microservice monitoring

Dynatrace – disadvantages

Performance overhead

Sensor configuration affects all agents

Weak support for java 8 (although dynatrace version 6 is out)

Steep learning curve

41

Page 20: Microservice monitoring

Dynatrace patterns and anti-patterns

Do NOT use it for monitoring – utilize its profiling power

Much better tools available for monitoring (Graphite, hystrix dashboard)

Applications designed to be monitored does not need dynatrace

Only very simple alerts available

Turn off sensors by default to save performance

Configure separate service instance with extended number of sensors on demand

Route part of the traffic through this service (canary testing)

44

Page 21: Microservice monitoring

Dynatrace demo scenario

47

1) Start application with agent.

2) Observe allocated memory

3) Observe GC suspension times

4) Create memory dump

5) Analyze memory dump

Page 22: Microservice monitoring

Dynatrace demo – allocated memory

49

Page 23: Microservice monitoring

Dynatrace demo – GS suspentions

51

Page 24: Microservice monitoring

Dynatrace demo – application crash

52

Page 25: Microservice monitoring

Dynatrace demo – memory dump

53

Page 26: Microservice monitoring

Dynatrace demo – memory dump

54

Page 27: Microservice monitoring

Dynatrace demo – analyze memory

55

Page 28: Microservice monitoring

Dynatrace demo – root cause

57

https://wiki.hybris.com/display/prodandtech/2014/08/26/Your+service+is+leaking+memory

Page 30: Microservice monitoring

Questions

Page 31: Microservice monitoring

Workshops agenda

Create hystrix command:

Set command name.

Set command group.

Configure thread pool.

Setup hystrix.stream endpoint.

Setup hystrix dashboard.

Connect application to dynatrace.

Create dynatrace graph:

Memory usage.

GC suspension.

Create memory dump.

Page 32: Microservice monitoring