Project

General

Profile

Bug #9079

High CPU usage of ntopng even during IDLE and no network traffic

Added by Hannes W. 3 months ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
ntop
Target version:
-
Start date:
10/30/2018
Due date:
% Done:

0%

Estimated time:
Affected Version:
2.4.4
Affected Architecture:

Description

With pfSense version 2.4.4 and the usage of ntopng package the CPU is constantly on a high load.
Reducing ntopng tasks does not help, nor restriction to LAN interface and network only:

Startup line: ntopng --data-dir "/var/db/ntopng" --pid "/var/run/ntopng.pid" --dont-change-user --daemon --http-port "0" --https-port "3000" --interface "igb0" --dns-mode "0" --local-networks "10.21.30.0/24"

Even with no network traffic at all the CPU usage is around 5-10% in IDLE with an AMD GX-424CC Quad Core CPU and 8 GB Ram on bare metal and changing from second to second while keeping high load. Intel i350-T4 V2 card, 1 LAN, 1 WAN with latest ntopng Package running: 0.8.13_1 = 3.4.180911

Other CPU intense services like snort consume less than 0.3% in IDLE.

According to other users they have the same issue:

https://forum.netgate.com/topic/137144/high-cpu-usage-ntopng-package-even-on-idle

History

#1 Updated by Hannes W. 3 months ago

TOP shows that the ntopng process is in the only one in nanslp (nanosleep) mode if this helps.

#2 Updated by Jim Pingle 3 months ago

  • Target version deleted (2.4.4_1)

It's not clear there is anything we can do at all here. This is most likely an issue in ntopng itself, not something specific to pfSense or the package.

Try to reproduce it on a stock FreeBSD 11.2 setup with ntopng. If it's still a problem there, report it to ntopng and maybe the FreeBSD port maintainer.

#3 Updated by Joshua Sign about 1 month ago

I use ntop and didn't notice this problem.
Maybe some ntop options can cause more cpu usage...

I use Pfsense 2.4.4-RELEASE-p1 (amd64)
on Intel(R) Xeon(R) CPU E5606 @ 2.13GHz - 4 CPUs: 1 package(s) x 4 core(s)
with 16Go RAM

Here is un exemple of CPU usage by top during 30 seconds (1 line by second) for my ntopng process :

72614 root          24  20    0   167M   121M nanslp  3  21:49   1.27% ntopng
72614 root          24  20    0   167M   121M nanslp  3  21:49   0.98% ntopng
72614 root          24  20    0   167M   121M nanslp  3  21:49   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  3  21:49   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.98% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.78% ntopng
72614 root          24  20    0   168M   122M nanslp  1  21:49   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:49   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:50   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:50   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:50   0.88% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:50   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  1  21:50   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  2  21:50   0.98% ntopng
72614 root          24  20    0   167M   121M nanslp  2  21:50   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  2  21:50   0.59% ntopng
72614 root          24  20    0   167M   121M nanslp  2  21:50   0.78% ntopng
72614 root          24  20    0   167M   121M nanslp  0  21:50   0.68% ntopng
72614 root          24  20    0   167M   121M nanslp  0  21:50   0.78% ntopng

You can try to check your cpu usage with this little script i just wrote :

#!/bin/sh

if [ -z $1 ]; then
        echo "Usage : $0 process_name [duration]" 
        echo "  Default duration is 30 seconds" 
        exit 1
fi

duration=30

if [ -z $2 ]; then
        duration=30
else
        duration=$2
fi

echo "Create new log_process.txt file" 
echo -n > log_process.txt

echo "Recording usage of process $1 for $duration seconds, please wait..." 
for i in `seq 1 $duration`; do
        top -b | grep $1 >> log_process.txt
        sleep 1
done

echo "You can check the log_process.txt file" 

Put it in the /root directory and dont forget to chmod 755.

#4 Updated by Hannes W. about 1 month ago

Thanks for the script. Since version 2.4.4-p1 with the new version of ntopng the CPU idle usage did improve:
(weaker CPU than your Xeon so almost the same):

25551 root 24 20 0 163M 120M nanslp 2 60:15 5.32% ntopng
25551 root 24 20 0 163M 120M nanslp 2 60:15 4.54% ntopng
25551 root 24 20 0 163M 120M nanslp 2 60:15 4.15% ntopng
25551 root 24 20 0 163M 120M nanslp 2 60:15 4.54% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:15 3.96% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:15 4.25% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:15 4.64% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:15 4.15% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:15 3.66% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:15 5.13% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:15 4.44% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:15 3.96% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:15 4.35% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:15 3.76% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:16 4.15% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:16 4.54% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:16 4.15% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:16 3.56% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:16 4.15% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:16 4.35% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:16 3.76% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:16 4.35% ntopng
25551 root 24 20 0 163M 120M nanslp 1 60:16 3.86% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:16 3.27% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:16 4.64% ntopng
25551 root 24 20 0 163M 120M nanslp 3 60:16 4.05% ntopng
25551 root 24 20 0 163M 121M nanslp 3 60:16 3.56% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:16 3.96% ntopng
25551 root 24 20 0 163M 120M nanslp 0 60:16 3.37% ntopng
25551 root 24 20 0 164M 122M nanslp 0 60:17 4.64% ntopng

Also available in: Atom PDF