High CPU usage when downloading

Started by fox983, November 23, 2023, 08:56:32 PM

Previous topic - Next topic
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?


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.
OPNsense 24.7.7 running on:
Dell Optiplex 3050
Intel I5-7600 @ 3.5Ghz (4 Cores)
Intel I350-T4 Nic
8G DDR4
256G SSD


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%



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.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

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

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.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

Thank you for sharing this!
Maybe next year I will buy new hardware.
Regards