You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It happens particularly in the case using many kinds of tags, or in the case try_flush(enqueue_buffer) called frequently.
require'fluent/load'require'logger'logger=Logger.new(STDOUT)
$log =Fluent::Log.new(logger.instance_variable_get(:@logdev).dev,logger.level)require'fluent/plugin/buf_memory'buf=Fluent::MemoryBuffer.newbuf.start# fill the queue with chunkbuf.buffer_queue_limit.timesdochunk=buf.new_chunk('hoge')buf.enqueue(chunk)buf.instance_variable_get(:@queue) << chunkend# queue size reaches limitpbuf.queue_size# => 64# new events are emitted (with tag which is not included in @map.keys)10000.timesdo |i|
tag=i.to_sdata={value: i}.to_msgpackchain=Fluent::NullOutputChain.instancebuf.emit(tag,data,chain)end# same as Output#enqueue_bufferbuf.keys.each{|key| buf.push(key)}# queue size exceeds limitpbuf.queue_size# => 10064
Or may it be necessary to check the queue size at the beginning of BasicBuffer#emit ? (not after checking storable?)
The merit of current implementation, Fluentd tries to process events as much as possible, queued chunks + chunk in @map.
I don't know which is the best but it works fine.
Thanks for reply.
I worried about memory exhausting by growth of @map and queue size.
(Particularly, in the case that forwarding is not working well by a high load and so on.)
However, I thought over that it may be what should/can be avoided by the tuning of the parameter.
It happens particularly in the case using many kinds of tags, or in the case
try_flush
(enqueue_buffer
) called frequently.I wonder why is the queue size not checked in
BasicBuffer#push
.https://github.com/fluent/fluentd/blob/v0.10.49/lib/fluent/buffer.rb#L244
Or may it be necessary to check the queue size at the beginning of
BasicBuffer#emit
? (not after checkingstorable?
)https://github.com/fluent/fluentd/blob/v0.10.49/lib/fluent/buffer.rb#L165-L183
The text was updated successfully, but these errors were encountered: