简体   繁体   中英

How does kafka handles writes to multiple partitions on same broker without slowing down as disk seek happens

If 2 topics containing the leaders on same broker are receiving frequent writes, the disk head will seek from one topic partition disk location to another topics's disk location. Since its no longer a sequential write will it not slow down the writing to the topics?

the simple answer is that kafka lies :-)

a kafka broker acknowledges a write once data has been written to page cache . data is then sync'ed to disk in the background.

the advantage is that the operating system page cache is free to reorder the writes to be more sequential (although in general youre right - having lots of partitions on the same disk results in less and less linearity in writes).

the obvious disadvantage is that you can lose acknowledged data on things like power loss

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM