Kafka ਨੂੰ ਟਿਊਨ ਕਰਨ ਵਿੱਚ producers, consumers, brokers, ਅਤੇ topics ਨੂੰ ਕੌਂਫਿਗਰ ਕਰਨਾ ਸ਼ਾਮਲ ਹੈ ਤਾਂ ਕਿ throughput, latency, ਅਤੇ durability ਦਾ ਲੋੜੀਂਦਾ ਸੰਤੁਲਨ ਪ੍ਰਾਪਤ ਹੋ। ਮੁੱਖ ਟਿਊਨਿੰਗ ਪੈਰਾਮੀਟਰਾਂ ਅਤੇ ਟ੍ਰੇਡ-ਆਫਾਂ ਨੂੰ ਸਮਝਣਾ high-performance Kafka ਲਈ ਮਹੱਤਵਪੂਰਨ ਹੈ।
Producer ਟਿਊਨਿੰਗ
✓ BATCHING → batch.size + linger.ms → batch messages → higher THROUGHPUT (fewer requests)
at the cost of slight latency
✓ COMPRESSION → compress batches (snappy, lz4, zstd) → less network/storage, more throughput
✓ acks → acks=all (durable, slower) vs acks=1 (faster, less safe) → durability vs throughput
✓ buffer.memory, max.in.flight → tune for throughput
Consumer ਟਿਊਨਿੰਗ
✓ fetch.min.bytes / fetch.max.wait → batch fetches → throughput vs latency
✓ max.poll.records → how many records per poll (processing batch size)
✓ Enough CONSUMERS and PARTITIONS for parallelism (the main scaling lever)
✓ Efficient processing (don't block; process in parallel/async where possible)
