log4j2集成kafka,也就是说,我们这边用log4j2,作为生产者,往kafka中发送消息,但是不知道为什么吞吐量一直多上不去,开始一秒最高达到15万左右,但是后面每秒基本上都是3-5万左右。
下面是我的kafka管理界面,分别为4台机器,由于图片一直上传不上去,只能粘贴出来,实在不好意思。
Brokers
Id Host Port JMX Port Bytes In Bytes Out
0 1111111 PLAINTEXT:9092 -1 0.00 0.00
1 1111111 PLAINTEXT:9092 -1 0.00 0.00
2 1111111 PLAINTEXT:9092 -1 0.00 0.00
3 1111111 PLAINTEXT:9092 -1 0.00 0.00
Combined Metrics
Rate Mean 1 min 5 min 15 min
Messages in /sec 0.00 0.00 0.00 0.00
Bytes in /sec 0.00 0.00 0.00 0.00
Bytes out /sec 0.00 0.00 0.00 0.00
Bytes rejected /sec 0.00 0.00 0.00 0.00
Failed fetch request /sec 0.00 0.00 0.00 0.00
Failed produce request /sec 0.00 0.00 0.00 0.00
然后就是我的topic的分区页面,一个topic分为20个区
----------
Topic Summary
Replication 1
Number of Partitions 20
Sum of partition offsets 0
Total number of Brokers 4
Number of Brokers for Topic 4
Preferred Replicas % 100
Brokers Skewed % 0
Brokers Leader Skewed % 0
Brokers Spread % 100
Under-replicated % 0
----------
Metrics
Rate Mean 1 min 5 min 15 min
Messages in /sec 0.00 0.00 0.00 0.00
Bytes in /sec 0.00 0.00 0.00 0.00
Bytes out /sec 0.00 0.00 0.00 0.00
Bytes rejected /sec 0.00 0.00 0.00 0.00
Failed fetch request /sec 0.00 0.00 0.00 0.00
Failed produce request /sec 0.00 0.00 0.00 0.00
Operations
Partitions by Broker
Broker # of Partitions # as Leader Partitions Skewed? Leader Skewed?
0 5 5 (3,7,11,15,19) false false
1 5 5 (0,4,8,12,16) false false
2 5 5 (1,5,9,13,17) false false
3 5 5 (2,6,10,14,18) false false
Consumers consuming from this topic
Please enable consumer polling here.
----------
Partition Information
Partition Latest Offset Leader Replicas In Sync Replicas Preferred Leader? Under Replicated?
0 1 (1) (1) true false
1 2 (2) (2) true false
2 3 (3) (3) true false
3 0 (0) (0) true false
4 1 (1) (1) true false
5 2 (2) (2) true false
6 3 (3) (3) true false
7 0 (0) (0) true false
8 1 (1) (1) true false
9 2 (2) (2) true false
10 3 (3) (3) true false
11 0 (0) (0) true false
12 1 (1) (1) true false
13 2 (2) (2) true false
14 3 (3) (3) true false
15 0 (0) (0) true false
16 1 (1) (1) true false
17 2 (2) (2) true false
18 3 (3) (3) true false
19 0 (0) (0) true false
先根据这些配置优化一下吧,旁边几章都看看,我不一一贴了。
http://localhost:8093/472
另外:
你的答案