High CPU usage 'pkg' - 2.3.2-RELEASE (amd64) nanoBSD
-
Hello,
I've got pfSense running on a HP MicroServer Gen8 with 4 GB RAM off a 2GB USB disk (2gb nanobsd image).
It's been running smoothly for about a month now then suddenly yesterday warnings start going off at the NOC saying the CPU usage is too high. It appears to have started out of the blue.
Top is showing this:
last pid: 97939; load averages: 1.01, 1.02, 1.00 up 0+03:06:45 10:57:07 48 processes: 2 running, 46 sleeping CPU: 35.2% user, 0.0% nice, 15.2% system, 0.2% interrupt, 49.4% idle Mem: 29M Active, 108M Inact, 146M Wired, 1048K Cache, 101M Buf, 1643M Free Swap: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 50694 root 1 103 0 45180K 9008K CPU0 0 78:29 100.00% pkg 43588 root 1 20 0 75012K 29748K select 1 0:10 0.49% bsnmpd 54647 root 1 20 0 21856K 2988K CPU1 1 0:03 0.00% top 9716 root 1 52 20 17000K 2568K wait 1 0:01 0.00% sh 5165 dhcpd 1 20 0 24816K 12952K select 1 0:01 0.00% dhcpd 29961 root 1 20 0 39136K 6992K kqread 0 0:01 0.00% nginx 29980 root 1 20 0 39136K 6908K kqread 1 0:01 0.00% nginx 30311 root 1 20 0 39136K 7136K kqread 0 0:01 0.00% nginx 34478 nobody 1 20 0 30188K 4216K select 1 0:01 0.00% dnsmasq 845 root 5 20 0 15012K 2292K accept 1 0:01 0.00% dpinger 496 root 5 20 0 15012K 2292K accept 1 0:01 0.00% dpinger 71159 root 1 20 0 14516K 2304K select 0 0:01 0.00% syslogd 22655 root 1 20 0 16676K 2172K bpf 1 0:01 0.00% filterlog 29987 root 1 20 0 39136K 6868K kqread 0 0:01 0.00% nginx 300 root 1 20 0 262M 25200K kqread 0 0:01 0.00% php-fpm 42839 root 1 45 0 279M 38016K piperd 0 0:00 0.00% php-fpm 74742 root 1 20 0 63736K 7252K select 1 0:00 0.00% sshd 33102 root 1 20 0 30140K 17968K select 1 0:00 0.00% ntpd 6949 root 1 20 0 50312K 6892K select 0 0:00 0.00% mpd5 16807 root 1 20 0 50312K 6908K select 0 0:00 0.00% mpd5 12790 root 2 35 0 275M 32932K uwrlck 0 0:00 0.00% php-fpm 43614 root 17 20 0 217M 13644K select 1 0:00 0.00% charon 39989 root 1 20 0 14400K 2172K select 0 0:00 0.00% radvd 64017 root 1 20 0 262M 33828K accept 1 0:00 0.00% php-fpm 374 root 1 20 0 13624K 4780K select 1 0:00 0.00% devd 31043 root 1 20 0 16532K 2084K nanslp 0 0:00 0.00% cron 50507 root 1 47 0 45180K 7720K wait 1 0:00 0.00% pkg 53865 root 1 48 0 17340K 3392K pause 0 0:00 0.00% tcsh 89281 root 1 52 0 43440K 2596K wait 1 0:00 0.00% login 356 root 1 40 20 18888K 2396K kqread 0 0:00 0.00% check_reload_status 89600 root 1 52 0 17000K 2644K wait 0 0:00 0.00% sh 75116 root 1 32 0 17000K 2644K wait 1 0:00 0.00% sh 89374 root 2 20 0 14612K 2180K nanslp 0 0:00 0.00% sshlockout_pf 43363 root 1 20 0 30388K 3540K select 0 0:00 0.00% starter 8790 root 2 20 0 14612K 2056K nanslp 1 0:00 0.00% sshlockout_pf 75381 root 1 22 0 17000K 2540K wait 0 0:00 0.00% sh 72511 root 1 52 0 12268K 1884K nanslp 1 0:00 0.00% minicron 89797 root 1 52 0 17000K 2532K ttyin 1 0:00 0.00% sh 22951 root 1 20 0 18896K 2364K select 0 0:00 0.00% xinetd 8333 root 1 20 0 59068K 6444K select 1 0:00 0.00% sshd 29778 root 1 52 0 39136K 6008K pause 0 0:00 0.00% nginx 97939 root 1 52 20 8168K 1824K nanslp 1 0:00 0.00% sleep 72293 root 1 52 0 12268K 1872K wait 0 0:00 0.00% minicron 73216 root 1 20 0 12268K 1884K nanslp 1 0:00 0.00% minicron 73548 root 1 52 0 12268K 1872K wait 0 0:00 0.00% minicron 72704 root 1 52 0 12268K 1872K wait 1 0:00 0.00% minicron 357 root 1 52 20 18888K 2252K kqread 0 0:00 0.00% check_reload_status 73710 root 1 52 0 12268K 1884K nanslp 0 0:00 0.00% minicron
If I kill the pkg command it comes back straight away. A reboot has been of no help either, cpu usage goes up as soon as the system boots up.
Additionally, on the dashboard, I have noticed that it says "Unable to check for updates". I have ensured my DNS servers and gateways are set properly so I'm at a loss as to why this is happening.
Any ideas on what this is? Other than the high CPU usage and inability to check for updates, everything is fine.
-
You need to fix the "Unable to check for updates" issue. Otherwise, pkg will be trying over and over again in case it needs to contact the repo.
-
Ok, I just thought I'd mention - this is fixed now (Through no intervention on my part).
It looks like this may have been a transient network issue.
I checked all the basics that lead to an inability to check for updates (i.e. default gateway set incorrectly, DNS servers not reachable/responding etc) to no avail, but it just came right today.
-
First: Ditch NanoBSD. It's not doing you any favors and it has been removed from pfSense 2.4.
Second: Disable the dashboard update check (System > Update, settings tab) and also if you have the packages widget active, remove it.