"Kafka Connect is quintessential for most production-grade Kafka data pipelines. As a core Kafka Connect team supporting more than 75 connectors at Confluent, we needed a platform that not only enables easy repeatability of tests across a breadth of connectors but also facilitates benchmarking and extensive analysis of diverse test runs. This session goes over the challenges in designing a framework to test connector performance.
We will cover specific aspects of Connector testing, fine tuning parameters like connector configurations, clusters specifications for optimal performance. The framework integrates with various tools such as Jmeter, Hammerdb, ChaosMesh, Prometheus etc., scaled for Cloud-native environments. We will further go over how we optimized connector performance for maximum public record poll rates, cpu/memory usage, throughput, latencies for different data formats.
Attendees learn in detail how real-world scenarios can be simulated in a test setup for a few connectors like S3 Sink Connector. We also go over some generic guidelines for performance testing of Kafka Connectors and practical considerations for implementing such test frameworks in general."
3. Kafka Streaming Application
A
No-Code way of connecting external systems to Kafka
Kafka
syslog
SOURCES SINKS
Kafka
Connect
Kafka
Connect
Database Connectors File Store Connectors MQ Connectors SAAS Connectors
7. LetsA
MySQL Database
Kafka
Very high throughput
Captures events, but slowly
Lag!
MySQL Debezium Connector
Kafka
Connect
External System
Performance Determinants
● Untuned Connector configuration
● #Tasks
● CPU, Resource crunch
● Unresponsive Sink
● Kafka consumer throttling
How to simulate test-scenarios ?
Slower file flush rates
S3 Sink Streaming Application
8. Challenges :
1. High breadth of connectors
2. End-system specifics
3. Various configuration combinations
4. Pre-existing test-scripts and systems
5. Integration with CI/CD
Test Setup
9. Test Setup
Kafka
Analyzer
Fetch Data
External System Kafka Connector
Generate
Load
Load Generator
Pluggable: Any Loadgen can be used
Sizeable : Configurable CPU/Memory
Scalable : Increase Replicas
Report Generation
Pluggable: Any Analyzer can be used
Sizeable : Configurable CPU/Memory
Custom Tests Designs
Report Generation
10. Test Setup
Kafka
Analyzer
Fetch Data
External System Kafka Connector
Generate
Load
Load Generator
Metric Analyzer
1. Scrape and replay metrics
2. Compare baselines metrics
3. Export metrics
Record Analyzer
1. Consumes destination Topic
2. Verify delivery-semantics
a. At-least once
b. Data-loss
11. Source System
Performance test pipeline
Run Test
Notification
Test Results
Analyze Results
Dashboards
Kafka Cluster
Connect
Analyzer
Load Generator
Storage
CI/CD
Input Specification
Kubernetes
12. Performance test pipeline
Run Test
Notification
Test Results
Analyze Results
Dashboards
Source System
Kafka Cluster
Connect
Analyzer
Load Generator
Kubernetes
Storage
CI/CD
Input Specification
Input Specification
Test Specification
• Each spec represents a
distinct test
• Exhaustive Spec
• Template engines like jinja2,
Django templating can be
used.
13. Performance test pipeline
Run Test
Notification
Test Results
Analyze Results
Dashboards
Source System
Kafka Cluster
Connect
Analyzer
Load Generator
Kubernetes
Storage
CI/CD
Input Specification
Source System
Source System
➔ Tuned.
➔ Pod crash monitoring
➔ Emit pod + end-system
metrics.
Source System
14. Source System
Performance test pipeline
Run Test
Notification
Test Results
Analyze Results
Dashboards
Kafka Cluster
Connect
Analyzer
Load Generator
Storage
CI/CD
Input Specification
Kubernetes
Load Generator
15. Source System
Performance test pipeline
Run Test
Notification
Test Results
Analyze Results
Dashboards
Kafka Cluster
Connect
Analyzer
Load Generator
Storage
CI/CD
Input Specification
Kubernetes
Kafka Cluster
Connect
➔ Set Kafka and Connect
base properties
➔ Scale application
➔ Emit JMX metrics
Kafka & Connect Cluster
16. Source System
Performance test pipeline
Run Test
Notification
Test Results
Analyze Results
Dashboards
Kafka Cluster
Connect
Analyzer
Load Generator
Storage
CI/CD
Input Specification
Kubernetes
Analyzer
➔ Scrape JMX / Custom
metrics
➔ Collect resource profiles
➔ Scrape custom metrics
➔ Export metrics to
metric-store (Bigquery,
Datadog)
Observability
Analysis Template
Metrics Threshold
1. CPU Usage 20%
2. Heap Memory Usage 20%
3. Source Record Poll Rate 10%
4. Producer Bytes ProduceRate 10%
➔ List Metric-name and their
properties
➔ Ex - Scrape
“kafka-consumer” metrics
only
Analysis Template
23. Chaos Scenarios Common to All Connectors
Network Loss (Chaos-Mesh)
Simulate a packet loss scenario
Pod Kill (Chaos-Mesh)
Delete k8s pods randomly
Noisy-Neighbor Scenario
Run Resource Intensive connector in same node
CPU Stress (Chaos-Mesh)
Simulate High CPU load.
Memory Stress (Chaos-Mesh)
Simulate high memory usage
Chaos Tests : Generic Scenarios