OPNsense Forum

English Forums => Hardware and Performance => Topic started by: l33tname on June 24, 2018, 03:45:06 pm

Title: CPU usage goes up
Post by: l33tname on June 24, 2018, 03:45:06 pm
If I remember correctly this is the 3 time this has happened. When I reboot my firewall not often enough
the CPU usage goes up to 30% instead of the normal 2-3%. As said this happend multiple times with
different versions of Opnsense. (See the attached picture)

Output of ps aux
Code: [Select]
root        11 290.8  0.0       0    64  -  RL   19May18 188596:11.13 [idle]
root     57359  14.9  0.4 1082604  7932  -  R    15:42        0:01.10 /sbin/pfctl -o basic -f /tmp/rules.debug
root        12   9.6  0.0       0   400  -  WL   19May18   1709:53.21 [intr]
root        16   5.8  0.0       0    16  -  DL   19May18    772:48.40 [pf purge]
root     53474   4.6  1.6  117756 31716  -  S    15:42        0:00.58 /usr/local/bin/php /usr/local/etc/rc.filter_configure
root     53391   1.6  0.5   43624 10280  -  S    15:42        0:00.12 /usr/local/bin/python2.7 /usr/local/opnsense/service/configd_ctl.py filter reload
root     28332   0.8  1.6  115708 30320  -  S    15:42        0:00.38 /usr/local/bin/php /usr/local/etc/rc.openvpn WAN_DHCP
root     42001   0.7  0.3 1085760  6396  -  Ss   15:42        0:00.01 /usr/local/sbin/openvpn --config /var/etc/openvpn/client1.conf
root     52183   0.7  0.2 1078888  3108  -  S    15:42        0:00.01 /bin/sh /usr/local/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown ovpnc2 1500 1560 172.16.2.2 172.16.2.1 init
root     81112   0.6  0.3 1085760  6408  -  Ss   15:42        0:00.48 /usr/local/sbin/openvpn --config /var/etc/openvpn/client2.conf
root         0   0.0  0.0       0   352  -  DLs  19May18      2:46.40 [kernel]
root         1   0.0  0.0    5040   904  -  SLs  19May18      0:09.44 /sbin/init --
root         2   0.0  0.0       0    16  -  DL   19May18      0:00.00 [crypto]
root         3   0.0  0.0       0    16  -  DL   19May18      0:00.00 [crypto returns]
root         4   0.0  0.0       0    32  -  DL   19May18      1:24.88 [cam]
root         5   0.0  0.0       0    16  -  DL   19May18      0:01.01 [soaiod1]
root         6   0.0  0.0       0    16  -  DL   19May18      0:01.01 [soaiod2]
root         7   0.0  0.0       0    16  -  DL   19May18      0:01.00 [soaiod3]
root         8   0.0  0.0       0    16  -  DL   19May18      0:00.99 [soaiod4]
root         9   0.0  0.0       0    16  -  DL   19May18      0:01.41 [sctp_iterator]
root        10   0.0  0.0       0    16  -  DL   19May18      0:00.00 [audit]
root        13   0.0  0.0       0    64  -  DL   19May18      0:00.00 [ng_queue]
root        14   0.0  0.0       0    48  -  DL   19May18      0:00.07 [geom]
root        15   0.0  0.0       0   240  -  DL   19May18      6:15.47 [usb]
root        17   0.0  0.0       0    16  -  DL   19May18     16:11.75 [rand_harvestq]
root        18   0.0  0.0       0    48  -  DL   19May18      1:28.42 [pagedaemon]
root        19   0.0  0.0       0    16  -  DL   19May18      0:00.00 [vmdaemon]
root        20   0.0  0.0       0    16  -  DL   19May18      0:00.10 [pagezero]
root        21   0.0  0.0       0    16  -  DL   19May18      0:28.44 [bufspacedaemon]
root        22   0.0  0.0       0    32  -  DL   19May18      1:52.68 [bufdaemon]
root        23   0.0  0.0       0    16  -  DL   19May18      0:25.36 [vnlru]
root        24   0.0  0.0       0    16  -  DL   19May18     31:27.93 [syncer]
root       453   0.0  0.3    9572  5108  -  Ss   19May18      1:14.02 /sbin/devd
root      2667   0.0  0.3 1085760  6408  -  Ss   15:42        0:00.01 /usr/local/sbin/openvpn --config /var/etc/openvpn/client3.conf
root      6200   0.0  0.1   10372  1968  -  Is    2Jun18      0:00.00 daemon: /usr/local/bin/telegraf[6298] (daemon)
root      6298   0.0  2.3   70428 43724  -  S     2Jun18    131:16.40 /usr/local/bin/telegraf -quiet -config=/usr/local/etc/telegraf.conf
root      7573   0.0  0.2 1076272  3020  -  Ss   19May18     20:27.83 /usr/local/sbin/syslogd -s -c -c -P /var/run/syslog.pid -l /var/dhcpd/var/run/log -f /var/etc/syslog.conf
root     10812   0.0  0.1   12500  2400  -  Is   19May18      1:08.22 /usr/sbin/cron -s
root     22842   0.0  0.2 1078888  3092  -  S    15:42        0:00.02 /bin/sh /usr/local/etc/rc.monitor WAN_DHCP
root     22990   0.0  0.5   43624 10276  -  S    15:42        0:00.12 /usr/local/bin/python2.7 /usr/local/opnsense/service/configd_ctl.py -m filter reload openvpn reload WAN_DHCP dyndns reload WAN_DHCP rfc2136
root     31274   0.0  0.1 1074072  2756  -  Ss   12Jun18      4:20.45 /usr/local/sbin/apinger -c /var/etc/apinger.conf
root     34507   0.0  1.1  104092 20264  -  Is   11:17        0:02.01 /usr/local/bin/python2.7 /usr/local/opnsense/service/configd.py
root     35035   0.0  1.6  137504 31152  -  S    11:17       45:27.27 /usr/local/bin/python2.7 /usr/local/opnsense/service/configd.py console
root     36585   0.0  0.4 1116956  6920  -  Is   15:06        0:00.06 sshd: l33tname [priv] (sshd)
l33tname 41375   0.0  0.4 1116956  6972  -  S    15:06        0:01.54 sshd: l33tname@pts/0 (sshd)
_dhcp    41861   0.0  0.2 1076336  3012  -  Ss   12Jun18      0:42.11 dhclient: igb0 (dhclient)
root     44386   0.0  0.2 1078472  2924  -  Ss   19May18     24:04.37 /usr/local/sbin/filterlog -i pflog0 -p /var/run/filterlog.pid
root     50095   0.0  0.1 1076200  2596  -  Ss   11:17        0:00.84 /usr/local/sbin/sshlockout_pf 15
root     52919   0.0  0.3 1092080  5736  -  Is   19May18      0:00.01 /usr/local/sbin/sshd
root     52986   0.0  0.4   48836  7312  -  S    11:17        0:02.46 /usr/local/sbin/lighttpd -f /var/etc/lighty-webConfigurator.conf
root     52989   0.0  1.4  111384 26496  -  Is   11:17        0:00.15 /usr/local/bin/php-cgi
root     53063   0.0  1.4  111384 26488  -  Is   11:17        0:00.15 /usr/local/bin/php-cgi
root     53935   0.0  0.2 1078888  2952  -  Is   11:17        0:07.65 /bin/sh /var/db/rrd/updaterrd.sh
root     54057   0.0  1.4  111384 26484  -  I    11:17        0:00.00 /usr/local/bin/php-cgi
root     54193   0.0  1.5  113564 29384  -  I    11:17        0:00.23 /usr/local/bin/php-cgi
root     54442   0.0  1.4  111384 26484  -  I    11:17        0:00.00 /usr/local/bin/php-cgi
root     54799   0.0  1.6  115868 31392  -  I    11:17        0:02.75 /usr/local/bin/php-cgi
root     54886   0.0  0.1 1074004  2376  -  I    15:41        0:00.01 sleep 60
root     54952   0.0  1.7  115868 32232  -  I    11:17        0:02.98 /usr/local/bin/php-cgi
root     55024   0.0  1.6  115868 31464  -  I    11:17        0:03.42 /usr/local/bin/php-cgi
dhcpd    68097   0.0  0.5 1082732  9320  -  Ss   12Jun18      1:17.70 /usr/local/sbin/dhcpd -user dhcpd -group dhcpd -chroot /var/dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid bridge0
root     71103   0.0  0.1 1076160  2772  -  I    12Jun18      0:23.07 /usr/local/sbin/radvd -p /var/run/radvd.pid -C /var/etc/radvd.conf -m syslog
root     86465   0.0  0.3 1075368  5920  -  Ss   12Jun18      6:33.12 /usr/local/sbin/ntpd -g -c /var/etc/ntpd.conf -p /var/run/ntpd.pid
root     87686   0.0  0.1 1076336  2872  -  Is   12Jun18      0:03.05 dhclient: igb0 [priv] (dhclient)
root     27758   0.0  0.1   10392  2036 u0  Is+  19May18      0:00.01 /usr/libexec/getty std.115200 ttyu0
l33tname 41427   0.0  0.2 1079308  4224  0  Is   15:06        0:00.04 -csh (csh)
root     58442   0.0  0.2 1084676  2988  0  R+   15:42        0:00.01 ps aux
root     64324   0.0  0.2   46368  3600  0  I    15:06        0:00.03 sudo -s
root     77493   0.0  0.2 1081356  4752  0  S    15:06        0:00.20 /bin/csh


