<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kafka on KK's Blog (fromkk)</title><link>https://fromkk.com/tags/kafka/</link><description>Recent content in Kafka on KK's Blog (fromkk)</description><generator>Hugo</generator><language>en</language><managingEditor>bebound@gmail.com (KK)</managingEditor><webMaster>bebound@gmail.com (KK)</webMaster><lastBuildDate>Sun, 10 Aug 2025 18:44:06 +0800</lastBuildDate><atom:link href="https://fromkk.com/tags/kafka/index.xml" rel="self" type="application/rss+xml"/><item><title>Improve Kafka throughput</title><link>https://fromkk.com/posts/improve-kafka-throughput/</link><pubDate>Fri, 28 May 2021 00:57:00 +0800</pubDate><author>bebound@gmail.com (KK)</author><guid>https://fromkk.com/posts/improve-kafka-throughput/</guid><description>&lt;p&gt;Kafka is a high-performance and scalable messaging system. Sometimes when handling big data. The default configuration may limit the maximum performance. In this article, I&amp;rsquo;ll explain how messages are generate and saved in Kafka, and how to improve performance by changing configuration.&lt;/p&gt;
&lt;h2 id="kafka-internals"&gt;Kafka Internals&lt;/h2&gt;
&lt;h3 id="how-does-producer-send-messages"&gt;How does Producer Send Messages?&lt;/h3&gt;
&lt;p&gt;In short, messages will assembled into batches (named &lt;code&gt;RecordBatch&lt;/code&gt;) and send to broker.&lt;/p&gt;
&lt;p&gt;The producer manages some internal queues, and each queue contains &lt;code&gt;RecordBatch&lt;/code&gt; that will send to one broker. When calling &lt;code&gt;send&lt;/code&gt; method, the producer will look into the internal queue and try to append this message to &lt;code&gt;RecordBatch&lt;/code&gt; which is smaller than &lt;code&gt;batch.size&lt;/code&gt; (default value is 16KB) or create new &lt;code&gt;RecordBatch&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>