CMS Made Simple = High CPU Load, Usuage

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
latour

CMS Made Simple = High CPU Load, Usuage

Post by latour »

I have two high traffic sites. I just purchased a new website that gets ~3000 people per day and it use to be on wordpress... but I didn't buy it for the content/layout so i started from scratch and used CMS MADE Simple. I ran the word press version for 1-2 weeks and just turned the switched and i enabled the CMS MADE SIMPLE site.

CPU Load shot up, so did Usage:

Image
Pierre M.

Re: CMS Made Simple = High CPU Load, Usuage

Post by Pierre M. »

Hello,

I'm not sure I understand your post.
Nevermind. If you are experiencing performance issues,
-please search for these keywords : speed, slow, fast, dynamic, static, cache, caching, speed up...
-please give the cache module a try.

Pierre M.
WebGirl

Re: CMS Made Simple = High CPU Load, Usuage

Post by WebGirl »

I know this is an old thread, but that's EXACTLY what has been happening with static websites I port into CMSMS!

Oh I feel so relieved to know someone else has had the same problem!

Now ... to fix it ...
Pierre M. wrote:
-please give the cache module a try.

Pierre M.
I just followed Pierre's link and read this:
Cache is a collection of tags that stores output of some other tags (content, stylesheets) in temporary files so it will be more static. It's a quick'n dirty solution for some CMSms speed problems ...
Latest Release
cache
Cache 1.01
2007-01-08 Release
I also came across this thread, so am reading the six pages to see if this is the solution I'm looking for which will fix my client's hosting/CPU Load issues:

CMS Made Simple = High CPU Load, Usuage by latour

http://forum.cmsmadesimple.org/index.ph ... l#msg89370

I'm ever hopeful!

The Support folk for the hosting I resell keep saying, "CPU load is caused by php scripts - please REDUCE THE AMOUNT OF CONTENT ON YOUR PAGES" - which is NOT a solution :)  They're giving us 48 hrs to solve or they turn the website 'off'.
viebig

Re: CMS Made Simple = High CPU Load, Usuage

Post by viebig »

Are you using xcache/apc? Stylesheet cache

Regards
WebGirl

Re: CMS Made Simple = High CPU Load, Usuage

Post by WebGirl »

viebig wrote: Are you using xcache/apc? Stylesheet cache

Regards
Hi there Viebig! 

I'm not sure what "xcache/apc" and "Stylesheet cache" are, or how I use them.

Are they part of cmsms or php?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: CMS Made Simple = High CPU Load, Usuage

Post by jmcgin51 »

WebGirl wrote:
viebig wrote: Are you using xcache/apc? Stylesheet cache

Regards
Hi there Viebig! 

I'm not sure what "xcache/apc" and "Stylesheet cache" are, or how I use them.

Are they part of cmsms or php?
For stylesheet caching, I believe viebig is referring to the option in the CMSMS Global Settings menu:
Maximum amount of time (seconds) stylesheets can be cached in the browser:
viebig

Re: CMS Made Simple = High CPU Load, Usuage

Post by viebig »

xcache, eaccelerator, send optimizer, apc are opcode cachers that can be installed on the server and enabled in the php configuration.

CMSMS stylesheet generation can slow down the site, depending on how many you use. You can use static stylesheets or look for modules that export static stylesheets.

Also, you have to be more specific and let us know the modules you are using on the site, and if possible a link, cmsms versions, module versions, server os, php version etc..

The gain in performance and memory can from 200% to 2000% depending on the scripts using opcode cache, variable cache etc.

Regards

G
JeremyBASS

Re: CMS Made Simple = High CPU Load, Usuage

Post by JeremyBASS »

For what it's worth you can gain some speed and reduce load by turning off modules that are not in use, useing as few Golbal content block as you can (I'll use none in most sites), which what type of functions your calling, and find way to do the same thing with out a mod.  Thoses are just a few more ways to keep controll of the app... Hope this helps

