We are preparing to deploy our *Java API-based Kafka Producer* to
production and want to ensure our configuration is optimized.


However, we want to validate the configuration for *high reliability and
optimal performance* in production.
*Message Load Details*


   - *Message Rate:* 3,000 to 5,000 messages per minute
   - *Message Size:* ~2,500 to 3,000 bytes per message
   - *Kafka Version:* 3.6.1

props.put(ProducerConfig.ACKS_CONFIG, "all");
props.put(ProducerConfig.BATCH_SIZE_CONFIG, 131072);
props.put(ProducerConfig.LINGER_MS_CONFIG, 50);
props.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4");
props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 67108864);
props.put(ProducerConfig.RETRIES_CONFIG, 5);
props.put(ProducerConfig.RETRY_BACKOFF_MS_CONFIG, 1000);
props.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, 60000);
props.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, 600000);


*Issue Observed*

We have noticed *timeout errors in prod* occasionally when inserting
messages into Kafka.

 Currently, our setup runs fine in lower environments, and even load tests
did not show any major issues.
*Questions for Optimization:*

   1. Are there any potential issues with the above configuration for
   production use?
   2. Given our message load and size, should we *adjust batch size,
   linger.ms <http://linger.ms>, or buffer.memory* for better performance?
   3. Is our *retry and timeout configuration* suitable, or should we
   fine-tune RETRIES_CONFIG, RETRY_BACKOFF_MS_CONFIG, and
   DELIVERY_TIMEOUT_MS_CONFIG?
   4. Any other best practices we should follow to *avoid timeout errors*
   in production?

Would appreciate insights from the community on how to improve this setup
before we go live!.


Regards,

Giridar

Reply via email to