Any idea why this happens? I reboot this thing often enough for new kernels and the hardware is fast enough so it's not a  problem, but it bothers me. :D


The hardware is a apu3a2 = 3 i211AT LAN / AMD GX-412TC CPU / 2 GB DRAM board.
https://www.pcengines.ch/apu3a2.htm
Title: Re: CPU usage goes up
Post by: marjohn56 on June 24, 2018, 04:07:15 pm
Could be many things, are you using a RAM drive for VAR and TMP?


Apinger can cause issues like that, try using dpinger.
Title: Re: CPU usage goes up
Post by: l33tname on June 24, 2018, 04:32:48 pm
Quote
Could be many things, are you using a RAM drive for VAR and TMP?
No it's all on ssd
Code: [Select]
/dev/gpt/rootfs on / (ufs, local, noatime, soft-updates)
devfs on /dev (devfs, local, multilabel)
devfs on /var/dhcpd/dev (devfs, local, multilabel)

Quote
Apinger can cause issues like that, try using dpinger.
So can I restart Apinger somehow and CPU usage should go back to normal?
Title: Re: CPU usage goes up
Post by: marjohn56 on June 24, 2018, 04:39:36 pm
It's worth stopping and restarting individual services to see if that's what's causing your issue. It may be logging, hence why I asked if you were using a RAM disk, try it and see if the problem goes away. To switch to dpinger you would need to be on 18.1.10
Title: Re: CPU usage goes up
Post by: l33tname on June 24, 2018, 04:49:53 pm
Quote
To switch to dpinger you would need to be on 18.1.10
OPNsense 18.1.10-amd64  :D

Restarting apinger brought it down to 3% again. So how can I switch to dpinger?
Title: Re: CPU usage goes up
Post by: phoenix on June 24, 2018, 04:58:44 pm
Restarting apinger brought it down to 3% again. So how can I switch to dpinger?
Firewall/Settings/Advanced/Monitoring daemon setting it to be the preferred daemon.
Title: Re: CPU usage goes up
Post by: l33tname on June 24, 2018, 05:08:05 pm
Very convenient! I will update this thread if I run in the same problem again.