Cheers
jeremyBass
Pierre M.

Re: CMS Made Simple = High CPU Load, Usuage

Post by Pierre M. »

Yes, less installed modules and less db queries.
BTW, what are your "bottom of source of page" numbers ?

Pierre M.
WebGirl

Re: CMS Made Simple = High CPU Load, Usuage

Post by WebGirl »

Pierre M. wrote: Yes, less installed modules and less db queries.
BTW, what are your "bottom of source of page" numbers ?

Pierre M.
Hi Pierre, I'm sorry, but I don't know what "bottom of source of page numbers" means.

Viebig, I went to Site Admin/System Info and grabbed this:
----------------------------------------------

Cms Version: 1.5.4

Installed Modules:

   * CMSMailer: 1.73.14
   * ModuleManager: 1.2.1
   * FormBuilder: 0.5.3
   * nuSOAP: 1.0.1
   * Search: 1.5.3
   * ThemeManager: 1.1.0
   * Comments: 1.8.1
   * Captcha: 0.4
   * MenuManager: 1.5.3
   * News: 2.9.3
   * TinyMCE: 2.4.13
   * FileManager: 0.4.5
   * Printing: 0.2.6


Config Information:

   * php_memory_limit:
   * process_whole_template: false
   * max_upload_size: 10000000
   * default_upload_permission: 664
   * assume_mod_rewrite: true
   * page_extension: .html
   * internal_pretty_urls: false
   * use_hierarchy: false


Php Information:

   * phpversion: 5.2.1
   * md5_function: On (True)
   * gd_version: 2
   * tempnam_function: On (True)
   * magic_quotes_runtime: Off (False)
   * memory_limit: 128M
   * max_execution_time: 60
   * safe_mode: Off (False)
   * session_save_path: /tmp (0777)


Server Information:

   * Server Api: cgi-fcgi
   * Server Db Type: MySQL (mysql)
   * Server Db Version: 4.1.11

----------------------------------------------
Jeremy - re Global Content Blocks - I had no idea that we shouldn't use these.  I use them for my own sites and client sites for Google Adsense and other info.

Viebig
-------
CMSMS stylesheet generation can slow down the site, depending on how many you use. You can use static stylesheets or look for modules that export static stylesheets.
Viebig, I have noticed in the web states for my client site that stylesheets.php gets thousands of hits a week - the top two are cmsms:

Image

You can see in this snapshot that other pages have fewer hits than these two cmsms files:

Image

If there is a way to limit this, it might just be one of the solutions! Can you - or anyone else - explain the best way to set up static stylesheets for CMSMS? Is there a smarty tag to use, or do I just save each of the stylesheets as stand-alone css docs, and list them in the template html?
Q: I'm not sure what "xcache/apc" and "Stylesheet cache" are, or how I use them.
A: xcache, eaccelerator, send optimizer, apc are opcode cachers that can be installed on the server and enabled in the php configuration.
I asked the hosting support team about this and this is their reply:
I am afraid that unfortunately we cannot install opcode on the server and we already have APC Cache for PHP installed which is much better that the offered.
This is now quite a problem, and I'm wondering if I have to find a new hosting solution for my clients. CPU Load allowance is 4.5%

Thanks for any tips/suggestions, everyone! Tearing my hair out, and might even lose a client over this if I can't solve a.s.a.p. within the next 48 hours - they are suggesting the following as a 'temporary solution'  :(
A temp solution would be a semi-dedicated server for $60/mo with 15% CPU or for $90/mo with 25% CPU.
I understand that you do not wish to expand for now but a dedicated server is a great investment, especially since you expect the traffic to your sites to increase.
This seems crazy - we must be able to sort this within cmsms without my client having to pay $60/month.
Last edited by WebGirl on Thu Jun 04, 2009 5:22 am, edited 1 time in total.
forbairt
Forum Members
Forum Members
Posts: 19
Joined: Tue Feb 12, 2008 8:40 am

