我通过水槽接收从水槽到卡夫卡主题的事件......为此我使用文件通道但是在写入kafka时我的性能非常低,水槽水槽以每秒190 msg的速率写入而水槽源以每秒3000 msg的速度将事件倾倒到通道....我想提高我的水槽性能......请帮助我怎样才能实现......我曾尝试各种各样的配置....这是我的配置文件-----
agent1.sources = AspectJ
agent1.channels = fileTailChannel
agent1.sinks = APMNullSink
#AspectJ source
agent1.sources.AspectJ.type=com.flume.test.DumbSource
agent1.sources.AspectJ.path=/media/sf_New_Log/calltracedata.txt
agent1.sources.AspectJ.eventtype=CallTrace
agent1.sources.AspectJ.channels=fileTailChannel
agent1.sources.AspectJ.batchSize=1000
agent1.sources.AspectJ.batchDurationMillis=1000
agent1.sources.AspectJ.application = AspectJ
agent1.sources.AspectJ.multi.line.mode=true
agent1.sources.AspectJ.new.event.marker={
agent1.sources.AspectJ.event.terminator=}
agent1.sources.AspectJ.tailer.start.reading.from.end = false
#File Tail Channel
agent1.channels.fileTailChannel.type = file
agent1.channels.fileTailChannel.checkpointDir = /tmp/flume/filechannel/checkpoint
agent1.channels.fileTailChannel.dataDirs = /tmp/flume/filechannel/data
agent1.channels.fileTailChannel.transactionCapacity=100000
#APM Null Sink
agent1.sinks.APMNullSink.type = com.flume.test.TestJSON2KafkaSink
agent1.sinks.APMNullSink.channel = fileTailChannel
agent1.sinks.APMNullSink.testSize = 1000
agent1.sinks.APMNullSink.zk.connect=sandbox.hortonworks.com:2181
agent1.sinks.APMNullSink.metadata.broker.list=sandbox.hortonworks.com:6667
agent1.sinks.APMNullSink.topic=Test
agent1.sinks.APMNullSink.producer.type=async
agent1.sinks.APMNullSink.serializer.class=kafka.serializer.StringEncoder
agent1.sinks.APMNullSink.batch.num.messages=1000
agent1.sinks.APMNullSink.batchSize=50000
agent1.sinks.APMNullSink.batchDurationMillis=1000
agent1.sinks.APMNullSink.queue.buffering.max.ms=5000
agent1.sinks.APMNullSink.queue.buffering.max.messages=100000
agent1.sinks.APMNullSink.send.buffer.bytes=2097152
agent1.sinks.APMNullSink.compression.codec=snappy
答案 0 :(得分:0)
我认为你的问题是一切都在一个盒子上运行,所以快速摄取到文件通道会影响kafka,这需要做更多的工作来编写。
我建议两个选择:
另外我不明白为什么你需要你自己的com.flume.test.TestJSON2KafkaSink而不是Flume附带的那个。也许你的代码中存在一些性能问题。