Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: Tonyvic on July 02, 2012, 02:49:03 PM

Title: High server resource loads
Post by: Tonyvic on July 02, 2012, 02:49:03 PM
I'm on shared hosting running SMF 2.0.2 and sometimes see memory & CPU hitting the max allowed, this then results in ISE 500.
I note on the 'faults graph' for today that there is a 1 hour build-up then another hour to tail off.

Is this likely to be something with the forum set-up, or maybe an outside influence.

Any thoughts would be appreciated.

Tony
Title: Re: High server resource loads
Post by: Arantor on July 02, 2012, 03:51:13 PM
Mods installed?
Title: Re: High server resource loads
Post by: Tonyvic on July 02, 2012, 04:07:14 PM
Thanks for looking! :)
QuoteMods installed?
Quite a few, see attached.
Title: Re: High server resource loads
Post by: Tonyvic on July 04, 2012, 06:47:35 AM
Anyone?
A similar thing happened yesterday.
Title: Re: High server resource loads
Post by: ziycon on July 04, 2012, 08:17:46 AM
I looks from the two images there that it occurred at roughly 1pm the first day and 3pm the next time, are there any scheduled tasks running on the server hourly or any cronjobs set to run on the hour?
Title: Re: High server resource loads
Post by: Tonyvic on July 04, 2012, 08:46:28 AM
There's nothing on my site set to run, apart from the standard SMF tasks but they run from 01.00 to 05.00.

Is it a question I should put to the host? The last time I entered a ticket they said I should optimise the database and if that didn't work I should upgrade to a VPS/Dedicated server! ???

Tony

Edit: Just checked todays graphs - attached.
Title: Re: High server resource loads
Post by: 青山 素子 on July 05, 2012, 02:50:24 AM
If you're on shared hosting and the problem occurs at a specific time, every day, it's likely related to some scheduled thing on the server itself going on. It's best to send the information you collected to your hosting provider and see if they can determine what is occurring on that schedule.
Title: Re: High server resource loads
Post by: Tonyvic on July 05, 2012, 11:25:00 AM
Thanks for the reply,
Although the times vary 13.00hrs has cropped up a few times. I will contact the host! ::) :)

Tony
Title: Re: High server resource loads
Post by: Tonyvic on July 11, 2012, 06:44:27 AM
I have been on to the host & they seem to be ignoring my request for help, simply saying I need a VPS or Dedicated server! ::)
There is rarely more than 20 online at any point, less than 63000 posts & 1798 members (Only about 300 active), so it's not the biggest forum in the world.

Yesterdays memory usage was at max for about 7 hours :o, previously I have only ever seen that for one/two hours.

Is it time to change host again, or is it likely to be a fault in my settings/files.
Any suggestions would be appreciated.

Tony

Title: Re: High server resource loads
Post by: ziycon on July 11, 2012, 06:47:07 AM
Maybe keep any eye on bots/spiders visiting your site and note what times they arrive 'en masse', this could be a contributing factor. What host are you currently with?
Title: Re: High server resource loads
Post by: Tonyvic on July 11, 2012, 09:00:30 AM
Only three spiders crawl my domain, usually only one at a time. As for Bots, I don't know how to check as my cPanel error log is very often empty although it states:
QuoteLast 300 Error Log messages in reverse order:
I asked the host about this and their answer is
QuoteThe error logs have some limitations on shared server as it is a shared hosting environment.
If you upgrade to VPS or dedicated server we will customize the settings to fulfill your requirements.