Re: CMS Made Simple = High CPU Load, Usuage

Post by forbairt »

Generally I don't attach style sheets to templates I just include something like directly


Of course this means I can't edit the style sheet directly and have to go about ftping it every time but for the most part you won't be changing the style sheet that often ?

from your image there you are generating the style sheet 6200 times which is rather crazy in my mind (that said I don't know what kinda impact it'll have on the CPU usage) I do know however that just serving up a static css file will be a lot better and the web server may even be able to cache it depending on how its all configured.

I've not used the caching plugins that have been mentioned and of course my solution wouldn't be ideal for everyone

(Wordpress tends to let you write to the CSS file directly so its not something that gets generated with every hit of the page)
WebGirl

Re: CMS Made Simple = High CPU Load, Usuage

Post by WebGirl »

Thanks forbairt,

I might have to do this at least as a temp solution until I can get a clearer CMSMS way to solve this.

Cheers!
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: CMS Made Simple = High CPU Load, Usuage

Post by Jeff »

The source numbers he was talking about are found by viewing the source for the page in the browser and looking at the last line.

What is your setting for stylesheet cache in your system admin?
WebGirl

Re: CMS Made Simple = High CPU Load, Usuage

Post by WebGirl »

Hi ajprog,
The source numbers he was talking about are found by viewing the source for the page in the browser and looking at the last line.
!-- 0.358987 / 61 / 8494964 / 8648356 --

What do these figures represent?


What is your setting for stylesheet cache in your system admin?
I didn't know I was supposed to change this, didn't read it in documentation - or perhaps I missed it somewhere?

So, in Site Admin / Global Settings:
Maximum amount of time (seconds) stylesheets can be cached in the browser:

Was = 1000
Just changed to = 604800 (as per this post http://forum.cmsmadesimple.org/index.ph ... #msg160354

This parameter should be set relatively high for static sites, and should be set to 0 for site development
There's no indication what 'relatively high' means - 1,000? 10,000? 100,000?  - so I followed the number on the forum post I mentioned above - 604800.

Just found this - now it makes sense:
from 1 hour = 3600 seconds
1 day = 86400 seconds
1 week = 604800 seconds
http://forum.cmsmadesimple.org/index.ph ... #msg160354
The client is working on her site every few days - in this case, the week setting is probably ok.

Thanks so much for your help!

Let's hope this helps - the next 24 hours will show if it does.
Last edited by WebGirl on Thu Jun 04, 2009 8:50 am, edited 1 time in total.
JeremyBASS

Re: CMS Made Simple = High CPU Load, Usuage

Post by JeremyBASS »

WebGirl wrote:- re Global Content Blocks - I had no idea that we shouldn't use these.  I use them for my own sites and client sites for Google Adsense and other info.
I didn't say "we shouldn't use these".  It's like wine, good for the heart but too much and it's bad for the liver.  What I was suggesting is to think of every {} as time for CPU/RAM/database to happen... think of ways to do the same thing without a GCB as you’ll cut CPU/RAM/database.  One thing I do is if the GCB is in the main template then I just put it straight in as my clients never see that area so it's a safe place to put the smarty code. 

If you were to quote me on something, it's this... Building is a balance so build only to your needs.  Be direct and reuse what you can.

For example I have one site that has the news module doing News, a one person blog, quotes, testimonies, and a simple article.  So I have 1 mod doing the same as a combination of 5 great mods that dig deeper on each one of those items, but also makes the site 4 mods heavier... So the juice was not worth the squeeze there.

Again this is only one step... See I bypass stylesheet.php and I use a .css on sites that I can't really cache, but I will leave it on ones I can cache.  It's the total picture type thing.  The end of it all is the client screen and how fast it got there.

Hope that helps a little

Cheers
jeremyBass
Locked

Return to “CMSMS Core”