60
@InfluxDB David Norton (@dgnorton) [email protected] 1 / 69

@InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

  • Upload
    others

  • View
    25

  • Download
    0

Embed Size (px)

Citation preview

Page 1: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

@InfluxDBDavid Norton (@dgnorton)

[email protected]

1 / 69

Page 2: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Instrumenting a Data Center

2 / 69

Page 3: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

3 / 69

Page 4: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

4 / 69

The problem:Efficiently monitor hundreds or

thousands of servers

5 / 69

Page 5: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

The solution:Automate it!

6 / 69

Page 6: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Automate what?data collection, storage, analysis, &

alerting

7 / 69

Page 7: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Easy!Write a few scripts & store the data in

SQL.

8 / 69

Page 8: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

1 server

100 measurements

8,640 per day (once every 10s)

365 days

= 315 million records (points) per year9 / 69

10 servers

Page 9: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

100 measurements per server

8,640 per day (once every 10s)

365 days

= 3.2 billion records (points) per year10 / 69

2,000 servers

200 measurements per server

17,280 per day (once every 5s)

365 days

= 2.5 trillion records (points) per year

Page 10: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

11 / 69

Time series database is ideal for thistype of data & workload

12 / 69

Page 11: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

"time series"

13 / 69

Page 12: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Values and time stampsValue

Time?14 / 69

Page 13: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Values and time stamps

Value

Time?

time value2015­04­22   5:00 PM2015­04­22   6:00 PM

10,020,0

15 / 69

Page 14: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

CPU usage every 10 seconds...

Value

Time

16 / 69

Cumulative steps taken...

Step

Value

Page 15: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Step

Count Value

Time

17 / 69

Happy InfluxDB users...

Value

TimeInfluxDB

Users

Page 16: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

18 / 69

Time series database

Value

Time

Step

Count Value

Time

Value

TimeInfluxDB

Users

Value

Time?19 / 69

Page 17: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

20 / 69

Page 18: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

InfluxDB

21 / 69

Page 19: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

InfluxDB­ time series database

22 / 69

InfluxDB­ time series database

Page 20: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

­ no external dependencies

23 / 69

InfluxDB­ time series database

­ no external dependencies

­ distributed & scalable

Page 21: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

24 / 69

InfluxDB­ time series database

­ no external dependencies

­ distributed & scalable

­ easy to install, use, & maintain

Page 22: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

25 / 69

InfluxDB­ time series database

­ no external dependencies

­ distributed & scalable

­ easy to install, use, & maintain

­ open source (MIT license)

26 / 69

Page 23: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

InfluxDB­ time series database

­ no external dependencies

­ distributed & scalable

­ easy to install, use, & maintain

­ open source (MIT license)

­ written in Go27 / 69

Page 24: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Features­ SQL­like query language

­ HTTP(S) API for writes & queries

­ Supports other protocols (collectd, graphite,opentsdb)

­ Automated data retention policies

­ Aggregate data on­the­fly

28 / 69

Page 25: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Data model...

29 / 69

influx d

Page 26: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

30 / 69

influx d

Page 27: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

31 / 69

influx d

Page 28: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

32 / 69

influx d

measurements

DISK

33 / 69

Page 29: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

influx d

measurements

DISK

tags

country ='DEU'

region ='neast'

34 / 69

Page 30: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

influx d

country ='DEU'

region ='west'

+

series = measurement + unique tag set

35 / 69

Page 31: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

influx d

country ='DEU'

region ='west'

+

series = measurement + unique tag set

OR 

country ='DEU'

region ='east'

+

36 / 69

influx d

Points:  values in a series

Page 32: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

country ='DEU'

region ='east'

+time value2015­04­22   5:00 PM2015­04­22   5:01 PM

10,020,0

country ='USA'

region ='east'

+time value2015­04­22   5:00 PM2015­04­22   5:01 PM

14,038,0

37 / 69

What's indexed?

Page 33: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

38 / 69

