2. v = 346,39 m/s Speed of sound at 25 °C
v = 349,29 m/s Speed of sound at 30 °C
front to audience: 2 m
latency: 5.7 ms
latency (back of room): 15 ms
#atix #streamingworkshop
3. v = 346,39 m/s Speed of sound at 25 °C
v = 349,29 m/s Speed of sound at 30 °C
front to audience: 2 m
latency: 5.7 ms
latency (back of room): 15 ms
#atix #streamingworkshop
4. v = 346,39 m/s Speed of sound at 25 °C
v = 349,29 m/s Speed of sound at 30 °C
front to audience: 2 m
latency: 5.7 ms
latency (back of room): 15 ms
#atix #streamingworkshop
5. v = 346,39 m/s Speed of sound at 25 °C
v = 349,29 m/s Speed of sound at 30 °C
front to audience: 2 m
latency: 5.7 ms
latency (back of room): 15 ms
#atix #streamingworkshop
6. v = 346,39 m/s Speed of sound at 25 °C
v = 349,29 m/s Speed of sound at 30 °C
front to audience: 2 m
latency: 5.7 ms
latency (back of room): 15 ms
#atix #streamingworkshop
7. take home message: I am faster than my ISP!
Source: speedcheck.org
#atix #streamingworkshop
8. How to tune Kafka for
production
Dr. Bernhard Hopfenmüller
24. Juli 2019
#atix #streamingworkshop
9. What do you need?
Latency Throughput
Durability Availability
???
IoT
#atix #streamingworkshop
10. whoami
Bernhard Hopfenmüller
Senior IT Consultant @ ATIX AG
current latency 8 ms
hopfenmueller@atix.de
github.com/Fobhep
Twitter: @fobhep
IRC: Fobhep
#atix #streamingworkshop
19. Throughput: Partitions
More Partition == Higher
Troughput?!
yes, but!
More Open File Handlers
More Memory needed for
Producer and Consumer
#atix #streamingworkshop
28. Latency: Kafka Streams - Table Stream Duality
Source: Confluent
A table is a stream is
a table ...
#atix #streamingworkshop
29. Latency: Kafka Streams - Local Table Joins
Source: Confluent
Include external data
via Connect
join Tables locally
with streams
decrease latency
#atix #streamingworkshop
30. Latency: Kafka Streams - Topologies
Source: Confluent
Input from Kafka
Operations (filter map
aggregation join)
Back to Kafka
#atix #streamingworkshop
41. Durability: Exactly Once Semantic
(
Send Data with PID and increasing seq
Broker: Check if seq > seq_old
write only if true
)
1. Idempotent
Producer
#atix #streamingworkshop
42. Durability: Exactly Once Semantic
(
Send Data
Read Data (Write to Commit Log)
)
Either write all of that or none
Source: Confluent
1. Idempotent
Producer
2. Multiple Partition
Transactions
#atix #streamingworkshop
43. Durability: Exactly Once Semantic
producer.initTransactions();
[...]
while (true) {
ConsumerRecords records = consumer.poll(Long.MAX_VALUE);
producer.beginTransaction();
for (ConsumerRecord record : records)
producer.send(producerRecord(“outputTopic”, record));
producer.sendOffsetsToTransaction(currentOffsets(consumer), group);
producer.commitTransaction();
}
Source: Confluent
1. Idempotent
Producer
2. Multiple
Partition
Transactions
#atix #streamingworkshop
51. Availability: Log Recovery
broker start: scan all log files
to sync
usually one thread per data
dir
increase to number of dirs in
log.files
#atix #streamingworkshop
52. Availability: Stream State Restoration
Source: Confluent
store data for stateful stream
ops
create copies of state for
reusing
num.standby.replicas > 0
#atix #streamingworkshop
53. Availability: Summary
Consumer:
session.timeout.ms: as low as feasible (default 10000)
Streams:
StreamsConfig.NUM_STANDBY_REPLICAS_CONFIG: 1 or more(default 0)
Broker:
unclean.leader.election.enable=true (default false); topic override available
min.insync.replicas=1 (default 1); topic override available
num.recovery.threads.per.data.dir: number of directories in log.dirs (default 1)
#atix #streamingworkshop
54. And now?: Next steps
1. Decide what you want
Repeat:
2. Benchmark - Control Center!
3. Act on results
4. MONITOR! - Control Center!
#atix #streamingworkshop
55. And now?: Sources and Material
What is Kafka https://www.heise.de/select/i-
x/2019/4/1553935521978043
Kafka Optimization https://www.confluent.io/white-
paper/optimizing-your-apache-kafka-deployment/
Kafka Partition number https://www.confluent.io/blog/how-choose-
number-topics-partitions-kafka-cluster
RTFM https://docs.confluent.io/current/administer.html
#atix #streamingworkshop
56. And now?: Talk to us
Datacenter
Automation
Deploy
ConfigureRelease
#atix #streamingworkshop