Анатолий Кулаков «the metrix has you…»

76
Anatoly Kulakov

Upload: spbdotnet-community

Post on 21-Jan-2018

68 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Анатолий Кулаков «The Metrix has you…»

Anatoly Kulakov

Page 2: Анатолий Кулаков «The Metrix has you…»

1

Page 3: Анатолий Кулаков «The Metrix has you…»

2

Page 4: Анатолий Кулаков «The Metrix has you…»

Troubleshooting & Remediation- Where did the problem occur?

Performance & Cost- How my changes impact overall performance?

Learning & Improvement- Can I detect or prevent this problem in the future?

Trends- Do I need to scale?

Customer Experience- Are my customers getting a good experience?

3

Page 5: Анатолий Кулаков «The Metrix has you…»

4https://www.youtube.com/watch?v=wy9YbBqhHqQ

Page 6: Анатолий Кулаков «The Metrix has you…»

5

Page 7: Анатолий Кулаков «The Metrix has you…»

6

Page 8: Анатолий Кулаков «The Metrix has you…»

7

100 measurements200 hosts every 10 sec

× 86 400seconds in a day

172 800 000points per day

Page 9: Анатолий Кулаков «The Metrix has you…»

8

https://www.i-scoop.eu/internet-of-things-guide/

Page 10: Анатолий Кулаков «The Metrix has you…»

9

MetricsLogs

Page 11: Анатолий Кулаков «The Metrix has you…»

10https://db-engines.com/en/ranking_categories

Page 12: Анатолий Кулаков «The Metrix has you…»

11

Page 13: Анатолий Кулаков «The Metrix has you…»

12

Page 14: Анатолий Кулаков «The Metrix has you…»

13

Page 15: Анатолий Кулаков «The Metrix has you…»

14

Page 16: Анатолий Кулаков «The Metrix has you…»

15

Page 17: Анатолий Кулаков «The Metrix has you…»

16

Page 18: Анатолий Кулаков «The Metrix has you…»

17

Page 19: Анатолий Кулаков «The Metrix has you…»

18

Page 20: Анатолий Кулаков «The Metrix has you…»

19

Timestamp

2017-11-12T06:42:17

2017-11-12T06:43:18

Fields

rx = 42tx = 10

rx = 50tx = 88

Tags

host = devif = eth1

host = devif = wlan1

Network

Page 21: Анатолий Кулаков «The Metrix has you…»

20

Timestamp Tags Fields

Network

Primary Key Indexed Column Not Indexed Column

Page 22: Анатолий Кулаков «The Metrix has you…»

21

Timestamp Tags Fields

2017-11-12T06:42:17 42.0173, 1.0, …dev, eth1, …

Network

DateTime string[] double

8 bytes ≈ 24 bytes 8 bytes

Page 23: Анатолий Кулаков «The Metrix has you…»

22

Page 24: Анатолий Кулаков «The Metrix has you…»

23

Page 25: Анатолий Кулаков «The Metrix has you…»

24

Network

Tags host = devif = eth1

host = devif = wlan1

network,host=dev,if=eth1

network,host=dev,if=wlan1

Page 26: Анатолий Кулаков «The Metrix has you…»

25

2017-11-12T06:00:002017-11-12T06:00:052017-11-12T06:00:102017-11-12T06:00:15

-050505

Delta

--00

Delta 2

«We have found that about 96% of all time stampscan be compressed to a single bit.»

http://www.vldb.org/pvldb/vol8/p1816-teller.pdf

Page 27: Анатолий Кулаков «The Metrix has you…»

26

Decimal

15.5

14.0625

3.25

8.625

Page 28: Анатолий Кулаков «The Metrix has you…»

27

Decimal Double Representation

15.5 0x402f000000000000

14.0625 0x402c200000000000

3.25 0x400a000000000000

8.625 0x4021400000000000

Page 29: Анатолий Кулаков «The Metrix has you…»

28

Decimal Double Representation XOR with previous

15.5 0x402f000000000000

14.0625 0x402c200000000000 0x0003200000000000

3.25 0x400a000000000000 0x0026200000000000

8.625 0x4021400000000000 0x002b400000000000

«Roughly 51% of all values are compressed to a single bit»

http://www.vldb.org/pvldb/vol8/p1816-teller.pdf

«… compress time series to an average of 1.37 bytes per point»

Page 30: Анатолий Кулаков «The Metrix has you…»

Performance Counters Third party statistics API Event Tracing for Windows Application measurements

29

Page 31: Анатолий Кулаков «The Metrix has you…»

30

Page 32: Анатолий Кулаков «The Metrix has you…»

31

Page 33: Анатолий Кулаков «The Metrix has you…»

32

Page 34: Анатолий Кулаков «The Metrix has you…»

33

App

Telegraf

App

App

AppTelegraf

AppTelegraf

Page 35: Анатолий Кулаков «The Metrix has you…»

34

Page 36: Анатолий Кулаков «The Metrix has you…»

35https://db-engines.com/en/ranking_trend/time+series+dbms

Page 37: Анатолий Кулаков «The Metrix has you…»

Billions of individual data points High write throughput High read throughput Large deletes (data expiration) Mostly an insert/append workload, very few

updates

36

Page 38: Анатолий Кулаков «The Metrix has you…»

37

Page 39: Анатолий Кулаков «The Metrix has you…»

38

SELECT median(rx), mean(tx)FROM networkWHERE time > now() - 15mAND host = 'dev'

GROUP BY time(10s)

