OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: fox983 on November 23, 2023, 08:56:32 PM

Title: High CPU usage when downloading
Post by: fox983 on November 23, 2023, 08:56:32 PM
Hi all,
when downloading big files from internet the firewall's CPU goes to 90 - 100% on APU2C4 (with Intel network cards).

SYSTEM: DIAGNOSTICS: ACTIVITY
root   93   0   43M   28M   CPU2   2   795:57   76.86%   /usr/local/bin/python3 /usr/local/opnsense/scripts/netflow/flowd_aggregate.py (python3.9)

I've read many topic (eg. https://forum.opnsense.org/index.php?topic=31999.0), tried to clear logs and disable Netflow but no luck.
Any ideas?
Title: Re: High CPU usage when downloading
Post by: dMopp on November 24, 2023, 10:14:07 PM
Hardware offload active ?
Title: Re: High CPU usage when downloading
Post by: axsdenied on November 25, 2023, 03:20:00 AM
If you're not experience any performance issues, I'd just leave it alone.  If this isn't the norm for you and something has changed, we'll need more data to help diagnose.
Title: Re: High CPU usage when downloading
Post by: fox983 on November 25, 2023, 03:30:32 PM
Quote from: dMopp on November 24, 2023, 10:14:07 PM
Hardware offload active ?
No
Title: Re: High CPU usage when downloading
Post by: fox983 on November 25, 2023, 03:45:06 PM
Quote from: axsdenied on November 25, 2023, 03:20:00 AM
If you're not experience any performance issues, I'd just leave it alone.  If this isn't the norm for you and something has changed, we'll need more data to help diagnose.
It happens mostly with torrents, I'm trying to download 4 Linux Mint and the CPU usage is at 100%
Title: Re: High CPU usage when downloading
Post by: doktornotor on November 25, 2023, 07:07:53 PM
Get some better HW, or move on.
Title: Re: High CPU usage when downloading
Post by: fox983 on November 26, 2023, 07:38:58 PM
 :)
Title: Re: High CPU usage when downloading
Post by: Seimus on November 29, 2023, 10:08:13 AM
Quote from: fox983 on November 23, 2023, 08:56:32 PM
Hi all,
when downloading big files from internet the firewall's CPU goes to 90 - 100% on APU2C4 (with Intel network cards).

SYSTEM: DIAGNOSTICS: ACTIVITY
root   93   0   43M   28M   CPU2   2   795:57   76.86%   /usr/local/bin/python3 /usr/local/opnsense/scripts/netflow/flowd_aggregate.py (python3.9)

I've read many topic (eg. https://forum.opnsense.org/index.php?topic=31999.0), tried to clear logs and disable Netflow but no luck.
Any ideas?

"when downloading big files from internet"

Whats your throughput?
APU uses really very very very old SOC (I have one APU at home) and I can tell you such behaviors are kinda now normal on that SOC and more prominent the more throughput + features configured you have.

APU performs OK with OPNsense at 200Mbit/s with around 6VLANs + Shaper + basic rules. Anything above that and you will see performance degradation.

Regards,
S.
Title: Re: High CPU usage when downloading
Post by: fox983 on December 02, 2023, 10:19:12 PM
Quote from: Seimus on November 29, 2023, 10:08:13 AM
Quote from: fox983 on November 23, 2023, 08:56:32 PM
Hi all,
when downloading big files from internet the firewall's CPU goes to 90 - 100% on APU2C4 (with Intel network cards).

SYSTEM: DIAGNOSTICS: ACTIVITY
root   93   0   43M   28M   CPU2   2   795:57   76.86%   /usr/local/bin/python3 /usr/local/opnsense/scripts/netflow/flowd_aggregate.py (python3.9)

I've read many topic (eg. https://forum.opnsense.org/index.php?topic=31999.0), tried to clear logs and disable Netflow but no luck.
Any ideas?

"when downloading big files from internet"

Whats your throughput?
APU uses really very very very old SOC (I have one APU at home) and I can tell you such behaviors are kinda now normal on that SOC and more prominent the more throughput + features configured you have.

APU performs OK with OPNsense at 200Mbit/s with around 6VLANs + Shaper + basic rules. Anything above that and you will see performance degradation.

Regards,
S.

My throughput is about 170Mbit/s, 2 VLANs, Shaper, Monit, Wireguard and 15/20 rules. In your signature you have APU2D2, mine is APU2C4. So do you think this is normal behavior?
Thank you
Title: Re: High CPU usage when downloading
Post by: Seimus on December 05, 2023, 12:32:56 PM
APU2D2 and C4 are having the exact same SOC, differences are mostly in NIC and onboard features. I would say this is normal. Shaper is CPU hungry. If you need to Shape the more BW you have the more the Shaper will ask to eat for example. Monit as an example is another resource drainer similiar to shaper the more you push the more you need to give him.

Try to disable Shaper and Monit and you should see APu is performing bit better.

When I was doing testing on APU with iperf interVLAN I has able to get on 50 parallel streams around 500-650Mbit (700-800 if I did some tuning) at MAX without shaping, but at the cost of CPU at 100% and 15.5 load cycles per 5s interval. This was done using 2 VLANs and 2 simple rules each per interface.

In year 2023 if we are using APUs, we need to be more modest on which feature to use.

Another points is APUs will be discontinued as announced by the manufacturer.

APUs are great devices, but they long outlived they usefulness for modern Network devices the more BW you have the more performance issues are prominent. That was as well the reason I switched to a newer SOC. I need to be able reach the BW provided by ma ISP yet I need to have all my features implemented working correctly.

Regards,
S.
Title: Re: High CPU usage when downloading
Post by: fox983 on December 09, 2023, 10:42:25 PM
Thank you for sharing this!
Maybe next year I will buy new hardware.
Regards