The host is  EUKhost (https://www.eukhost.com/) and I'm on 'cPanel webhosting gold'.

Title: Re: High server resource loads
Post by: kat on July 27, 2012, 05:40:42 AM
Only thing that makes me go  ??? is the portal.

Does that include a shoutbox?

If so, is it set to "Real time"?

Even that's unlikely, though, if it only spikes at certain times.

Your host seem like a bunch of cowboys, if all they do is try to get you to throw more money at them.
Title: Re: High server resource loads
Post by: Tonyvic on July 27, 2012, 11:27:42 AM
QuoteDoes that include a shoutbox?
Yes, I am using the shoutbox that comes with the portal.

QuoteIf so, is it set to "Real time"?
I have 'Shoutbox refresh time in seconds' disabled, so I assume that's 'Real time' :-\

The spikes are quite variable in time and amount in a 24 hour period. See attached from yesterday & three days before.

I changed hosts in May as the previous one I used disabled the site a couple of times and told me to dump the Ajax chatroom, as the CPU usage was too much. I changed to the current host after explaining that, and was told they wouldn't disable the site for that reason which they haven't. Because of all the 500 errors due to the chat, I have removed it again. :o
Title: Re: High server resource loads
Post by: ziycon on July 27, 2012, 12:22:30 PM
Are you still getting the spikes with the ajax chat disabled?
Title: Re: High server resource loads
Post by: Tonyvic on July 27, 2012, 01:57:13 PM
Chat has been disabled for a few weeks but that mainly affected CPU, not memory which seems to be the main problem.
Title: Re: High server resource loads
Post by: kat on July 27, 2012, 05:23:42 PM
Probably a silly question, this...

Do you have any cron-jobs set up?
Title: Re: High server resource loads
Post by: Tonyvic on July 27, 2012, 06:13:09 PM
It was a silly question asking me about cron jobs K@. ;D I didn't even know what they were until I just looked it up  :-[, I notice in the cPanel/Cron jobs section it states 'No cron jobs'
Title: Re: High server resource loads
Post by: kat on July 27, 2012, 06:31:56 PM
Well, it was worth asking. :)

None of those mods would cause any problems, like that. So, I'm somewhat baffled. :(
Title: Re: High server resource loads
Post by: Night09 on July 27, 2012, 08:26:04 PM
Eliminate the probable and that only leaves the improbable. 

Just before the time when the resources go crazy slip your forum into maintenance mode for an hour or two so as to cut all traffic into your server. This might shed a bit of light on where its originating if all the host is bothered about is a higher package and not whats wrong.

You will have comparable stats then from live and maintenance to see if theres any discrepancy.
Title: Re: High server resource loads
Post by: LiroyvH on July 27, 2012, 09:34:09 PM
That might be a good idea, if maintenace mode 2 is used as to completely disable the forum.

Can't your host tell you which process causes issues...?
Title: Re: High server resource loads
Post by: Tonyvic on July 28, 2012, 06:38:53 AM
QuoteSo, I'm somewhat baffled. :(
That's my permanent state these days. ;D

QuoteJust before the time when the resources go crazy slip your forum into maintenance mode for an hour or two so as to cut all traffic into your server.
I will give that a go later today, although there are no regular times so will just take pot luck.

QuoteCan't your host tell you which process causes issues...?
When I first submitted a ticket requesting help on 24th May, the reply was:
QuoteI have checked the logs and found that the memory_limit which is set in global php.ini file is insufficient to execute the file "index.php" which is under "/home/********/public_html/community/". Please check the logs as below :
=======================
[Thu May 24 12:05:31 2012] [error] [client 85.210.161.41] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/********/public_html/communit
y/index.php, referer: http://www.*****************.net/community/index.php?topic=7673.0;topicseen

[Thu May 24 10:24:42 2012] [error] [client 82.41.230.54] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/naturist/public_html/community
/index.php, referer: http://www.*****************.net/community/index.php?topic=8022.0;topicseen
=======================
I have created a custom php.ini file for your domain and increased the memory_limit from 32 M to 64 M. Now, the error logs which are generation should stop now.

Please feel free to contact if you need any further assistance on this.

The increased memory_limit did seem to help but usage was still maxing out, the next response was:
QuoteI suggest that you Please try to optimize your database as well as scripts. It will help you to minimized the resources usage on the server.

Tony
Title: Re: High server resource loads
Post by: LiroyvH on July 28, 2012, 11:51:19 AM
Oh they run suPHP, ask them to check if the server logs for that are not large, so if they have pruned them.
Not doing as such will result in massive performance loss.

