High CPU Usage after upgrading to 22.05
-
There was an issue with it, I spoke to the developer and they provided the following solution.
https://www.reddit.com/r/pfBlockerNG/comments/v7zp72/ip_block_logging_not_working_in_2205_plus_release/
-
Known issue with a simple fix.
-
Hi all, I have applied the fix referenced above but I still have 30-40% CPU usage at an i3 with 3.7GHz. With the previous version 22.01 the CPU usage was typically below 10%.
Could there be an additional issue?
Thanks, Mike -
I can confirm I saw the issue with pfBlocker and was able to fix it by following this patch (already linked via posts above):
https://redmine.pfsense.org/issues/13154sI guess I don't need to say what time I performed the fix. (I needed to restart pfBlocker after doing it)
-
@mike-moon said in High CPU Usage after upgrading to 22.05:
Hi all, I have applied the fix referenced above but I still have 30-40% CPU usage at an i3 with 3.7GHz. With the previous version 22.01 the CPU usage was typically below 10%.
Could there be an additional issue?
Thanks, MikeSorry, I made a mistake when applying the fix: I removed the bracket between the two quotes but did not replace that bracket by a space as required. After correcting this the CPU usage jumped down and the core temperatures decreased about 10 degrees. So everything is fine.
Mike -
Hi,
Upgraded the first firewall to 22.05, but I'm not experiencing high cpu load by pfblockerng.
has this issue already been fixed in a new package release?/usr/local/pkg/pfblockerng/pfblockerng.inc on line 4139 at my install:
foreach ($list_type as $ip_type => $vtype) { if (!empty($config['installedpackages'][$ip_type]['config'])) { foreach ($config['installedpackages'][$ip_type]['config'] as $key => $list) { if (!is_array($list)) { $list = array(); } if (!is_array($list['row'])) { $list['row'] = array(); } if ($vtype == '_v4') { $list['vtype'] = '_v4'; } else { $list['vtype'] = '_v6'; } // Collect list array key location $list['key'] = "{$key}"; // If only the 'customlist' is defined. Remove the 'List row' data. if (empty($list['row'][0]['url'])) { unset($list['row']); }
-
@tohil said in High CPU Usage after upgrading to 22.05:
/usr/local/pkg/pfblockerng/pfblockerng.inc on line 4139 at my install:
Maybe your Texteditor is counting wrong:
Here at line 4139 is "$r = explode(' ', $result, 2);"
-
@fireodo said in High CPU Usage after upgrading to 22.05:
$r = explode(' ', $result, 2)
Hi
I'm using vi and jump to:4139
I even cannot find that line....
vi /usr/local/pkg/pfblockerng/pfblockerng.inc -
@tohil said in High CPU Usage after upgrading to 22.05:
@fireodo said in High CPU Usage after upgrading to 22.05:
$r = explode(' ', $result, 2)
Hi
I'm using vi and jump to:4139
I even cannot find that line....
vi /usr/local/pkg/pfblockerng/pfblockerng.inc
If you trust me:
pfblockerng.txt
You have to change the .txt to .inc
Changes are allready made - you can replace the file directly. -
@fireodo
Okay, now its going kind of weird. I've compared my file (putty.log) with your text...
it seems like the file version is not the same....
-
@tohil
Hmmm,I have here pfblocker 3.1.0_4 devel and this pfblocker.inc file
-
@fireodo
I have pfBlocker 2.1.4_27Is this issue just with dev version?
Checked the bugtracker entry:I'm running this on 22.01-Release and this was CPU load was not occurring prior to 3.1.0.4.
So everyone not using pfBlockerNG higher than 3.1.04 will be affected...
-
@tohil said in High CPU Usage after upgrading to 22.05:
@fireodo
I have pfBlocker 2.1.4_27Is this issue just with dev version?
Ooooh - in this case the file is NOT for this old Version!!! But the problem is the same the line number must be in this old version different - I suggest to upgrade to the devel version wich is actually maintained! But its in the end your decision!
Edit: If you find in your pfblocker .inc
$r = explode(')', $result, 2);
then you should replace it with:
$r = explode(' ', $result, 2);
-
@fireodo
https://forum.netgate.com/topic/156604/pfblockerng-vs-pfblockerng-devel/7https://forum.netgate.com/topic/172036/solved-pfblocker-stable-vs-devel/3
It seems I have to update and go to the devel version on all my installs...
-
@tohil said in High CPU Usage after upgrading to 22.05:
@fireodo
https://forum.netgate.com/topic/156604/pfblockerng-vs-pfblockerng-devel/7It seems I have to update and go to the devel version on all my installs...
That would (from my point of view) be a good move ...
(as far I recall, there should be no problems and all your settings are preserved - but BACKUP is allways recommended ) -
@mike-moon said in High CPU Usage after upgrading to 22.05:
I removed the bracket between the two quotes but did not replace that bracket by a space as required
I made the same mistake doing the patch by hand - hehehe
Yup what a difference.
I was thinking that "fix" didn't seem to do much.. Then as you can see from graph after putting in the space between the 's cpu util dropped off to normal, and yup did see a couple of degrees difference in the temp as well.
-
@johnpoz Johnpoz, can you give a "how to for idiots" on changing the script?
I've never changed the script file and not sure how to do it e.g. What software (Putty?/Text Editor, etc) and where do I go to change it.Sorry, I'm a newbie at this.
-
@frankzappa
Hiconnect to your pfsense via putty.
enter the following
vi /usr/local/pkg/pfblockerng/pfblockerng.inc
Then press "ESC" followed by ":" enter line number 4139
cursor jumps to the line.
go to the part to change, like the e of explode. press ESX followed by x. this removes char by char. delete all behind the e until then ;
$r = ;
then copy the new part
explode(' ', $result, 2)
Press ESC and I
then paste it with right click.
ESC / wq to save
reboot
hope this helps
-
Just do it from the pfSense GUI.
In the Diagnostics menu, go to Edit File
Type (or copy/paste) /usr/local/pkg/pfblockerng/pfblockerng.inc into the "Path of file to be edited" box and click "Load"
Type 4139 in the "Go to line #" box just below that and to the right, then click the button.
Make the edit (change the '?' to ' ' ensuring to make a space between the single quotes)
Click the "Save" button.
-
@sretalla Thanks folks, that seemed to work (using Edit File from GUI). Didn't know there was a GUI option to do that (although I'm familiar with Putty as well). Thanks for the help.