Hi, I'm trying to setup Beats for a new application, and Beats crashes after a few minutes of running, before any logs are even sent to Kafka.
The log file I'm reading from is pretty huge (32GB) and I think the problem is that Filebeat is attempting to load the whole file into memory. I can see the memory footprint of the filebeat process growing, until it fails with:
fatal error: runtime: out of memory
runtime stack:
runtime.throw(0x16eacd5, 0x16)
/usr/local/go/src/runtime/panic.go:616 +0x81
runtime.sysMap(0xcc696f0000, 0x223f80000, 0x20f4d00, 0x210e078)
/usr/local/go/src/runtime/mem_linux.go:216 +0x20a
runtime.(*mheap).sysAlloc(0x20f4500, 0x223f80000, 0x0)
/usr/local/go/src/runtime/malloc.go:470 +0xd4
runtime.(*mheap).grow(0x20f4500, 0x111fbe, 0x0)
/usr/local/go/src/runtime/mheap.go:907 +0x60
runtime.(*mheap).allocSpanLocked(0x20f4500, 0x111fbe, 0x210e088, 0x7f8ee3ffed48)
/usr/local/go/src/runtime/mheap.go:820 +0x301
runtime.(*mheap).alloc_m(0x20f4500, 0x111fbe, 0x9e0101, 0xc41d3fb7ff)
/usr/local/go/src/runtime/mheap.go:686 +0x118
runtime.(*mheap).alloc.func1()
/usr/local/go/src/runtime/mheap.go:753 +0x4d
runtime.(*mheap).alloc(0x20f4500, 0x111fbe, 0x7f8ee3000101, 0x7f8ee3ffee10)
/usr/local/go/src/runtime/mheap.go:752 +0x8a
runtime.largeAlloc(0x223f7c000, 0x7f8ee3ff0100, 0x7ffc40dbda67)
/usr/local/go/src/runtime/malloc.go:826 +0x94
runtime.mallocgc.func1()
/usr/local/go/src/runtime/malloc.go:721 +0x46
runtime.systemstack(0x0)
/usr/local/go/src/runtime/asm_amd64.s:409 +0x79
runtime.mstart()
/usr/local/go/src/runtime/proc.go:1175
While I realise this is being called by a huge logfile, does beats have any intelligent handling for large files? ie, read a 100MB buffer, send the logs, discard the buffer, read the next set of lines?