- Buffer memory and timeout configurations
- Connection and network settings
- Monitoring and metrics configuration
- Environment-specific tuning templates
Configuration categories
Buffer memory configuration
buffer.memory
Total memory allocated for producer buffering:- Too small: Producer blocks frequently when buffer fills
- Too large: Excessive memory usage, potential GC pressure
- Optimal size: Balance between memory efficiency and producer throughput
max.block.ms
Time to block when buffer is full:Memory calculation
Request timeout settings
| Setting | Default | Description |
|---|---|---|
request.timeout.ms | 30s | Timeout for individual requests |
delivery.timeout.ms | 2min | Overall timeout including retries |
metadata.max.age.ms | 5min | How long to cache topic metadata |
Timeout relationship
Ifdelivery.timeout.ms is shorter than the worst-case retry sequence, the producer throws a ConfigException at startup:
Connection configurations
max.in.flight.requests.per.connection
Maximum unacknowledged requests per connection:| Setting | Ordering | Throughput |
|---|---|---|
| 1 | Strict | Lower |
| 5 (with idempotence) | Maintained | Higher |
| > 5 (without idempotence) | May reorder | Highest |
Configuration templates
High-throughput configuration
Low-latency configuration
High-reliability configuration
Memory-constrained configuration
Monitor your configuration
Essential metrics to track
| Metric | Description | Alert threshold |
|---|---|---|
buffer-available-bytes | Available buffer space | < 10% |
request-latency-avg | Average request latency | > baseline |
record-error-rate | Rate of failed records | > 0 |
record-retry-rate | Rate of retried records | > baseline |
Client identification
Common configuration mistakes
| Mistake | Problem | Solution |
|---|---|---|
Insufficient buffer.memory | Frequent blocking | Increase buffer or reduce batch size |
Too high linger.ms | Unnecessary latency | Reduce to 0-20ms |
| Mismatched timeouts | delivery.timeout too small | Ensure delivery > request + retries |
Missing client.id | Hard to troubleshoot | Always set meaningful client ID |
Wrong max.in.flight | Ordering issues | Use 5 with idempotence |
enable.idempotence=true automatically sets retries=Integer.MAX_VALUE, max.in.flight.requests.per.connection=5, and acks=all. Begin with default configurations and adjust one parameter at a time based on monitoring data—most applications work well with minimal configuration changes.
See it in practice with ConduktorConduktor Console helps you test different producer configurations and observe their effects. Monitor producer metrics to validate your configuration changes work as expected.
Next steps
- Configure producer batching for throughput optimization
- Understand producer acknowledgments for durability
- Enable compression for network efficiency