1. 下载kafka ,并解压kafka
下载
wget https://dlcdn.apache.org/kafka/3.9.0/kafka_2.13-3.9.0.tgz
解压
tar -zxvf kafka_2.13-3.9.0.tgz
转到bin 目录
cd kafka_2.13-3.9.0/bin/
2.创建测试topic
kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --create --topic test_topic --partitions 16 --replication-factor 3
3.压测(注意topic)
./kafka-producer-perf-test.sh --topic test_topic --num-records 100000 --record-size 2048 --throughput=-1 --producer-props acks=all batch.size=524288 compression.type=zstd linger.ms=5 bootstrap.servers=127.0.0.1:9092
4. 返回
100000 records sent, 60168.471721 records/sec (117.52 MB/sec), 32.69 ms avg latency, 370.00 ms max latency, 29 ms 50th, 64 ms 95th, 98 ms 99th, 116 ms 99.9th.
最后编辑于 :2024.12.23 19:31:24
©著作权归作者所有,转载或内容合作请联系作者 平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。