Advertisement:

Author Topic: Excessive CPU usage  (Read 2325 times)

Offline shnazzle

  • Semi-Newbie
  • *
  • Posts: 27
Re: Excessive CPU usage
« Reply #20 on: June 29, 2019, 04:07:46 AM »
I have level 1 file based caching enabled.
One thing I tried, which has yielded good results..
I've disabled our SMF Packs Shoutbox plugin.
We've had two little spikes into "very high" very briefly, but that's it.
We used to be hovering in the very high range with peaks into "extreme".

It might be a coincidence, and I guess I could verify by turning it back on, but I don't want to be shut down again :)

Image proxy is off. I had read about the https issues so as we're running https...off :)



Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,635
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Excessive CPU usage
« Reply #21 on: June 29, 2019, 04:12:30 AM »
Anything that works "realtime" - such as shoutboxes, notifications and so on, can cause a considerable increase in CPU load.  If turning off features like that solves the issue, then you probably found the culprit. But often, the EIG -style limits on any resource tend to be pretty arbitrary, and basically only exist to limit resources that were originally sold basically "unlimited".
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Virus-X

  • Newbie
  • *
  • Posts: 5
Re: Excessive CPU usage
« Reply #22 on: July 03, 2019, 11:50:41 PM »
Has anybody experienced any extreme cpu usage since installing RC2?

HostGator shut us down last night for having 3 stints of 90+ seconds in the "Extreme CPU Usage" bounds.

I've shut down shoutbox, which is the only plugin I've got installed. But it never did this on 2.0.15.

What activities could cause a lot of cpu processing in 2.1 RC2?

How about your other plugins? If you believe this plugin has error, please try to remove it.

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,434
    • sbulen on GitHub
Re: Excessive CPU usage
« Reply #23 on: July 04, 2019, 12:41:04 AM »
I have level 1 file based caching enabled.
One thing I tried, which has yielded good results..
I've disabled our SMF Packs Shoutbox plugin.
We've had two little spikes into "very high" very briefly, but that's it.
We used to be hovering in the very high range with peaks into "extreme".

It might be a coincidence, and I guess I could verify by turning it back on, but I don't want to be shut down again :)

Image proxy is off. I had read about the https issues so as we're running https...off :)

In my experience, CPU spikes are typically caused by crawls.   Look at your web logs and determine who the culprit is.  Somebody hitting your site several thousand times an hour isn't hard to spot in the web logs! 

If it's Google, throttle them in Google webmaster tools. 

If it's someone else, block them. 

As noted above, I use Hostgator.   It may also be that Hostgator is squeezing their users.  That is almost certainly part of it.  For whatever reason, crawls didn't bother me in the past, but they do now. 

I'm still on the fence whether to leave HG in the future.  On the plus side, I have never had issues with uptime or support - they've always been rock solid.  But on the downside I really don't like their backup policies & pricing.  And I suspect they are squeezing resources - as shown by sensitivity to crawls. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline drewactual

  • Full Member
  • ***
  • Posts: 694
    • College Football Fan Site CFB51
Re: Excessive CPU usage
« Reply #24 on: July 04, 2019, 03:07:31 PM »
fwiw HG has a great dedicated server program.  its not cheap @ $3500 a year, but down time is exceedingly rare. 

back to the OP:  you may consider using an htaccess entry to throttle your php.  if there are some rogue scripts running they can consume a LOT of processor power, especially when they edge up to the cutoff limit regularly... I've set mine, as a for instance, to 30 seconds.  if even a robust search is called, it will die in 30seconds, as a for instance... and if a script regularly takes that long, it's likely i'd be needing to visit the coding and come up with a cleaner way to do it. 

i throttle the timeouts to 30 seconds and the memory to 16mb max per process. 

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,635
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Excessive CPU usage
« Reply #25 on: July 05, 2019, 12:11:44 AM »
IMO that's not really a very good idea. If you run to situations where you need to kill processes to conserve resources, you should get more resources.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline drewactual

  • Full Member
  • ***
  • Posts: 694
    • College Football Fan Site CFB51
Re: Excessive CPU usage
« Reply #26 on: July 06, 2019, 08:00:34 PM »
oh it certainly wasn't SMF snatching up those resources- it was a poorly written code even by php4 standards, and heavily searching a cumbersome and massive database and while running on php5.6 at the time and data from a >4.xSQL on a 5.4SQL... SMF is clean- nothing from it has ever taxed the system like that thing did. 

^it's for that reason i wonder what is gulping down the OP's resources.  Now that my (SMF+WP) primary site is so clean, i wager i could support it's traffic and weight on a shared environment with little issue.  NOT before, though, with that other function running on it.   

Offline shnazzle

  • Semi-Newbie
  • *
  • Posts: 27
Re: Excessive CPU usage
« Reply #27 on: August 30, 2019, 11:01:45 AM »
Our "guy" that we've just introduced made a good point. Or at least, seems like a good point.

We're on hostgator shared hosting. And while we generally tend to run within the high to veyr high band, it's sometimes that we are just under Extreme and then when we go over we're hit with enforced shut-downs.
So the logic seems to be that we may be sharing our hosting with some other very heavy users. So when what is usually "very high" for us on a normal day, when someone else absolutely rams their service, it becomes a "extreme" as a percentage of the total available for the shared host.

I'm not sure it's scaled that way, but the other day our site wa sdamn near unusable, and all of a sudden it was flying again.

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,434
    • sbulen on GitHub
Re: Excessive CPU usage
« Reply #28 on: August 30, 2019, 01:21:21 PM »
I've been shared on HG for years.  I've never seen someone else's traffic affect my CPU.   

The CPU charts always track perfectly to traffic on the web access logs.  I download the most recent day or two of logs and analyze them in Excel to identify the culprit.

When I see wide swings in CPU, the cause is always crawls.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp