-
问题描述: 测试file->kafka性能,写文件流量200mb/s,logtail发送kafka流量最高70mb/s。觉得logtail的性能应该还能提升。想将文件中的数据,不做任何加工发送到kafka,怎么可以进一步提高性能。 任务配置: enable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
processors:
- Type: processor_default
SourceKey: content
flushers:
- Type: flusher_kafka_v2
Version: 0.10.2.0
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
Compression: none
CompressionLevel: 0
BulkMaxSize: 500
BulkFlushFrequency: 30
Authentication:
SASL:
Username: xxx
Password: xxx 资源配置: ilogtail_config.json
{
"cpu_usage_limit":15,
"mem_usage_limit":6144,
"process_thread_count":8,
"max_bytes_per_sec" : 629145600,
"send_request_concurrency":80
} |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Kafka性能社区也是需要有些大流量的环境压测,之前开发的时候也没找到比较好的机器去很高的测试。参数配置从采集上没什么大问题,可以调整一些条件做下对比:
也欢迎在这里一起讨论和提交相关的测试对比,共同提升组件的性能 |
Beta Was this translation helpful? Give feedback.
-
压测预期是要达到什么程度? 思路: 先确认出瓶颈点才好继续优化。 此外,https://mp.weixin.qq.com/s/8mCVk3gvXPOijTlcRjUR_w 有些测试数据和方法可以参考下。 |
Beta Was this translation helpful? Give feedback.
-
场景介绍在做技术调研,想知道logtail在公司场景下的采集性能,以及想看到logtail的极限。 主要场景: file log -> kafka/pulsar。默认日志为堆栈日志,采集后以JSON数组的形式发送到kafka/pulsar。 压测准备1. 机器配置: 40C 125G 2. kafka配置: 80分区 2副本 3. 性能观测: 观测kafka manager上topic的输入流量 4. 日志格式-单行 1.1kb [2023-05-14 14:21:10][INFO][../cache.go:198] _undef||traceid=xxx||spanid=xxx||hintCode=0||_msg=redis setex||key=xxx||thread=ThreadPoolExecutor-0_0||java.lang.InterruptedException: sleep interrupted 5. 日志格式-多行 1.26kb [2023-05-14 14:21:10][INFO][../cache.go:198] _undef||traceid=xxx||spanid=xxx||hintCode=0||_msg=redis setex||key=xxx||thread=ThreadPoolExecutor-0_0||java.lang.InterruptedException: sleep interrupted
at java.base/java.lang.Thread.sleep(Native Method)
at com.didichuxing.datachannel.swan.agent.source.log.offset.OffsetManager$1.run(OffsetManager.java:102)
at java.base/java.lang.Thread.run(Thread.java:834) 6. 压测数据 while true
do
cat logs/300m_fileab >> logs/benchmark.log
sleep 1
done 7.全局配置 {
"cpu_usage_limit":15,
"mem_usage_limit":6144,
"process_thread_count":8,
"max_bytes_per_sec" : 629145600,
"send_request_concurrency":80,
"max_read_buffer_size":4194304
} 压测结果压测1: file_log(单行)/no_processor/flusher_kafka_v2(单条) 性能: 83mb/senable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
flushers:
- Type: flusher_kafka_v2
Version: 0.10.2.0
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
Authentication:
SASL:
Username: xxx
Password: xxx 压测2: file_log(单行)/no_processor/flusher_kafka(单条) 性能: 134mb/s怀疑可能 enable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
flushers:
- Type: flusher_kafka
Version: 0.10.2.0
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
SASLUsername: xxx
SASLPassword: xxx 压测3: file_log(单行)/no_processor/flusher_kafka(批量) 性能: 249mb/s 比单条发送提升85%在压测2结束后,调整各种发送kafka的参数,发现改变不大。 后来发现logtail和自有的采集发送到kafka的格式有差异: logtail发送kafka的数据是一条一条的、自有采集器发送到kafka是json array,即会将多条打包到一个json array中,一次发送。@messixukejia @shalousun 大佬帮忙将 enable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
flushers:
- Type: flusher_kafka
Version: 0.10.2.0
MaxMessageBytes: 209715200 // 不加这个会抛异常: Message was too large, server rejected it to avoid allocation error.
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
SASLUsername: xxx
SASLPassword: xxx 压测4: file_log(多行)/processor_split_log_regex(reg库)/flusher_kafka(压测3的) 性能: 51mb/s截止到压测3,发送kafka的方式和现有采集一致,但发现发到kafka的数据被截断,即没有按多行采集。这次按多行模式采集堆栈日志。 enable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
processors:
- Type: processor_split_log_regex
SplitRegex: \[\d+-\d+-\d+\s\d+:\d+:\d+\].*
SplitKey: content
PreserveOthers: false
flushers:
- Type: flusher_kafka
Version: 0.10.2.0
MaxMessageBytes: 209715200
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
SASLUsername: xxx
SASLPassword: xxx 可以看到,多行采集性能下降明显,大佬提出多行解析插件 压测5: file_log(多行)/processor_split_log_regex(reg2库)/flusher_kafka 性能: 83mb/s 比基于reg的多行分割提升: 62%enable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
processors:
- Type: processor_split_log_regex(reg2库)
SplitRegex: \[\d+-\d+-\d+\s\d+:\d+:\d+\].*
SplitKey: content
PreserveOthers: false
flushers:
- Type: flusher_kafka
Version: 0.10.2.0
MaxMessageBytes: 209715200
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
SASLUsername: xxx
SASLPassword: xxx 到这里,多行采集+批量发kafka,和公司场景基本一致。但性能83mb/s,不是很理想。看了下,发现公司的采集器并不是基于正则的多行解析,是基于时间规则的多行解析,可能是解析多行的方式不一致导致。 压测6: file_log(多行)/processor_split_multi_row_by_time_rule/flusher_kafka 性能: 179mb/senable: true
inputs:
- Type: file_log
LogPath: /data1/benchmark/logs
FilePattern: "benchmark.log"
processors:
- Type: processor_split_multi_row_by_time_rule
TimeStartFlag: "["
TimeFormat: "YYYY-MM-DD hh:mm:ss"
SplitKey: "content"
flushers:
- Type: flusher_kafka
Version: 0.10.2.0
MaxMessageBytes: 209715200
Brokers:
- xxxx:xx
- xxxx:xx
Topic: swan_test_agent
SASLUsername: xxx
SASLPassword: xxx 压测总结
|
Beta Was this translation helpful? Give feedback.
-
filebeat真是资源大户 |
Beta Was this translation helpful? Give feedback.
场景介绍
在做技术调研,想知道logtail在公司场景下的采集性能,以及想看到logtail的极限。
主要场景: file log -> kafka/pulsar。默认日志为堆栈日志,采集后以JSON数组的形式发送到kafka/pulsar。
压测准备
1. 机器配置: 40C 125G
2. kafka配置: 80分区 2副本
3. 性能观测: 观测kafka manager上topic的输入流量
4. 日志格式-单行 1.1kb
5. 日志格式-多行 1.26kb