Page 40: Анатолий Кулаков «The Metrix has you…»

39

Real time

10 sec

1 min

1 hour

Page 41: Анатолий Кулаков «The Metrix has you…»

40

CPU: 4-6 coresRAM: 8-32 GBIOPS: 500-1000

Page 42: Анатолий Кулаков «The Metrix has you…»

41

Load Field writes per second

Queries per second

Unique series

Low < 5 thousand < 5 < 100 thousand

Moderate < 250 thousand < 25 < 1 million

High > 250 thousand > 25 > 1 million

Infeasible > 750 thousand > 100 > 10 million

CPU: 4-6 coresRAM: 8-32 GBIOPS: 500-1000

https://docs.influxdata.com/influxdb/v1.3/guides/hardware_sizing/

Page 43: Анатолий Кулаков «The Metrix has you…»

42

Page 44: Анатолий Кулаков «The Metrix has you…»

Write Performance

InfluxDB outperformed:

• MongoDB by 27x• Cassandra by 5x• Elasticsearch by 8x• OpenTSDB by 5x

43

InfluxDB MongoDB Cassandra Elasticsearch OpenTSDB

https://www.influxdata.com/_resources/

Page 45: Анатолий Кулаков «The Metrix has you…»

Compression

InfluxDB outperformed:

• MongoDB by 84x• Cassandra by 9x• Elasticsearch by 16x• OpenTSDB by 16x

44

InfluxDB MongoDB Cassandra Elasticsearch OpenTSDB

https://www.influxdata.com/_resources/

Page 46: Анатолий Кулаков «The Metrix has you…»

Query Performance

InfluxDB outperformed:

• MongoDB similarly• Cassandra by 168x• Elasticsearch by 10x• OpenTSDB by 4x

45

InfluxDB MongoDB Cassandra Elasticsearch OpenTSDB

https://www.influxdata.com/_resources/

Page 47: Анатолий Кулаков «The Metrix has you…»

46

Page 48: Анатолий Кулаков «The Metrix has you…»

47

Page 49: Анатолий Кулаков «The Metrix has you…»

Install Telegraf and Dashboard Install AppMetrics and Dashboard Use it Remove unnecessary metrics Add new application-specific metrics

48

Page 50: Анатолий Кулаков «The Metrix has you…»

49

Demo powered by

Page 51: Анатолий Кулаков «The Metrix has you…»

50

Page 52: Анатолий Кулаков «The Metrix has you…»

51http://sarahwooders.blogspot.ru/2015/02/my-first-week-at-metropia-has-been.html

Page 53: Анатолий Кулаков «The Metrix has you…»

52

Page 54: Анатолий Кулаков «The Metrix has you…»

53

Page 55: Анатолий Кулаков «The Metrix has you…»

54https://www.slideshare.net/nagarajc007/mobile-drunk-driver-detection

Page 56: Анатолий Кулаков «The Metrix has you…»

55

Agent for collecting and reporting metrics

Page 57: Анатолий Кулаков «The Metrix has you…»

56

Time series database

Page 58: Анатолий Кулаков «The Metrix has you…»

57

User interface for:• monitoring• alert management• data visualization• db management

Page 59: Анатолий Кулаков «The Metrix has you…»

58

Data processing framework for:• create alerts• run ETL jobs• detect anomalies

Page 60: Анатолий Кулаков «The Metrix has you…»

59

Page 61: Анатолий Кулаков «The Metrix has you…»

60

https://nssm.cc/

Page 62: Анатолий Кулаков «The Metrix has you…»

61

Query and Write performance

Compression

Realtime Analysis

Statistics and Aggregation

Retention Policy

Continuous Queries

Downsampling

High Loads

High Throughput

Page 63: Анатолий Кулаков «The Metrix has you…»

62

Query and Write performance

Compression

Realtime Analysis

Statistics and Aggregation

Retention Policy

Continuous Queries

Downsampling

High Loads

High Throughput

Page 64: Анатолий Кулаков «The Metrix has you…»

63

Compression

Realtime Analysis

Statistics and Aggregation

Retention Policy

Continuous Queries

Downsampling

High Loads

High Throughput

Page 65: Анатолий Кулаков «The Metrix has you…»

64

Compression

Realtime Analysis

Statistics and Aggregation

Retention Policy

Continuous Queries

Downsampling

High Loads

Page 66: Анатолий Кулаков «The Metrix has you…»

65

Compression

Realtime Analysis

Statistics and Aggregation

Retention Policy

Continuous Queries

High Loads

Page 67: Анатолий Кулаков «The Metrix has you…»

66

Compression

Realtime Analysis

Statistics and Aggregation

Retention Policy

High Loads

Page 68: Анатолий Кулаков «The Metrix has you…»

67

Compression

Realtime Analysis

Retention Policy

High Loads

Page 69: Анатолий Кулаков «The Metrix has you…»

68

Compression

Realtime Analysis

High Loads

Page 70: Анатолий Кулаков «The Metrix has you…»

69

Realtime Analysis

High Loads

Page 71: Анатолий Кулаков «The Metrix has you…»

70

Realtime Analysis

Page 72: Анатолий Кулаков «The Metrix has you…»

71

Page 73: Анатолий Кулаков «The Metrix has you…»

72

Page 75: Анатолий Кулаков «The Metrix has you…»

InfluxData Docs (docs.influxdata.com)

Grafana Docs (docs.grafana.org)

App Metrics (app-metrics.io)

Non-Sucking Service Manager (nssm.cc)

74