Kafka achieves efficient reading and writing of data

One, write disk sequentially

Kafka producer production data needs to be written to the log file. The writing process is to append to the end of the file, which is sequential writing. There is data on the official website that the same disk can be written sequentially to 600M/s, while random write is only 100K/s. This is related to the mechanical mechanism of the disk. The reason why sequential writing is fast is that it saves a lot of head addressing time.

Two, zero copy (zero copy) technology

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_46122692/article/details/109304611