Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [SOLVED]egrep used lots of CPU,what did it grep ?

    Scheduled Pinned Locked Moved General pfSense Questions
    24 Posts 2 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      Ok so replacing egrep with ripgrep seems to work fine and should be significantly faster. However I'm only able to test with a relatively small number of states.

      If you're able to test it install the ripgrep pkg:

      pkg install ripgrep
      

      Then edit /etc/inc/rrd.inc and replace the 5 instances of egrep with rg

      I'll keep testing that here.

      Steve

      insmodI 1 Reply Last reply Reply Quote 0
      • insmodI
        insmod @stephenw10
        last edited by insmod

        @stephenw10

        perl -p -i -e 's/egrep/rg/g' /var/db/rrd/updaterrd.sh /etc/inc/rrd.inc
        

        I kill and restart the updaterrd.sh.

        The rg still cost lots of CPU every minus.

        [23.05-RELEASE][root@GW.Tel]/tmp: wc -l pfctl_ss_out
        162234 pfctl_ss_out

        stat.png

        rg.png

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          But for a shorter time?

          Did he updater script get re-written? It would if you make any changes to the graph settings.

          insmodI 1 Reply Last reply Reply Quote 0
          • insmodI
            insmod @stephenw10
            last edited by

            @stephenw10

            But for a shorter time?
            Yes,so if I did not use netdata to monitor the system very minus,I can not find it in the "top" command.

            Did he updater script get re-written? It would if you make any changes to the graph settings.
            I did not "save view",just update graph.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.