kafka核心配置-producer

本文详细介绍了Kafka消息系统的各项配置参数及其作用,包括内存缓冲、重试机制、批处理大小等关键设置,有助于理解如何优化Kafka性能。

 

buffer.memory--33554432=32m

retries--2147483647:可能导致顺序不对

batch.size--16384 字节=16k

connections.max.idle.ms--540000 (9 minutes)

delivery.timeout.ms--120000 (2 minutes) 此值应该大于 request.timeout.ms + linger.ms ,一个消息的最大投递时间

request.timeout.ms--30000 (30 seconds):这个值应该大于replica.lag.time.max.ms,每次请求的最大超时时间

linger.ms--0:每条消息的延迟时间,增大这个值可以提高吞吐率但增大延迟

max.block.ms--60000 (1 minute) send方法的最大阻塞时间(可能因为buffer满了,或者metadata获取不到)

max.request.size--1048576 = 1m

receive.buffer.bytes--32768 (32 kibibytes)

send.buffer.bytes--131072 (128 kibibytes)

enable.idempotence--false 幂等(true需要max.in.flight.requests.per.connection to be less than or equal to 5, retries to be greater than 0 and acks must be 'all')

max.in.flight.requests.per.connection--5 单个连接最大有5个请求同时发

metadata.max.age.ms--300000 (5 minutes) 强制刷新metadata

metadata.max.idle.ms--300000 (5 minutes) metadata缓存时间

reconnect.backoff.max.ms--1000 (1 second)

reconnect.backoff.ms--50

retry.backoff.ms--100 重试等待时间

 

 

17:01:59.772 [kafka-producer-network-thread | console-producer] DEBUG org.apache.kafka.clients.producer.internals.Sender - [Producer clientId=console-producer] Sending transactional request InitProducerIdRequestData(transactionalId=null, transactionTimeoutMs=2147483647, producerId=-1, producerEpoch=-1) to node 192.168.246.131:9092 (id: 3 rack: null) with correlation ID 5 17:01:59.772 [kafka-producer-network-thread | console-producer] DEBUG org.apache.kafka.clients.NetworkClient - [Producer clientId=console-producer] Sending INIT_PRODUCER_ID request with header RequestHeader(apiKey=INIT_PRODUCER_ID, apiVersion=5, clientId=console-producer, correlationId=5, headerVersion=2) and timeout 1500 to node 3: InitProducerIdRequestData(transactionalId=null, transactionTimeoutMs=2147483647, producerId=-1, producerEpoch=-1) 17:01:59.774 [kafka-producer-network-thread | console-producer] DEBUG org.apache.kafka.clients.NetworkClient - [Producer clientId=console-producer] Received INIT_PRODUCER_ID response from node 3 for request with header RequestHeader(apiKey=INIT_PRODUCER_ID, apiVersion=5, clientId=console-producer, correlationId=5, headerVersion=2): InitProducerIdResponseData(throttleTimeMs=0, errorCode=0, producerId=6000, producerEpoch=0) 17:01:59.774 [kafka-producer-network-thread | console-producer] INFO org.apache.kafka.clients.producer.internals.TransactionManager - [Producer clientId=console-producer] ProducerId set to 6000 with epoch 0 17:01:59.774 [kafka-producer-network-thread | console-producer] DEBUG org.apache.kafka.clients.producer.internals.TransactionManager - [Producer clientId=console-producer] Transition from state INITIALIZING to READY
最新发布
06-17
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值