What's indexed?Metadata:

­ Measurement names

Page 34: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

39 / 69

What's indexed?Metadata:

­ Measurement names

­ Tag keys & values

40 / 69

Page 35: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

What's indexed?Metadata:

­ Measurement names

­ Tag keys & values

­ Field keys

41 / 69

Page 36: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

What's indexed?Metadata:

­ Measurement names

­ Tag keys & values

­ Field keys

­ Field values by time*

      WHERE time > now() ­ 1m

42 / 69

Page 37: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Metadata index is held in­memory atrun time

43 / 69

What's not indexed?

Page 38: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

44 / 69

What's not indexed?­ Field values by value

      WHERE value > 2.718

Page 39: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

45 / 69

What's not indexed?­ Field values by value

      WHERE value > 2.718

­ Metadata by time

      SHOW MEASUREMENTS WHERE time > now() - 1h

Page 40: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

46 / 69

Data retention

47 / 69

Page 41: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

48 / 69

Page 42: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

InfluxDB hasRetention Policies

49 / 69

Page 43: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

How do they work?

50 / 69

Page 44: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

All data is written to aretention policy

51 / 69

Each retention policy has aduration specified(between 1 hour and infinite)

Page 45: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

(between 1 hour and infinite)

52 / 69

raw(1 day)

cpu_1h(1 week)

shards shards

SELECT mean(value)  INTO cpu_1h.cpu  FROM raw.cpu  WHERE time > now() ­ 1w  GROUP BY time(1h)

Page 46: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

53 / 69

How to automatedownsampling?

54 / 69

Page 47: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Continuous QueriesStored in the database and run periodically in

the background

55 / 69

Page 48: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

raw(1 day)

cpu_1h(1 week)

shards shards

CREATE CONTINUOUS QUERY mycq ON mydbCREATE CONTINUOUS QUERY mycq ON mydb  BEGIN  BEGIN    SELECT mean(value)    SELECT mean(value)      INTO cpu_1h.cpu      INTO cpu_1h.cpu      FROM raw.cpu      FROM raw.cpu      GROUP BY time(1h)      GROUP BY time(1h)  END  END

56 / 69

Page 49: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Replication is handled throughRetention Policies

57 / 69

FunctionsAggregations:

count, distinct, mean, median, sum

Page 50: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

count, distinct, mean, median, sum

58 / 69

FunctionsAggregations:

count, distinct, mean, median, sum

Selectors:

bottom, first, last, max, min, percentile, top

Page 51: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

bottom, first, last, max, min, percentile, top

59 / 69

FunctionsAggregations:

count, distinct, mean, median, sum

Selectors:

bottom, first, last, max, min, percentile, top

Transformations:

ceiling, derivative, difference, floor, histogram,stddev

Page 52: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

stddev60 / 69

Data ingestion

61 / 69

Page 53: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

InfluxDB supports:­ collectd

­ openTSDB

­ graphite

62 / 69

Page 54: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Telegraf­ http://github.com/influxdb/telegraf

­ Open Source (MIT License)

­ Also written in Go

­ Plugin based (~30 currently and growing)

­ Cross platform

63 / 69

Client libraries

Page 55: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Client libraries­ Go

­ Ruby

­ Java

­ Python

­ etc. (http://github.com/influxdb)

64 / 69

HTTP(S) APIWrite data via HTTP using a simpletext­based protocol

Page 56: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

cpu,host=serverA value=10.0 1234567890

65 / 69

Visualization

Page 57: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

66 / 69

Grafana

Page 58: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

67 / 69

Chronograf

68 / 69

Page 59: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6

Thank You!@InfluxDB

David Norton (@dgnorton)

[email protected]

69 / 69

Page 60: @InfluxDB - USENIX...InfluxDB U ser V a l u e Time? 1 9 / 6 InfluxDB 2 1 / 6 9. InfluxDB time series database 2 / 6 9 InfluxDB time series database no external dependencies 2 3 / 6