Too many SQL queries, why?

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.
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

ok so counted them up... there are 45 of them installed... i don't use more then 5-10 per page... i need them all in there...
Sonya

Re: Too many SQL queries, why?

Post by Sonya »

45?  :o
I think, too much. CMSMS loads all modules with every page whether the module is used on the page or not <- I believe this will be corrected in CMSMS 2.0.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Too many SQL queries, why?

Post by calguy1000 »

CMS Loads all modules, but doesn't execute anything for modules that aren't called in one way or another (event handlers, etc, etc)...

On the template being displayed, and the debug output, I see that FEU and CustomContent are being used, News, Search, menu manager of course, etc, etc, etc.  they're all being used on that page.

There are some repeated queries there, to test if the user is logged in, and the session hasn't expired, etc.  Most of them are probably necessary, to see if the page or templates can be retrieved from cache, to get content so that you can extract next/prev links, parents, etc, etc.

I would double check that there aren't bugs, that you can't create indexes to speed some things up, and that the mysql query cache is tuned properly.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

CMSMS loads all modules with every page  :o
oh dear... will would you know if the planed fix for this in in the SVN?  I only use up to 10 per page but i use them all... so I'd think i'd need to fix this lol... damn i can't belive they all load... that sucks... the first time i'm sad with CMSMS lol
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Too many SQL queries, why?

Post by calguy1000 »

CMS loads the php files and instantiates the class for every page load.... that's it.  No actions are called (actions are the things that usually do the sql queries etc), unless a module is called in a GCB, page template, or content block, or that module is listed as a handler for some frontend events.

It needs to be there, and is not a bug... it's because some modules (like CustomContent, CGSimpleSmarty) don't have actions, they just do smarty stuff.

Other modules may be installed and may listen to certain frontend events, etc.... that's why they're all loaded (unless they're marked as inactive).
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

@Calguy
that you can't create indexes to speed some things up,
no sure what you mean... have a link handy or can you explain?
and that the mysql query cache is tuned properly.
no sure what you mean... i truned the catche on the page on... have a link handy or can you explain?
CMS loads the php files and instantiates the class for every page load.... that's it.  No actions are called (actions are the things that usually do the sql queries etc), unless a module is called in a GCB, page template, or content block, or that module is listed as a handler for some frontend events.

It needs to be there, and is not a bug... it's because some modules (like CustomContent, CGSimpleSmarty) don't have actions, they just do smarty stuff.

Other modules may be installed and may listen to certain frontend events, etc.... that's why they're all loaded (unless they're marked as inactive).
rock on... so um... i don't know where to go from here lol...
Sonya

Re: Too many SQL queries, why?

Post by Sonya »

calguy1000 wrote: CMS loads the php files and instantiates the class for every page load.... that's it.  No actions are called (actions are the things that usually do the sql queries etc), unless a module is called in a GCB, page template, or content block, or that module is listed as a handler for some frontend events.
calguy100, is this a performance issue or not? There is a Tuning HowTo written by cyberman http://forum.cmsmadesimple.org/index.ph ... 474.0.html in German and I have understood from it that one can speed up the site performance by uninstalling unused modules.  ???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Too many SQL queries, why?

Post by calguy1000 »

if you have modules that you don't use, or don't use regularly uninstall them.

by uninstalling modules you're reducing the need to even process those files, and lowering your php memory requirements.

De-activating modules can have a similar effect.

Some of the modules you can de-activate/de-install till you need them again are:
  ModuleManager
  ThemeManager
  NuSoap
  SitePusher
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

Some of the modules you can de-activate/de-install till you need them again are:
  ModuleManager
  ThemeManager
  NuSoap
  SitePusher
will do ... is there a full list of ones that are not needed to run?  I have 45 installed and i use almost all of them a some point in the site...
Sonya

Re: Too many SQL queries, why?

Post by Sonya »

calguy1000 wrote: if you have modules that you don't use, or don't use regularly uninstall them.

by uninstalling modules you're reducing the need to even process those files, and lowering your php memory requirements.

De-activating modules can have a similar effect.

Some of the modules you can de-activate/de-install till you need them again are:
  ModuleManager
  ThemeManager
  NuSoap
  SitePusher
Thank you, cyberman wrote that modules has to be unstalled AND removed. For me, great news that it is not so, because I need some development modules only if I debug and develop the project but I now do need to remove them.

Jeremy, forget all I said, I'm a woman :)
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

Jeremy, forget all I said, I'm a woman
And beautiful one at that.. but no need to try to discredit your self... your iUSER mod is very promising, after this and another problem I was going to get back on that... but you are helping.... and i thank you for that :)
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

@Calguy  so i tryed what you suggested... Looks like i shaved .4 sec... not a big gain but a gain... so... what else could be done...?
Pierre M.

Re: Too many SQL queries, why?

Post by Pierre M. »

JeremyBASS wrote:
and that the mysql query cache is tuned properly.
no sure what you mean... i truned the catche on the page on... have a link handy or can you explain?
Calguy was suggesting to double check the database engine. Its cache, not CMSms' cache. May be you rely on an overloaded SQL server or some bad setting in it.

Pierre M.
JeremyBASS

Re: Too many SQL queries, why?

Post by JeremyBASS »

Got you... any one know how to do that if that site is hosted on Godaddy? :)
Pierre M.

Re: Too many SQL queries, why?

Post by Pierre M. »

JeremyBASS wrote: any one know how to do that if that site is hosted on Godaddy? :)
This is not CMSms specific. This is a question for the G... support. BTW, google nodaddy

Pierre M.
Locked

Return to “CMSMS Core”