forked from influxdata/influxdb-comparisons
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DEMO.txt
163 lines (141 loc) · 13.4 KB
/
DEMO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
### bulk data generation
# generate devops data for influx:
$ bulk_data_gen --seed=123 --use-case=devops --scale-var=1 --format=influx-bulk | gzip > influx_bulk_records__usecase_devops__scalevar_1__seed_123.gz
using random seed 123
# generate devops data for elastic:
$ bulk_data_gen --seed=123 --use-case=devops --scale-var=1 --format=es-bulk | gzip > elastic_bulk_records__usecase_devops__scalevar_1__seed_123.gz
using random seed 123
### (optional) bulk data examination
# (optional) make sure your shell uses C-style collation, for parsing speed:
$ export LC_ALL=C
# eyeball the generated data for influx:
$ cat influx_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | wc -l
535680
# examine the generated data:
$ cat influx_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | head -n 4
cpu,cpu=cpu-total,host=host_0,dc=ap-northeast-1 usage_user=24.99694950699479,usage_system=61.58544846337789,usage_idle=22.94813932316394,usage_nice=63.64992071061983,usage_iowait=6.409877704830105,usage_irq=44.879914050302744,usage_softirq=80.50287707611362,usage_steal=38.24311829115428,usage_guest=51.044066802933216,usage_guest_nice=50.30847632544611 1451606400000000000
mem,host=host_0,dc=ap-northeast-1 total=17179869184i,available=16883651721i,used=296217462i,free=15988633722i,cached=4684897985i,buffered=296217462i,used_percent=1.7242125596295794,available_percent=98.27578744037042 1451606400000000000
cpu,cpu=cpu-total,host=host_0,dc=ap-northeast-1 usage_user=25.50911623003783,usage_system=62.17239502260804,usage_idle=23.82938665156794,usage_nice=63.02702362870897,usage_iowait=5.809334373706265,usage_irq=45.29492618753222,usage_softirq=79.31606394020304,usage_steal=37.307481323355354,usage_guest=51.7077373345054,usage_guest_nice=51.087330866396265 1451606410000000000
mem,host=host_0,dc=ap-northeast-1 total=17179869184i,available=17179869184i,used=0i,free=15916954354i,cached=3737398434i,buffered=0i,used_percent=0,available_percent=100 1451606410000000000
# eyeball the generated data for elastic (note that 1071360 == 2 * 535680):
$ cat elastic_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | wc -l
1071360
# examine the generated data (note that the values are the same as for influx):
$ cat elastic_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | head -n 8
{ "create" : { "_index" : "cpu", "_type" : "point" } }
{"cpu": "cpu-total", "host": "host_0", "dc": "ap-northeast-1", "usage_user": 24.99694950699479, "usage_system": 61.58544846337789, "usage_idle": 22.94813932316394, "usage_nice": 63.64992071061983, "usage_iowait": 6.409877704830105, "usage_irq": 44.879914050302744, "usage_softirq": 80.50287707611362, "usage_steal": 38.24311829115428, "usage_guest": 51.044066802933216, "usage_guest_nice": 50.30847632544611, "timestamp": 1451606400000 }
{ "create" : { "_index" : "mem", "_type" : "point" } }
{"host": "host_0", "dc": "ap-northeast-1", "total": 17179869184, "available": 16883651721, "used": 296217462, "free": 15988633722, "cached": 4684897985, "buffered": 296217462, "used_percent": 1.7242125596295794, "available_percent": 98.27578744037042, "timestamp": 1451606400000 }
{ "create" : { "_index" : "cpu", "_type" : "point" } }
{"cpu": "cpu-total", "host": "host_0", "dc": "ap-northeast-1", "usage_user": 25.50911623003783, "usage_system": 62.17239502260804, "usage_idle": 23.82938665156794, "usage_nice": 63.02702362870897, "usage_iowait": 5.809334373706265, "usage_irq": 45.29492618753222, "usage_softirq": 79.31606394020304, "usage_steal": 37.307481323355354, "usage_guest": 51.7077373345054, "usage_guest_nice": 51.087330866396265, "timestamp": 1451606410000 }
{ "create" : { "_index" : "mem", "_type" : "point" } }
{"host": "host_0", "dc": "ap-northeast-1", "total": 17179869184, "available": 17179869184, "used": 0, "free": 15916954354, "cached": 3737398434, "buffered": 0, "used_percent": 0, "available_percent": 100, "timestamp": 1451606410000 }
### bulk data loading
# load influx:
$ cat influx_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | bulk_load_influx --batch-size=5000 --workers=2
loaded 535680 items in 7.718265sec with 2 workers (mean rate 69404.198209/sec)
# load elastic:
$ cat elastic_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | bulk_load_es --batch-size=5000 --workers=2
loaded 535680 items in 73.443550sec with 2 workers (mean rate 7293.765034/sec)
# (optional) load elastic with the aggregation-only index template:
$ cat elastic_bulk_records__usecase_devops__scalevar_1__seed_123.gz | gunzip | bulk_load_es --batch-size=5000 --workers=2 --index-template=aggregation
loaded 535680 items in 37.635921sec with 2 workers (mean rate 14233.211003/sec)
### bulk query generation
# generate influx queries:
$ bulk_query_gen --debug=0 --seed=321 --format=influx-http | gzip > influx_queries__usecase_devops__scalevar_1__seed_321.gz
using random seed 321
Influx CPU day by 1h: 167 points
Influx CPU month by 1d: 167 points
Influx CPU week by 1h: 167 points
Influx mem day by 1h: 167 points
Influx mem month by 1d: 166 points
Influx mem week by 1h: 166 points
# generate elastic queries:
$ bulk_query_gen --debug=0 --seed=321 --format=es-http | gzip > elastic_queries__usecase_devops__scalevar_1__seed_321.gz
using random seed 321
Elastic CPU day by 1h: 167 points
Elastic CPU month by 1d: 167 points
Elastic CPU week by 1h: 167 points
Elastic mem day by 1h: 167 points
Elastic mem month by 1d: 166 points
Elastic mem week by 1h: 166 points
### bulk query benchmarking
# benchmark devops queries against influx:
$ cat influx_queries__usecase_devops__scalevar_1__seed_321.gz | gunzip | query_benchmarker --url=http://localhost:8086 --print-interval=0 --limit=100 --workers=2
run complete after 100 queries:
Influx CPU day by 1h: min: 2.87ms (348.32/sec), mean: 7.63ms (130.99/sec), max: 73.49ms ( 13.61/sec), count: 17
Influx CPU month by 1d: min: 51.50ms ( 19.42/sec), mean: 61.74ms ( 16.20/sec), max: 158.60ms ( 6.31/sec), count: 17
Influx CPU week by 1h: min: 13.37ms ( 74.77/sec), mean: 23.06ms ( 43.37/sec), max: 156.85ms ( 6.38/sec), count: 17
Influx mem day by 1h: min: 2.83ms (353.10/sec), mean: 3.35ms (298.52/sec), max: 4.20ms (238.15/sec), count: 17
Influx mem month by 1d: min: 49.96ms ( 20.02/sec), mean: 60.15ms ( 16.63/sec), max: 140.03ms ( 7.14/sec), count: 16
Influx mem week by 1h: min: 12.60ms ( 79.38/sec), mean: 17.12ms ( 58.42/sec), max: 62.33ms ( 16.04/sec), count: 16
# benchmark devops queries against elastic:
$ cat elastic_queries__usecase_devops__scalevar_1__seed_321.gz | gunzip | query_benchmarker --url=http://localhost:9200 --debug=0 --print-interval=0 --limit=100 --workers=2
run complete after 100 queries:
Elastic CPU day by 1h: min: 5.65ms (176.85/sec), mean: 9.77ms (102.38/sec), max: 24.07ms ( 41.54/sec), count: 17
Elastic CPU month by 1d: min: 19.46ms ( 51.40/sec), mean: 27.90ms ( 35.84/sec), max: 44.05ms ( 22.70/sec), count: 17
Elastic CPU week by 1h: min: 7.06ms (141.60/sec), mean: 22.78ms ( 43.90/sec), max: 42.74ms ( 23.40/sec), count: 17
Elastic mem day by 1h: min: 5.47ms (182.80/sec), mean: 11.95ms ( 83.70/sec), max: 26.37ms ( 37.92/sec), count: 17
Elastic mem month by 1d: min: 21.14ms ( 47.31/sec), mean: 37.92ms ( 26.37/sec), max: 90.99ms ( 10.99/sec), count: 16
Elastic mem week by 1h: min: 16.72ms ( 59.79/sec), mean: 24.07ms ( 41.54/sec), max: 41.03ms ( 24.37/sec), count: 16
### (optional) bulk query debugging
# examine a reply from influx:
$ cat influx_queries__usecase_devops__scalevar_1__seed_321.gz | gunzip | query_benchmarker --url=http://localhost:8086 --print-interval=0 --limit=1 --workers=1 --debug=4
debug: Influx CPU day by 1h in 5.44ms -- Influx CPU day by 1h: 2016-01-21T00:00:00Z
debug: request: HumanLabel: Influx CPU day by 1h, HumanDescription: Influx CPU day by 1h: 2016-01-21T00:00:00Z, Method: GET, Path: /query?db=benchmark_db&q=SELECT+mean%28usage_user%29+from+cpu+where+time+%3E%3D+%272016-01-21T00%3A00%3A00Z%27+and+time+%3C+%272016-01-22T00%3A00%3A00Z%27+group+by+time%281h%29, Body:
debug: response: {"results":[{"series":[{"name":"cpu","columns":["time","mean"],"values":[["2016-01-21T00:00:00Z",25.805973359256072],["2016-01-21T01:00:00Z",42.50426572030905],["2016-01-21T02:00:00Z",42.66101112328767],["2016-01-21T03:00:00Z",21.721251118468953],["2016-01-21T04:00:00Z",12.416105771089034],["2016-01-21T05:00:00Z",22.294869016902208],["2016-01-21T06:00:00Z",10.454933380625294],["2016-01-21T07:00:00Z",12.11297152505829],["2016-01-21T08:00:00Z",9.18626074225389],["2016-01-21T09:00:00Z",26.797867219943626],["2016-01-21T10:00:00Z",29.64663961516153],["2016-01-21T11:00:00Z",20.473090185239194],["2016-01-21T12:00:00Z",32.02182256180718],["2016-01-21T13:00:00Z",31.888959320225872],["2016-01-21T14:00:00Z",23.53104288990773],["2016-01-21T15:00:00Z",27.052968227504735],["2016-01-21T16:00:00Z",30.219540361643556],["2016-01-21T17:00:00Z",41.41703437958548],["2016-01-21T18:00:00Z",32.07536845247729],["2016-01-21T19:00:00Z",32.11521185010323],["2016-01-21T20:00:00Z",33.21698215909114],["2016-01-21T21:00:00Z",42.80199660166891],["2016-01-21T22:00:00Z",56.48636130204469],["2016-01-21T23:00:00Z",71.57165166668098]]}]}]}
run complete after 1 queries:
Influx CPU day by 1h: min: 5.44ms (183.71/sec), mean: 5.44ms (183.71/sec), max: 5.44ms (183.71/sec), count: 1
# examine a reply from elastic (note that the aggregation numbers are the same as from influx):
$ cat elastic_queries__usecase_devops__scalevar_1__seed_321.gz | gunzip | query_benchmarker --url=http://localhost:9200 --print-interval=0 --limit=1 --workers=1 --debug=4 [8/18476]debug: Elastic CPU day by 1h in 7.03ms -- Elastic CPU day by 1h: 2016-01-21T00:00:00Z
debug: request: HumanLabel: Elastic CPU day by 1h, HumanDescription: Elastic CPU day by 1h: 2016-01-21T00:00:00Z, Method: POST, Path: /cpu/_search, Body:
{
"size" : 0,
"aggs": {
"result": {
"filter": {
"range": {
"timestamp": {
"gte": "2016-01-21T00:00:00Z",
"lt": "2016-01-22T00:00:00Z"
}
}
},
"aggs": {
"result2": {
"date_histogram": {
"field": "timestamp",
"interval": "1h",
"format": "yyyy-MM-dd-HH"
},
"aggs": {
"avg_of_field": {
"avg": {
"field": "usage_user"
}
}
}
}
}
}
}
}
debug: response: {"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":267840,"max_score":0.0,"hits":[]},"aggregations":{"result":{"doc_count
":8640,"result2":{"buckets":[{"key_as_string":"2016-01-21-00","key":1453334400000,"doc_count":360,"avg_of_field":{"value":25.805973359256082}},{"key_as_string":"2016-01-21-01","key"
:1453338000000,"doc_count":360,"avg_of_field":{"value":42.50426572030905}},{"key_as_string":"2016-01-21-02","key":1453341600000,"doc_count":360,"avg_of_field":{"value":42.6610111232
87686}},{"key_as_string":"2016-01-21-03","key":1453345200000,"doc_count":360,"avg_of_field":{"value":21.72125111846895}},{"key_as_string":"2016-01-21-04","key":1453348800000,"doc_co
unt":360,"avg_of_field":{"value":12.416105771089029}},{"key_as_string":"2016-01-21-05","key":1453352400000,"doc_count":360,"avg_of_field":{"value":22.294869016902222}},{"key_as_stri
ng":"2016-01-21-06","key":1453356000000,"doc_count":360,"avg_of_field":{"value":10.454933380625288}},{"key_as_string":"2016-01-21-07","key":1453359600000,"doc_count":360,"avg_of_fie
ld":{"value":12.112971525058288}},{"key_as_string":"2016-01-21-08","key":1453363200000,"doc_count":360,"avg_of_field":{"value":9.186260742253886}},{"key_as_string":"2016-01-21-09","
key":1453366800000,"doc_count":360,"avg_of_field":{"value":26.79786721994362}},{"key_as_string":"2016-01-21-10","key":1453370400000,"doc_count":360,"avg_of_field":{"value":29.646639
615161565}},{"key_as_string":"2016-01-21-11","key":1453374000000,"doc_count":360,"avg_of_field":{"value":20.473090185239197}},{"key_as_string":"2016-01-21-12","key":1453377600000,"d
oc_count":360,"avg_of_field":{"value":32.02182256180716}},{"key_as_string":"2016-01-21-13","key":1453381200000,"doc_count":360,"avg_of_field":{"value":31.888959320225876}},{"key_as_
string":"2016-01-21-14","key":1453384800000,"doc_count":360,"avg_of_field":{"value":23.53104288990773}},{"key_as_string":"2016-01-21-15","key":1453388400000,"doc_count":360,"avg_of_
field":{"value":27.0529682275047}},{"key_as_string":"2016-01-21-16","key":1453392000000,"doc_count":360,"avg_of_field":{"value":30.21954036164353}},{"key_as_string":"2016-01-21-17",
"key":1453395600000,"doc_count":360,"avg_of_field":{"value":41.4170343795855}},{"key_as_string":"2016-01-21-18","key":1453399200000,"doc_count":360,"avg_of_field":{"value":32.075368
452477306}},{"key_as_string":"2016-01-21-19","key":1453402800000,"doc_count":360,"avg_of_field":{"value":32.115211850103215}},{"key_as_string":"2016-01-21-20","key":1453406400000,"d
oc_count":360,"avg_of_field":{"value":33.21698215909115}},{"key_as_string":"2016-01-21-21","key":1453410000000,"doc_count":360,"avg_of_field":{"value":42.801996601668904}},{"key_as_
string":"2016-01-21-22","key":1453413600000,"doc_count":360,"avg_of_field":{"value":56.48636130204468}},{"key_as_string":"2016-01-21-23","key":1453417200000,"doc_count":360,"avg_of_
field":{"value":71.57165166668094}}]}}}}
run complete after 1 queries:
Elastic CPU day by 1h: min: 7.03ms (142.31/sec), mean: 7.03ms (142.31/sec), max: 7.03ms (142.31/sec), count: 1