1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

High CPU Usage is back

Discussion in 'Asuswrt-Merlin' started by TheLyppardMan, Feb 27, 2020.

  1. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    I've tried rebooting my RT-AC86U, but the high CPU usage problem persists. I've also tried disabling AiProtection and rebooting, as I had heard that might be relevant to the problem, but it didn't seem to make any difference. Here's the syslog since the reboot:-
    I tried to upload the syslog file since the reboot as a text file but it wouldn't work and when I tried pasting in the text here, my post was blocked.
     

    Attached Files:

  2. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
  3. dave14305

    dave14305 Part of the Furniture

    Joined:
    May 19, 2018
    Messages:
    2,441
    Location:
    USA
    I would speculate that uiDivStats is causing your CPU issues once your dnsmasq.log files reach a certain size. They get reset to 0 on Saturday mornings, so things might work well for the first few days of the week, depending on your DNS activity/volume. Not a fault of uiDivStats, just a function of your network.

    I could be wrong since a syslog doesn’t tell anything about CPU usage. Output from top when you have high CPU usage is required to really get to the root cause.
     
    L&LD likes this.
  4. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    Sorry Dave but I don't know what you mean by "Output from top"; could you or someone else explain?
     
  5. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    It's even worse now...
     

    Attached Files:

  6. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
  7. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    Well I've disabled Diversion and everything has now returned to normal.
     

    Attached Files:

  8. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    11,540
    I would perhaps try a different/faster USB drive.

    Except for the first few minutes and after a reboot, I have not seen that on a variety of Asus routers.
     
  9. EmeraldDeer

    EmeraldDeer Very Senior Member

    Joined:
    Dec 22, 2017
    Messages:
    636
    Location:
    Massachusetts
    Maybe count ads runs only when stats are enabled. If you did not need stats, then maybe you could still have Diversion.

    I have stats enabled and use uiDivStats. My Entware drive is a Samsung T5. I do notice CPU utilization from time to time, but only for a few seconds. I also have log-queries=extra enabled. My /opt/var/log/dnsmasq.log are between 3 and 40 MB.

    Edit: You have an RT-AC86U which has a powerful CPU, so this is puzzling.
     
    Last edited: Feb 27, 2020
  10. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    I'm puzzled because when I view the CPU usage via xShell, I don't see anywhere near the 100% spikes that the GUI is showing from time to time. By the way, this is with Diversion running but uiDivStats uninstalled.
     

    Attached Files:

  11. dave14305

    dave14305 Part of the Furniture

    Joined:
    May 19, 2018
    Messages:
    2,441
    Location:
    USA
    Your top data showed more system CPU utilization than user utilization. So you really have to look at your idle percentage to see the inverse of the GUI info.
     
  12. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    Sorry Dave, but I don't fully understand what I need to do. What is the "idle percentage" you are referring to, where do I find it and with what do I compare it? Also, I still don't understand why the CPU usage when viewed through scMerlin differs so much from the CPU usage displayed in the GUI.
     
  13. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    I've just checked and I don't see a dnsmasq.log file at the moment. Am I right in thinking I would need to enable logging before it appears and if so, what information would it contain that could help to diagnose this issue?
    Screenshot - 28_02_2020 , 09_21_47.png
     
  14. dave14305

    dave14305 Part of the Furniture

    Joined:
    May 19, 2018
    Messages:
    2,441
    Location:
    USA
    I was referring to the top pdf you posted, this line:
    Code:
    CPU: 30.7% usr 66.8% sys  0.0% nic  0.0% idle  0.0% io  0.0% irq  2.3% sirq
    It shows that only 30.7% of the CPU was being used by "user programs" and 66.8% were being used by "system stuff" likely related to those programs. And the idle % is 0 (percentage precedes the label). So the idle being zero would match the GUI utilization of 100%. And the sum of the individual processes may only match the user CPU%. (I understand it better than I can explain it, and that's not even anything to brag about!).
    This is bizarre. How was uiDivStats doing anything when it was installed? Did the USB get wiped? Or is it the same USB as before?
     
    a5m likes this.
  15. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    I used a different USB flash drive and reinstalled everything from scratch. Thanks for the explanation of what the various figures mean.
     
  16. TheLyppardMan

    TheLyppardMan Senior Member

    Joined:
    Nov 16, 2015
    Messages:
    425
    Location:
    Worcester, England
    I've disabled and then re-enabled Skynet and that seems to have solved the problem, at least for now.
    Screenshot - 28_02_2020 , 20_48_19.png
     
  17. EmeraldDeer

    EmeraldDeer Very Senior Member

    Joined:
    Dec 22, 2017
    Messages:
    636
    Location:
    Massachusetts
    My assumption is that Diversion's stats in general and counting of ads specifically are based on analysis of dnsmasq.log. The idea had been that diversion might be busy with an unusually large dnsmasq.log. Clearly that is not the case.