Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit 1c6dc29

Browse files
committed
Improve water-level demo (#126)
## Description Run with `stackablectl --additional-demos-file demos/demos-v1.yaml --additional-stacks-file stacks/stacks-v1.yaml demo install nifi-kafka-druid-water-level-data` Tested demo with 2.500.000.000 records Hi all, here a short summary of the observations of the water-level demo: NiFi uses content-repo pvc but keeps it at ~50% usage => Shoud be fine forever Actions: * Increase content-repo 5->10 gb, better safe than sorry. I was able to crash it by using large queues and stalling processors. Kafka uses pvc (currently 15gb) => Should work fine for ~1 week Actions: * Look into retentions settings (low priority as it should work ~1 week) so that it works forever Druid uses S3 for deep storage (S3 has 15gb). But currently it also cashes *everything* locally at the historical because we set `druid.segmentCache.locations=[{"path"\:"/stackable/var/druid/segment-cache","maxSize"\:"300g"}]` (hardcoded in https://github.com/stackabletech/druid-operator/blob/45525033f5f3f52e0997a9b4d79ebe9090e9e0a0/deploy/config-spec/properties.yaml#L725) This does *not* really effect the demo, as 100.000.000 records (let's call it data of ~1 week) have ~400MB. I think the main problem with the demo is that queries take > 5 minutes to complete and Superset shows timeouts. The historical pod suspiciously uses exactly one core of cpu and the queries are really slow for a "big data" system IMHO. This could be because either druid is only using a single core or because we dont set any resources (yet!) and the node does not have more cores available. Going to reasearch that. Actions: * Created stackabletech/druid-operator#306 * In the meantime configure overwrite in the demo `druid.segmentCache.locations=[{"path"\:"/stackable/var/druid/segment-cache","maxSize"\:"3g","freeSpacePercent":"5.0"}]` * Research slow query performance * Have a look at the queries the Superset Dashboard executes and optimize them * Maybe we should bump the druid-operator versions in the demo (e.g. create release 22.09-druid which basically is 22.09 with a newer druid-op version). Therefore we get stable resources. * Enable Druid auto compaction to reduce number of segments
1 parent ade7cf8 commit 1c6dc29

File tree

6 files changed

+36
-11
lines changed

6 files changed

+36
-11
lines changed

demos/demos-v1.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ demos:
5050
- s3
5151
- water-levels
5252
manifests:
53-
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/nifi-kafka-druid-water-level-data/create-nifi-ingestion-job.yaml # TODO
54-
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/nifi-kafka-druid-water-level-data/create-druid-ingestion-job.yaml # TODO
55-
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/nifi-kafka-druid-water-level-data/setup-superset.yaml # TODO
53+
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/nifi-kafka-druid-water-level-data/create-nifi-ingestion-job.yaml
54+
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/nifi-kafka-druid-water-level-data/create-druid-ingestion-job.yaml
55+
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/nifi-kafka-druid-water-level-data/setup-superset.yaml
5656
trino-taxi-data:
5757
description: Demo loading 2.5 years of New York taxi data into S3 bucket, creating a Trino table and a Superset dashboard
5858
documentation: https://docs.stackable.tech/stackablectl/stable/demos/trino-taxi-data.html

demos/nifi-kafka-druid-water-level-data/create-druid-ingestion-job.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
containers:
1010
- name: create-druid-ingestion-job
1111
image: docker.stackable.tech/stackable/testing-tools:0.1.0-stackable0.1.0
12-
command: ["bash", "-c", "curl -X POST -H 'Content-Type: application/json' -d @/tmp/ingestion-job-spec/stations-ingestion-job-spec.json http://druid-coordinator:8081/druid/indexer/v1/supervisor && curl -X POST -H 'Content-Type: application/json' -d @/tmp/ingestion-job-spec/measurements-ingestion-job-spec.json http://druid-coordinator:8081/druid/indexer/v1/supervisor"]
12+
command: ["bash", "-c", "curl -X POST -H 'Content-Type: application/json' -d @/tmp/ingestion-job-spec/stations-ingestion-job-spec.json http://druid-coordinator:8081/druid/indexer/v1/supervisor && curl -X POST -H 'Content-Type: application/json' -d @/tmp/ingestion-job-spec/measurements-ingestion-job-spec.json http://druid-coordinator:8081/druid/indexer/v1/supervisor && curl -X POST -H 'Content-Type: application/json' -d @/tmp/ingestion-job-spec/measurements-compaction-job-spec.json http://druid-coordinator:8081/druid/coordinator/v1/config/compaction"]
1313
volumeMounts:
1414
- name: ingestion-job-spec
1515
mountPath: /tmp/ingestion-job-spec
@@ -65,9 +65,9 @@ data:
6565
},
6666
"dimensionsSpec": {
6767
"dimensions": [
68+
"uuid",
6869
"water_longname",
6970
"water_shortname",
70-
"uuid",
7171
{
7272
"type": "long",
7373
"name": "number"
@@ -124,11 +124,11 @@ data:
124124
"transformSpec": {},
125125
"dimensionsSpec": {
126126
"dimensions": [
127+
"station_uuid",
127128
{
128129
"type": "long",
129130
"name": "value"
130-
},
131-
"station_uuid"
131+
}
132132
]
133133
},
134134
"granularitySpec": {
@@ -139,3 +139,20 @@ data:
139139
}
140140
}
141141
}
142+
measurements-compaction-job-spec.json: |
143+
{
144+
"dataSource": "measurements",
145+
"skipOffsetFromLatest": "PT1H",
146+
"granularitySpec": {
147+
"segmentGranularity": "DAY"
148+
},
149+
"tuningConfig": {
150+
"partitionsSpec": {
151+
"type": "range",
152+
"partitionDimensions": [
153+
"station_uuid"
154+
],
155+
"targetRowsPerSegment": 5000000
156+
}
157+
}
158+
}
4.25 KB
Binary file not shown.

stacks/kafka-druid-superset-s3/druid.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ spec:
3535
historicals:
3636
roleGroups:
3737
default:
38-
replicas: 1
38+
replicas: 2
39+
configOverrides:
40+
runtime.properties:
41+
druid.processing.numThreads: "4" # As we are on 22.09 we can't set any resources requests or limits
42+
# See https://github.com/stackabletech/druid-operator/issues/306
43+
druid.segmentCache.locations: '[{"path":"/stackable/var/druid/segment-cache","maxSize":"8g","freeSpacePercent":"5.0"}]'
3944
middleManagers:
4045
roleGroups:
4146
default:

stacks/kafka-druid-superset-s3/kafka.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ spec:
3030
roleGroups:
3131
default:
3232
replicas: 1
33+
configOverrides:
34+
server.properties:
35+
log.retention.bytes: "4294967296" # 4Gi, as this is for every partition and the demos/users might add multiple topics

stacks/nifi-kafka-druid-superset-s3/nifi.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ spec:
1818
config:
1919
resources:
2020
memory:
21-
limit: '4Gi'
21+
limit: '6Gi'
2222
cpu:
2323
min: "500m"
2424
max: "4"
2525
storage:
2626
contentRepo:
27-
capacity: "5Gi"
27+
capacity: "10Gi"
2828
databaseRepo:
2929
capacity: "5Gi"
3030
flowfileRepo:
31-
capacity: "10Gi"
31+
capacity: "5Gi"
3232
provenanceRepo:
3333
capacity: "5Gi"
3434
stateRepo:

0 commit comments

Comments
 (0)