javadmohebbi / goNfCollector

A set of tool to collect & analyze netflow & export them to many DBs & Apps like InfluxDB time-series DB
94 stars 20 forks source link

Extremely high memory usage #19

Open erwintwr2 opened 2 years ago

erwintwr2 commented 2 years ago

Extremely high memory usage was picked up (below is form shell inside nfcollector docker)

top - 08:33:15 up 3 days, 16:28, 0 users, load average: 7.95, 7.82, 6.31 Tasks: 3 total, 1 running, 2 sleeping, 0 stopped, 0 zombie %Cpu(s): 1.1 us, 1.7 sy, 0.0 ni, 31.4 id, 65.0 wa, 0.0 hi, 0.4 si, 0.5 st MiB Mem : 16042.3 total, 162.1 free, 15747.0 used, 133.2 buff/cache MiB Swap: 16384.0 total, 5856.8 free, 10527.2 used. 63.2 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 26.0g 14.4g 3084 S 5.3 91.6 21:34.26 nfcollector 23 root 20 0 4112 2256 1704 S 0.0 0.0 0:00.07 bash

sending two v5 netflow streams of maxinum 15mbps / 30 devices, thus i don't think it should overload this much

Please advise if any other data is required

javadmohebbi commented 2 years ago

Hi @erwintwr2,

Could you please let me know the netflow collector version?

Run two first command in case your containers are not running.

cd $HOME/oi24/nfcollector
docker-compose run -d 
docker exec oi24_nfcolector_1 /opt/nfcollector/bin/nfcollector -version

regards

mnesterovsky commented 2 years ago

I have the same issue, @javadmohebbi I'm receiving only two flows from two Cisco routers, Netflow version 9, just 2 interfaces on said routers are sending flows, and my RAM is currently climbing up upto almost 5.1Gb out of 7.27Gb RAM installed. Is there some way to avoid such a huge amount of RAM usage?

docker exec oi24-nfcolector-1 /opt/nfcollector/bin/nfcollector -version

'nfcollector' Version: v0.0.1-30b Build Date: Wed 27 Oct 2021 11:10:25 AM +0330

It seems that as time passes and collector is UP longer time, RAM usage keeps on going up, to the point i had to force reboot the server twice already.

Thanks in advance!!

mnesterovsky commented 2 years ago

Hello. Anyone managed to reduce or control High RAM usage? This is a TOP command:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 19034 root 20 0 5773892 3.5g 0 S 5.0 47.6 74:38.50 nfcollector 19074 user 20 0 21.6g 3.2g 316836 S 4.3 44.0 32:27.63 influxd

As you can see both goNfCollector and Influx are each consuming about 92% RAM by themselves, and in a few hours it will make the server crash. Is it there a way to free RAM or avoid such rapid increase? I've tried setting environment variables for Influx on Docker Compose to limit or disable logging, and reduce memory allocated to Queries, with no effect. I don't know if there's a way to set such variables for goNfCollector.

Thanks!

cyktsai commented 1 year ago

hi @javadmohebbi , I encounter the same issue. My netflow collector version is Version: v0.0.1-31b Build Date: Fri 18 Nov 2022 12:41:13 PM CST Please advise possible workaround or solution. Thx in advance!

alessskeno commented 1 year ago

@cyktsai Hi. Did you solve this issue? I have high CPU Usage problem.(Same nfcollector version: v.0.0.1-31b)

Pete920 commented 1 year ago

hi @javadmohebbi ,

Meet high memory issue also, almost 15G out of 16G, if there is any way to solve the issue?