項(xiàng)目使用spring-kafka操作消費(fèi)kafka
近期出現(xiàn)消費(fèi)速度變慢,consumer消費(fèi)一條數(shù)據(jù)平均需要200ms的時(shí)間,并且頻繁發(fā)生,consumer會(huì)停止消費(fèi)十幾秒。
以下為日志記錄,consumer會(huì)時(shí)長(zhǎng)從消費(fèi)組中掉出再重新加入
o.a.k.c.c.i.AbstractCoordinator:542 - Marking the coordinator 127.0.0.1:9092 (id: 2147483643 rack: null) dead for group group.id
o.a.k.c.c.i.AbstractCoordinator:505 - Discovered coordinator 127.0.0.1:9092 (id: 2147483643 rack: null) for group group.id.
o.a.k.c.c.i.ConsumerCoordinator:292 - Revoking previously assigned partitions [topic-12] for group group.id
o.a.k.c.c.i.AbstractCoordinator:326 - (Re-)joining group group.id
o.a.k.c.c.i.AbstractCoordinator$SyncGroupResponseHandler:434 - Successfully joined group group.id with generation 12182
o.a.k.c.c.i.ConsumerCoordinator:231 - Setting newly assigned partitions [topic-12] for group group.id
kafka服務(wù)配置文件server.properties提高系統(tǒng)配置參數(shù)
#Broker處理消息的大線程數(shù)
num.network.threads=cpu核數(shù)加1
#Broker處理磁盤(pán)IO的線程數(shù)
num.io.threads=cpu核數(shù)2倍,大不超過(guò)3倍
備份并重啟kafka服務(wù)