-
Notifications
You must be signed in to change notification settings - Fork 16
Kafka streams config fix/tuning: hypertrace-ingester #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
da3899c
f86d71b
e17bd18
effa62a
b0e731e
50b421e
16fc0b9
f5a3c57
2213340
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,4 +20,6 @@ test-output | |
| # Local config to handle using Java 8 vs java 11. | ||
| .java-version | ||
| *.tgz | ||
|
|
||
| # helm | ||
| charts/ | ||
| Chart.lock | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ nodeLabels: {} | |
| # This is defined in resources/configs/trace-enricher/application.conf as service.admin.port | ||
| containerAdminPort: 8099 | ||
|
|
||
| javaOpts: "-Xms512M -Xmx1024M" | ||
| javaOpts: "-XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=75.0 -XX:MaxDirectMemorySize=128M" | ||
|
|
||
| livenessProbe: | ||
| initialDelaySeconds: 10 | ||
|
|
@@ -45,7 +45,7 @@ resources: | |
| memory: 1024Mi | ||
| limits: | ||
| cpu: 1.0 | ||
| memory: 1536Mi | ||
| memory: 1024Mi | ||
|
|
||
| podLabels: | ||
| app: hypertrace-trace-enricher | ||
|
|
@@ -65,13 +65,32 @@ deploymentSelectorMatchLabels: | |
| ########### | ||
| traceEnricherConfig: | ||
| name: hypertrace-trace-enricher-config | ||
| kafka: | ||
| streams: | ||
| config: | ||
| metricsRecordingLevel: INFO | ||
| numStreamThreads: 2 | ||
| bootstrapServers: "bootstrap:9092" | ||
| schemaRegistryUrl: "http://schema-registry-service:8081" | ||
| # Important kafka streams configurations which are used in config template goes here. | ||
| kafkaStreamsConfig: | ||
| bootstrapServers: "bootstrap:9092" | ||
| schemaRegistryUrl: "http://schema-registry-service:8081" | ||
| # Core config | ||
| numStreamThreads: 2 # default = 1 | ||
| commitIntervalMs: 30000 # default = 30000 | ||
| # Common client (producer, consumer, admin) configs | ||
| receiveBufferBytes: 4194304 # default = 32768 (kafka streams default) | ||
| sendBufferBytes: 4194304 # default = 131072 (kafka streams default) | ||
| # Producer configs | ||
| producerAcks: all # default: 1 | ||
| producerBatchSize: 524288 # default = 16384 | ||
| producerLingerMs: 1000 # default = 100 (kafka streams default) | ||
| producerCompressionType: "gzip" # default = none | ||
| producerMaxRequestSize: 10485760 # default = 1048576 | ||
| producerBufferMemory: 134217728 # default = 33554432 | ||
| # Consumer configs | ||
| consumerMaxPartitionFetchBytes: 4194304 # default = 1048576 | ||
| consumerMaxPollRecords: 1000 # default = 1000 (kafka streams default) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as in https://github.com/hypertrace/hypertrace-ingester/pull/91/files#r549230957 |
||
| consumerSessionTimeoutMs: 10000 # default = 10000 | ||
| # Others | ||
| metricsRecordingLevel: INFO # default = INFO | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as in https://github.com/hypertrace/hypertrace-ingester/pull/91/files#r549230957 |
||
| # All other streams config goes here. | ||
| # Remove the flower braces and add key: value pair here. | ||
| extraKafkaStreamsConfig: {} | ||
|
|
||
| logConfig: | ||
| name: hypertrace-trace-enricher-log-config | ||
|
|
@@ -88,11 +107,12 @@ kafka-topic-creator: | |
| kafka: | ||
| topics: | ||
| - name: enriched-structured-traces | ||
| replicationFactor: 1 | ||
| replicationFactor: 3 | ||
| partitions: 8 | ||
| configs: | ||
| - retention.bytes=4294967296 | ||
| - retention.ms=259200000 | ||
| - retention.bytes=8589934592 # default = -1 | ||
| - retention.ms=86400000 # default = 604800000 (7 days) | ||
| - max.message.bytes=10485760 # Allow larger messages for traces | ||
| zookeeper: | ||
| address: zookeeper:2181 | ||
| imagePullSecrets: [] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,44 +6,50 @@ metadata: | |
| release: {{ .Release.Name }} | ||
| data: | ||
| application.conf: |- | ||
|
|
||
| kafka.streams.config = { | ||
| # Core configs | ||
| application.id = raw-spans-to-structured-traces-grouping-job | ||
| bootstrap.servers = "{{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.bootstrapServers }}" | ||
| schema.registry.url = "{{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.schemaRegistryUrl }}" | ||
| value.subject.name.strategy = "io.confluent.kafka.serializers.subject.TopicRecordNameStrategy" | ||
| # Core configs - For applications with state | ||
| num.stream.threads = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.numStreamThreads }}" | ||
| commit.interval.ms = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.commitIntervalMs }}" | ||
| group.instance.id = ${?POD_NAME} | ||
| cache.max.bytes.buffering = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.cacheMaxBytesBuffering }}" | ||
| # Common client (prodcuer, consumer, admin) configs | ||
| receive.buffer.bytes = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.receiveBufferBytes }}" | ||
| send.buffer.bytes = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.sendBufferBytes }}" | ||
| # Producer configs | ||
| producer.acks = "{{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.producerAcks }}" | ||
| producer.batch.size = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.producerBatchSize }}" | ||
| producer.linger.ms = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.producerLingerMs }}" | ||
| producer.compression.type = "{{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.producerCompressionType }}" | ||
| producer.max.request.size = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.producerMaxRequestSize }}" | ||
| producer.buffer.memory = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.producerBufferMemory }}" | ||
| # Consumer configs | ||
| consumer.max.partition.fetch.bytes = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.consumerMaxPartitionFetchBytes }}" | ||
| consumer.max.poll.records = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.consumerMaxPollRecords }}" | ||
| consumer.session.timeout.ms = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.consumerSessionTimeoutMs }}" | ||
| # Changelog topic configs | ||
| replication.factor = "{{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.replicationFactor }}" | ||
| topic.cleanup.policy = "delete,compact" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I always wonder shouldn't it be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| # RocksDB state store configs | ||
| state.dir = "/var/data/" | ||
| metrics.recording.level = "{{ .Values.rawSpansGrouperConfig.kafka.streams.config.metricsRecordingLevel }}" | ||
| num.stream.threads = "{{ .Values.rawSpansGrouperConfig.kafka.streams.config.numStreamThreads }}" | ||
| num.standby.replicas = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.numStandbyReplicas }} | ||
| replication.factor = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.replicationFactor }} | ||
| producer.max.request.size = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.producerMaxRequestSize }} | ||
| cache.max.bytes.buffering = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.cacheMaxBytesBuffering }} | ||
| {{- if .Values.rawSpansGrouperConfig.kafka.streams.config.sessionTimeoutMs }} | ||
| session.timeout.ms = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.sessionTimeoutMs }} | ||
| rocksdb.block.cache.size = {{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.rocksdbBlockCacheSize }} | ||
| rocksdb.write.buffer.size = {{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.rocksdbWriteBufferSize }} | ||
| rocksdb.max.write.buffers = {{ int .Values.rawSpansGrouperConfig.kafkaStreamsConfig.rocksdbMaxWriteBuffers }} | ||
| rocksdb.cache.index.and.filter.blocks = {{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.rocksdbCacheIndexAndFilterBlocks }} | ||
| # Exception handler configs | ||
| default.production.exception.handler = {{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.defaultProductionExceptionHandler }} | ||
| ignore.production.exception.classes = {{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.ignoreProductionExceptionClasses }} | ||
| # Others | ||
| metrics.recording.level = "{{ .Values.rawSpansGrouperConfig.kafkaStreamsConfig.metricsRecordingLevel }}" | ||
| {{- if .Values.rawSpansGrouperConfig.extraKafkaStreamsConfig }} | ||
| {{- range $key,$value := .Values.rawSpansGrouperConfig.extraKafkaStreamsConfig }} | ||
| {{ $key }} = {{ $value }} | ||
| {{- end }} | ||
| {{- if .Values.rawSpansGrouperConfig.kafka.streams.config.commitIntervalMs }} | ||
| commit.interval.ms = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.commitIntervalMs }} | ||
| {{- end }} | ||
| {{- if .Values.rawSpansGrouperConfig.kafka.streams.config.producerBatchSize }} | ||
| producer.batch.size = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.producerBatchSize }} | ||
| {{- end }} | ||
| {{- if .Values.rawSpansGrouperConfig.kafka.streams.config.producerLingerMs }} | ||
| producer.linger.ms = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.producerLingerMs }} | ||
| {{- end }} | ||
| default.production.exception.handler = {{ .Values.rawSpansGrouperConfig.kafka.streams.config.defaultProductionExceptionHandler }} | ||
| ignore.production.exception.classes = {{ .Values.rawSpansGrouperConfig.kafka.streams.config.ignoreProductionExceptionClasses }} | ||
|
|
||
| topic.cleanup.policy = "delete,compact" | ||
| bootstrap.servers = "{{ .Values.rawSpansGrouperConfig.kafka.streams.config.bootstrapServers }}" | ||
|
|
||
| schema.registry.url = "{{ .Values.rawSpansGrouperConfig.kafka.streams.config.schemaRegistryUrl }}" | ||
| specific.avro.reader = true | ||
|
|
||
| rocksdb.block.cache.size = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.rocksdbBlockCacheSize }} | ||
| rocksdb.write.buffer.size = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.rocksdbWriteBufferSize }} | ||
| rocksdb.max.write.buffers = {{ int .Values.rawSpansGrouperConfig.kafka.streams.config.rocksdbMaxWriteBuffers }} | ||
| rocksdb.cache.index.and.filter.blocks = {{ .Values.rawSpansGrouperConfig.kafka.streams.config.rocksdbCacheIndexAndFilterBlocks }} | ||
|
|
||
| value.subject.name.strategy = "io.confluent.kafka.serializers.subject.TopicRecordNameStrategy" | ||
| } | ||
|
|
||
| span.groupby.session.window.interval = {{ .Values.rawSpansGrouperConfig.span.groupby.internal }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are keeping the default from kafka, does it make sense to add an
ifin the chart and thus not requiring us to pass a default? cc @JBAhireThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes the chart more complex by adding many if-else branches.
These are very important handpicked kafka/kafka-streams configs that needs to be tuned as per the application performance/throughput requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Do you think if we can put it as a commented block if a default is the same and it can be uncommented if some values need to be changed?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah above will again need if/else block in the template which you mentioned. Got it now that this was done for keeping the template simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if/else blocks saves us the need to define the defaults ourselves because it adds noise to a already big set of settings. I don't think we will have complex if { if else } else { if else }, it is just a simple if.