title: Kafka optimal retention and deletion policy
body: <p>I am fairly new to kafka so forgive me if this question is trivial. I have a very simple setup for purposes of timing tests as follows:</p>
  
  <p>Machine A -> writes to topic 1 (Broker) -> Machine B reads from topic 1
  Machine B -> writes message just read to topic 2 (Broker) -> Machine A reads from topic 2</p>
  
  <p>Now I am sending messages of roughly 1400 bytes in an infinite loop filling up the space on my small broker very quickly. I'm experimenting with setting different values for log.retention.ms, log.retention.bytes, log.segment.bytes and log.segment.delete.delay.ms. First I set all of the values to the minimum allowed, but it seemed this degraded performance, then I set them to the maximum my broker could take before being completely full, but again the performance degrades when a deletion occurs. Is there a best practice for setting these values to get the absolute minimum delay?</p>
  
  <p>Thanks for the help!</p>