Next to that, suPHP is not exactly known for it's super optimized performance, it's a resource hog on a server. It's very secure, but a resource hog.
A better environment would be something like mpm_event with FCGID. Even a Apache DSO with mpm_prefork runs faster than suPHP, heh.
Title: Re: High server resource loads
Post by: Tonyvic on July 28, 2012, 06:13:06 PM
Quote from: CoreISP on July 28, 2012, 11:51:19 AM
Oh they run suPHP, ask them to check if the server logs for that are not large, so if they have pruned them.
Not doing as such will result in massive performance loss.
Thanks for that CoreISP, I will put that to them tomorrow but will probably get a very vague answer. ::)

I put the forum into 'Maintenance 2' mode for two hours today, and there were no spikes.
If the host can't/won't do anything more I will remove the mods etc. one at a time, in the hope that I can find the culprit.
Title: Re: High server resource loads
Post by: kat on August 08, 2012, 05:43:25 AM
Any joy, with this?
Title: Re: High server resource loads
Post by: Tonyvic on August 08, 2012, 06:06:21 PM
Sorry K@, I thought I had replied to this. :-[

The response from host was something like "suPHP is correctly configured" ::)

I removed a couple of mods and prevented guests from accessing the threads. It seems to have improved the situation but I won't get excited yet. :D. There has only been one spike in 22 hours today.

If it goes downhill again in the coming days, I've decided to do a clean install of 2.02 & import a backup of the database. If that's ok , I'll add mods back one at a time.

Tony

Title: Re: High server resource loads
Post by: ziycon on August 09, 2012, 04:14:30 AM
If you're going to go down the route of doing a clean install, I would recommend leaving all your mods out for a week or two and monitor the server loads, then add the mods back in and monitor the server loads again for a week or two, this will help narrow down the root cause if spikes occur again after the clean install.
Title: Re: High server resource loads
Post by: Tonyvic on August 09, 2012, 02:07:12 PM
Thanks ziycon,
That's my plan, and hope a week at most will be enough. :-\
Title: Re: High server resource loads
Post by: kat on August 22, 2012, 07:18:15 AM
How'd it go?
Title: Re: High server resource loads
Post by: Tonyvic on August 22, 2012, 01:58:38 PM
Quote from: K@ on August 22, 2012, 07:18:15 AM
How'd it go?
I haven't had time yet, I am trying to keep my boss (wife) happy by building a large raised deck area & it's taking forever 8). ::)

Hopefully in about a weeks time, I will take the plunge. 8)

Tony
Title: Re: High server resource loads
Post by: kat on August 22, 2012, 02:04:49 PM
Heh... I have one, like that... ;)
Title: Re: High server resource loads
Post by: Tonyvic on September 02, 2012, 01:41:01 AM
Quote from: K@ on August 22, 2012, 02:04:49 PM
Heh... I have one, like that... ;)
Lol! :D

Now she is happy, I have at last reinstalled with a new set of files.
The first 24 hours has passed without the problem, will update again soon.

Tony
Title: Re: High server resource loads
Post by: Night09 on September 02, 2012, 04:16:25 PM
Quote from: Tonyvic on September 02, 2012, 01:41:01 AM
Quote from: K@ on August 22, 2012, 02:04:49 PM
Heh... I have one, like that... ;)
Lol! :D

Now she is happy, I have at last reinstalled with a new set of files.
The first 24 hours has passed without the problem, will update again soon.

Tony

Sounds like its going well then and hopefully when you put the mods back all stays good. Just do a couple a day so if any cause an issue you got a better idea when it started.   ;)

Im just finishing real wood floor before im wearing it on my head, gotta love wives lol. Meanwhile im stealing as much time as possible to work on a mod.  :P
Title: Re: High server resource loads
Post by: Tonyvic on September 15, 2012, 12:23:11 AM
I have finally added all mods back after the fresh install, and all looks good.
Been watching the stats, in the last week there have only been 3 brief spikes & none of the one/two hour maxed out that I was getting.
I can live with that, so many thanks for the advice guys.

Quote from: nightbre on September 02, 2012, 04:16:25 PM
Im just finishing real wood floor before im wearing it on my head, gotta love wives lol.
I hope you finished it without finding out if it suits you! :D

Tony