Bug 246929 - net/ntopng: High CPU usage after update to v4
Summary: net/ntopng: High CPU usage after update to v4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-02 04:26 UTC by Michael Muenz
Modified: 2020-06-15 20:08 UTC (History)
0 users

See Also:
madpilot: maintainer-feedback+


Attachments
ntopng-devel (187.69 KB, text/plain)
2020-06-11 18:11 UTC, Michael Muenz
no flags Details
Fix for excessive CPU usage (5.20 KB, patch)
2020-06-14 09:09 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Muenz 2020-06-02 04:26:33 UTC
Hi,

as discussed with zeising@ here [1] I create a separate issue regarding high CPU usage after updating to ntopng from v3 to v4. We have several reports from OPNsense users and it's reproducable when swithing back and forth the version.

I already reported the problem upstream here [2] and here [3], but a quick fix still doesn't work. 

Maybe other here can share their thought or maybe help diagnosing the problem.


Best,
Michael

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246896#c5
[2] https://lists.gt.net/ntop/users/49258
[3] https://github.com/ntop/ntopng/commit/607ba52263830c577e7b37c8c25320e60466a5f6
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2020-06-02 08:21:56 UTC
(In reply to Michael Muenz from comment #0)

Thanks for the report!

> as discussed with zeising@ here [1] I create a separate issue regarding high CPU 

I need to correct you, zeising was not involved, you discussed with madpilot@
Comment 2 Michael Muenz 2020-06-02 17:28:24 UTC
Sorry, I was working on two issues at the same time, thought I had enough coffee :)
Comment 3 Michael Muenz 2020-06-11 06:49:32 UTC
I build a new port ntopng-devel with latest dev-branch commit.
Now the CPU is smooth again, but I cant build via poudriere:

autoreconf-2.69: 'configure.ac' or 'configure.in' is required
*** Error code 1

When I build the pkg via /usr/ports it builds fine.
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2020-06-11 07:28:33 UTC
(In reply to Michael Muenz from comment #3)

Thanks for the testing!

I'll take a look and try to cook an update to the port.
Comment 5 Michael Muenz 2020-06-11 18:11:08 UTC
Created attachment 215461 [details]
ntopng-devel
Comment 6 Michael Muenz 2020-06-11 18:12:06 UTC
I added a shar with my testings. make package in ports runs fine and builds a clean package, but poudriere seems to be missing something.
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2020-06-12 17:51:53 UTC
(In reply to Michael Muenz from comment #6)

I have tested the update and it works fine here in poudriere.
Not sure what is happening on your machine.

Do you have any local changes or custom configuration that could interfere?
Comment 8 Guido Falsi freebsd_committer freebsd_triage 2020-06-12 17:58:33 UTC
Also, a quick test shows ntopng still having an high load with commit a020c6e.

You are testing a commit from head. I'd avoid moving the port to head.

We should identify which upstream commit actually fixes it.
Comment 9 Michael Muenz 2020-06-12 18:38:47 UTC
Yes, as I previously said, I created a devel port with latest commit from dev-branch since they asked me to test if this still occurs in devel tree:

https://github.com/ntop/ntopng/commit/607ba52263830c577e7b37c8c25320e60466a5f6#commitcomment-39827268

I don't think they will backport the fix since they are not aware which commit fixed it. :/
Comment 10 Guido Falsi freebsd_committer freebsd_triage 2020-06-14 09:09:15 UTC
Created attachment 215537 [details]
Fix for excessive CPU usage

Hi,

After some testing I think I identified the upstream fix in the dev branch.

I'm attaching a patch to the current port applying the fix. It did fix the 100% CPU usage for me in some quick testing.

Could you test this and report if it fixes the issue for you too?

I'm also filing this as a pull request upstream shortly.
Comment 11 Guido Falsi freebsd_committer freebsd_triage 2020-06-14 09:19:04 UTC
Upstream pull request:

https://github.com/ntop/ntopng/pull/4039
Comment 12 commit-hook freebsd_committer freebsd_triage 2020-06-15 17:49:05 UTC
A commit references this bug:

Author: madpilot
Date: Mon Jun 15 17:48:51 UTC 2020
New revision: 538924
URL: https://svnweb.freebsd.org/changeset/ports/538924

Log:
  - Update ntopng to latest upstream commit

  This includes a fix for high CPU usage

  PR:		246929
  Submitted by:	Michael Muenz <m.muenz@gmail.com>

Changes:
  head/net/ntopng/Makefile
  head/net/ntopng/distinfo
Comment 13 Guido Falsi freebsd_committer freebsd_triage 2020-06-15 17:50:33 UTC
The fix has been included upstream, and I updated the port to the latest upstream commit, so this should be really fixed now.

Thanks for reporting!
Comment 14 Michael Muenz 2020-06-15 20:08:56 UTC
Sorry, I didn't find the time today applying the patch. 
I just updated latest portstree and build fine in poudriere, CPU runs super-smooth. Thanks for you time :)