The pfSense Store

Author Topic: SG-1000 High CPU Usage with Netstat Command?  (Read 419 times)

0 Members and 1 Guest are viewing this topic.

Offline TitanArchon

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
SG-1000 High CPU Usage with Netstat Command?
« on: November 01, 2017, 08:07:16 pm »
Very new to Pfsense so please dont flame me. Been searching for this and cant find anything i understand about it online anywhere. My CPU usage is 100 percent most of the time and the command doing it is /usr/bin/netstat -m and the /usr/bin/netstat -mb. Both of those start and stop off and on over and over, sometimes at the same time. They both consume whatever CPU is not being used and just keep dong it over and over. Anyone have any ideas as to why this is happening? I only have a NAS and some VMware hosts going through it with barely any traffic. Thanks for any help you all can provide.

Offline TitanArchon

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #1 on: November 02, 2017, 09:11:34 am »
Anyone have anything on this? I'll seriously take any advice/help i can. Thank you very much!

Offline KOM

  • Hero Member
  • *****
  • Posts: 5497
  • Karma: +680/-23
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #2 on: November 02, 2017, 10:29:03 am »
I don't have one of these and have no idea about the problem.  Which version of pfSense are you running?  Any packages installed?

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21486
  • Karma: +1456/-26
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #3 on: November 02, 2017, 02:55:39 pm »
We've had a couple reports of that and it's not clear why netstat is consuming so much on ARM, specifically on the SG-1000.

If you look in top, however, it will show bogus CPU percentages in some cases on ARM, and that's a known bug in FreeBSD.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline CryptoGnome

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #4 on: November 08, 2017, 08:18:10 am »
I've had a difficult time with the SG-1000's CPU usage as well. After a factory reset and update to latest version, it will run around 60%. If I try to install packages, it jumps to 100%. Would I be better off working with different hardware?

Offline hhash

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #5 on: December 23, 2017, 11:32:21 am »
On my sg-1000 netstat was taking 3-5 seconds, I tracked the issue down to the kldsym calls. Upstream already dealt with this here: https://reviews.freebsd.org/D12151

It has been MFC'd to 11-stable, but didn't make it in in time for 11.1-Release. Though it will be in a rebased or patched future version of pfsense.

With the above patch my netstat now takes .03 seconds. While the CPU usage reporting on ARM has other issues (I've seen top report 1600%+ use and I'm unclear how that makes sense for the sg-1000), the system is calling netstat -m all the time for statistics gathering purposes and without the above patch it negatively impacts performance when netstat is maxing out on kldsym calls for 3-5 seconds each time.

To use the above patch you'll probably have to cross compile for armv6 from another FreeBSD machine and copy the binary over. If you don't have such a setup and you trust me you can use mine here: http://files.realzer.net/~haven/pfsense/netstat-arm

Or better yet, now that the problem is understood and the resolution is straightforward, jimp could maybe build a more official netstat arm binary for interim use if it's getting you down.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21486
  • Karma: +1456/-26
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #6 on: December 27, 2017, 07:42:09 am »
https://redmine.pfsense.org/issues/8237

That patch is in 2.4.3 snapshots and it looks good to me, netstat is behaving much better.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline revengineer

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +4/-0
    • View Profile
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #7 on: December 30, 2017, 05:45:17 pm »
https://redmine.pfsense.org/issues/8237

That patch is in 2.4.3 snapshots and it looks good to me, netstat is behaving much better.
Any idea when this will be released? My Gold membership expires in 3 weeks and I wasted 80% of my membership in beta status. I realize I can always update from the dashboard, but I would like a well functioning image.

Offline ivor

  • Administrator
  • Hero Member
  • *****
  • Posts: 662
  • Karma: +141/-129
    • View Profile
    • Netgate
Re: SG-1000 High CPU Usage with Netstat Command?
« Reply #8 on: December 31, 2017, 05:01:49 am »
You will be able to download the image once it's ready.
Need help fast? Commercial support: https://www.netgate.com/support/