Skip to Content
Kafka权威指南
book

Kafka权威指南

by Neha Narkhede, Gwen Shapira, Todd Palino
January 2018
Beginner to intermediate
234 pages
7h 8m
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南
安装
Kafka
23
2.4
 硬件的选择
Kafka
选择合适的硬件更像是一门艺术。
Kafka
本身对硬件没有特别的要求,它可以运
行在任何系统上。不过,如果比较关注性能,那么就需要考虑几个会影响整体性能的因
素:磁盘吞吐量和容量、内存、网络和
CPU
。在确定了性能关注点之后,就可以在预算范
围内选择最优化的硬件配置。
2.4.1
 磁盘吞吐量
生产者客户端的性能直接受到服务器端磁盘吞吐量的影响。生产者生成的消息必须被提交
到服务器保存,大多数客户端在发送消息之后会一直等待,直到至少有一个服务器确认消
息已经成功提交为止。也就是说,磁盘写入速度越快,生成消息的延迟就越低。
在考虑硬盘类型对磁盘吞吐量的影响时,是选择传统的机械硬盘(
HDD
)还是固态硬盘
SSD
),我们可以很容易地作出决定。固态硬盘的查找和访问速度都很快,提供了最好的
性能。机械硬盘更便宜,单块硬盘容量也更大。在同一个服务器上使用多个机械硬盘,可
以设置多个数据目录,或者把它们设置成磁盘阵列,这样可以提升机械硬盘的性能。其他
方面的因素,比如磁盘特定的技术(串行连接存储技术或
SATA
),或者磁盘控制器的质
量,都会影响吞吐量。
2.4.2
 磁盘容量
磁盘容量是另一个值得讨论的话题。需要多大的磁盘容量取决于需要保留的消息数量。如
果服务器每天会收到
1TB
消息,并且保留
7
天,那么就需要
7TB
的存储空间,而且还要
为其他文件提供至少
10%
的额外空间。除此之外,还需要提供缓冲区,用于应付消息流量
的增长和波动。
在决定扩展
Kafka
集群规模时,存储容量是一个需要考虑的因素 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習

精通機器學習

Aurélien Géron
精通特征工程

精通特征工程

Alice Zheng, Amanda Casari
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115473271