sender side
<source>
type tail
path /var/log/dummy.log
pos_file /var/tmp/_var_log_dummy.pos
format ltsv
tag dummy
</source>
<match dummy>
type forward
flush_interval 0
buffer_chunk_limit 1m
buffer_queue_limit 64
num_threads 32
<server>
host xxx.xxx.xxx.xxx
port 20000
</server>
</match>
receiver side
<source>
type forward
port 20000
</source>
<match dummy>
type rewrite
add_prefix filtered
<rule>
key path
pattern ^[A-Z]+
replace
</rule>
<rule>
key path
pattern \s[^\s]+$
replace
</rule>
<rule>
key path
pattern (\/[^\?]+)\?[^\s]*
replace \1
last true
</rule>
</match>
<match filtered.**>
type null
</match>
dummy_log_generator.conf
configure 'sample' do
output "/var/log/dummy.log"
message "time:2013-11-25 00:23:52 +0900\tlevel:ERROR\tpath:/foo/bar/hoge/moge\tmethod:POST\turi:/api/v1/people\treqtime:3.1983877060667103"
end
$ bin/dummy_log_generator -c ~/dummy_log_generator.conf -r 10000
Results of vmstat 1. The sixth colum stands for free memory. This tells free memory is decreasing.
20131216 14:34:59 0 0 0 22178800 232508 1552504 0 0 0 0 440 217 0 0 100 0 0
snipp...
20131216 14:47:12 1 0 0 20976952 232508 1552712 0 0 0 0 2981 5518 2 0 98 0 0
snipp...
20131216 14:50:27 0 0 0 20258788 232508 1552784 0 0 0 44 3801 3417 1 1 98 0 0
Add gc_stat
plugin configuration as belows. It shows that the heap_live_num
is increasing.
<source>
type gc_stat
tag debug.gc
</source>
<match debug.gc>
type stdout
</match>
cf. http://stackoverflow.com/questions/12634370/what-do-the-fields-of-rubys-gc-stat-mean
2013-12-16 15:11:20 +0900 debug.gc: {"count":66,"heap_used":11071,"heap_length":18772,"heap_increment":7701,"heap_live_num":3621800,"heap_free_num":901880,"heap_final_num":0}
2013-12-16 15:12:20 +0900 debug.gc: {"count":75,"heap_used":20573,"heap_length":36378,"heap_increment":15805,"heap_live_num":7089818,"heap_free_num":1316878,"heap_final_num":0}
2013-12-16 15:13:20 +0900 debug.gc: {"count":82,"heap_used":29525,"heap_length":53143,"heap_increment":23618,"heap_live_num":10773811,"heap_free_num":1292016,"heap_final_num":0}
Without rewrite
gc_stat
heap_live_num
does not increase.