Skip to Content
Kafka权威指南(第2版)
book

Kafka权威指南(第2版)

by Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty
November 2022
Beginner to intermediate
346 pages
11h
Chinese
Posts & Telecom Press
Content preview from Kafka权威指南(第2版)
190
10
一方空闲,而另一方很繁忙,那么就知道哪个需要调优了。另外一种办法是查看线程转储
(可以使用
jstack
获得线程转储)
。如果
MirrorMaker
的大部分时间用在轮询上,那么说明
消费者是瓶颈所在;如果
MirrorMaker
的大部分时间用在发送消息上
,则说明生产者是瓶
颈所在。
如果需要对生产者进行调优,那么可以使用下面的配置参数。
linger.ms
batch.size
如果你发现生产者总是发送未被填满的批次(指标
batch-size-avg
batch-size-max
的值总是比
batch.size
小),那么可以通过增加一些延迟来提升吞吐量。可以把
linger.ms
设置得大一些,让生产者在发送批次之前等待几毫秒,让批次填充更多的数据。如果发
送的数据都是满批的,并且还有空余内存,则可以配置更大的
batch.size
,以便发送更
大的批次。
max.in.flight.requests.per.connection
目前,如果某些消息需要多次重试才能确认发送成功,那么
MirrorMaker
保证消息有序
的唯一方法是将处理中的请求数量限制为
1
。但这
意味着在发送下一条消息之前,生产
者当前发送的消息必须得到目标集群的确认。这可能会对吞吐量造成限制,特别是如果
broker
确认消息之前存在显著的延迟
。如果消息顺序对你来说不是很关键,那么保
max.in.flight.requests.per.connection
的默认值
5
可以显著增加吞吐量。
下面的配置参数可用于提升消费者的吞吐量。 ...
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

时间序列分析实战:基于机器学习和统计学

时间序列分析实战:基于机器学习和统计学

Aileen Nielsen
Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9787115601421