News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

High CPU Usage causes lag

Started by talross, November 08, 2014, 03:47:37 PM

Previous topic - Next topic

talross

After talking to my host about occasional lag issues, they said it was because the CPU usage of my site was causing me to hit a limit.

I've gone over the checklist and the "Twenty-four things..." and applied what I felt I could. I'm kind of a newblet, though. Between the recommendations in those two threads and a bit of other cleanup I've done, I feel like it helped a bit. I'm not hitting the peak any more, but the CPU usage is still high.

Sorry if I missed something. I tried looking over the threads to see if I could find an answer, but I was simply finding myself confused half the time.

I'm using Arvixe, shared web hosting. http://www.arvixe.com/linux_web_hosting [nofollow]  (Not the Pro). I recently had the PHP upgraded from 5.3 to 5.4, but I was having issues with lag even before then.

Forum: www.forum.castlewormwood.com [nofollow] (18+)
Status.php : http://castlewormwood.com/forum/status.php [nofollow]?
Phpinfo.php : http://forum.castlewormwood.com/phpinfo.php [nofollow]
Number of Posts: 283 Posts in 32 Topics by 16 Members.  (It's only been up for just over a month)
Average users @ peak: 4 at most, usually just 1 or 2.
Mods: Ajax Chat/Shoutbox, PartyMembers, Simple Portal, Member Notepad, Word Description, @mention members, Breeze
Do you still have performance issues if you use the default theme: Unknown

A list of the suggestions you have already implemented from the README: Checklist for performance problems as well as Twenty-four things you can do to make SMF go faster topics.
Checklist
  • Not using pre 1.1, so this doesn't apply?
  • No optimizer installed. I was looking up ACP, but a lot of people were saying it's useless and buggy now? I wanted to get y'all's opinion before I got it, or if there were another that would be better for me.
  • Not a lot of posts at all, I think, given that the forum is still new.
  • I don't really know how to optimize or tweak Mysql. I'd be glad to do so with proper instruction, but otherwise I'm afraid to touch it much.
  • I am on a shared server. According to the host, it's on my end.
  • So very properly confused.

Twenty-four things...

  • Avatars, done.
  • Disable hostname lookups, done.
  • Gzip, huwhat?
  • Tune topics, members, and posts. Didn't.
  • Large Custom Search Index, done.
  • Don't use post moderation. Got it.
  • Number of recent posts to display on index: 0
  • Disable recent posts feature, done
  • Run "mark read for inactive users..." Not done.
  • Do you need that many boards? Still new, so I don't think I have many.
  • Calendar, been disabled.
  • Database-driven sessions and mediawiki. Doesn't sound like a fit for me. The database-driven is already enabled, though?? *

  • Maintenance / Scheduled Tasts: Disabled Approval Notifications. Left Optimize Database alone(enabled).

  • Convert tables to InnoDB and MEMORY. Not done.
  • Running PHP 5.4
  • SMF its own database: yup

*"Use Database Driven Sessions" is checked under Server Settings > Cookies and Sessions. Is this normal / recommended?


If I can supply any more information, I'll be glad to. Sorry if I missed anything.

kat

How much use does the chat/shoutbox thing set to auto-refresh?

That can lead to high loads.

Illori

your host is an oversold host, unlimited does not exist. that may be part of your problem. some or all your problems may disappear if you go to a non-oversold host.

talross

Arvixe was the only host I found that allowed adult content and didn't look entirely shady. If you have any other recommendations, I'd gladly look them up.



As for the Chat, I'm having trouble finding the auto-refresh rate. I'm sure I had seen it before, though.
Is this it?
Config.js
// The time in ms between update calls to retrieve new chat messages:
timerRate: 2000,



These are a few other things that might matter?
Config.php
// Minutes until a user is declared inactive (last status update) - the minimum is 2 minutes:
$config['inactiveTimeout'] = 2;
// Interval in minutes to check for inactive users:
$config['inactiveCheckInterval'] = 5;


Antes

http://tools.pingdom.com/fpt/#!/eJoQI9/http://forum.castlewormwood.com/

Weird enough, why your site has Font-Awesome which is not using fully...
Breeze.css loaded on login page (should only be loaded at profile)
A simple login page request 1.1mb (lul wut?)

talross

#5
Removed the font-awesome, but it's still showing up in the resource you linked.

Uninstalled Breeze, either permanently or until I can figure out why it was loading on the log-in page.

Also, adjusted the BG image so it wasn't hella huge.


Edit:
Looking at the link Antes supplied, it seems it would be a good idea to cache the bg image and logo (in the very least). Trying to figure out how to do this, and the best way. I could just put an .htaccess file in the same folder I store the two images in, right? I could even put them in another folder/directory all on their own, and with no sub folders. Or would it be better to manage this in the PHP (and how would I?)

Sorry. I'm really trying to figure a lot of this out on my own so I don't bother y'all as much.


Editedit:
Pahaha. Wheat Thins...

talross

In the very least, could someone point me in the direction of information regarding optimizing the database? I think that's one thing I need to do. I'm still pretty clueless, but I've tried and tried and I'm not getting anywhere.

Opened vs. Open tables:
(table_cache)   21.9154 (should be <= 80)
^ The above is current as of the time of this post, but a couple days ago it got above 90 before the whole thing seemed to reset (or crash).

Thread cache usage:
(thread_cache_size)   0.2627 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)   0.5935 (should be <= 0.5)

Query cache prune rate:
(query_cache_size)   0.493 (should be <= 0.05)

I am assuming that, aside from trying to find out what's hitting the database so much, that I need to increase the cache size. I hate assuming things, but I can't find any information that makes sense to me. This is about one of the only things I can think to do. I don't know if it's right, or how the heck I'm even supposed to go about doing it.

Any information, even if it's just a link to a guide or something, would be much appreciated.

Kindred

what mods do you have installed?

Are you running anything else on the site?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Illori

QuoteNumber of Posts: 283 Posts in 32 Topics by 16 Members.  (It's only been up for just over a month)

with that few number of users and posts you really should not be having this issue. the real fix is to find a host that is not oversold. you can do all you want to tweak things but your host will just ask you to pay more and buy a VPS you dont need.

JBlaze

My guess is that the host has oversold so much, that someone on the same server as you is overloading their portion, and your host is blaming your for it.

Find a new host.
Jason Clemons
Former Team Member 2009 - 2012

Advertisement: