1
karuna
How to decrease the xoops's mysql queries
  • 2004/5/24 5:55

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


a simple page will take 30+ queries.

It's a bit too much compare to a forum just takes 4~10 queries.

any way to decrease the MySQL queries?

2
wtravel
Re: How to decrease the xoops's mysql queries

Hi Karuna,

The best way to do this is to use the caching feature where possible. When for example this /newbb/ module is cached for 5 minutes, the queries for index.php are saved in cache as well for 5 minutes. So when you call the index.php page in your browser, the query will not be executed as long as it has not been in cache for more then 5 minutes.

Also if speed is important, I would try to reduce the use of innecessary blocks/modules (as much as possible). If any other suggestions available, please inform us.

Regards,

Martijn

3
brash
Re: How to decrease the xoops's mysql queries
  • 2004/5/24 7:06

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


I think you covered it pretty well there Martijn. The for major things that are going to effect your sites performance are cache, content, server, and available bandwidth.

In a nutshell if you use the caching feature (block as well as module) where ever possible, and keep unnecessary content to a minimum on a decent spec'd server with enough available bandwidth, then the getting good performance should be just a matter of course.

4
Mithrandir
Re: How to decrease the xoops's mysql queries

Without knowing exactly which forum you mean - and without knowing much of forum software - I would say that there are some good reasons for the number of SQL queries.

A forum, what does it have to fetch in the database? User details if logged in, configuration settings, a list of forums available to the user, number of posts in each forum... that kind of thing.

What does XOOPS have to fetch in the database? User details if logged in, configuration settings, modules installed, blocks, information to show in the blocks, information about the module, you are in, information to be displayed in the main content area, permission checks...

Not everything in XOOPS is optimised towards few SQL queries and some work can still be done there, but don't forget that XOOPS has so much more settings and information than a forum.

5
karuna
Re: How to decrease the xoops's mysql queries
  • 2004/5/24 9:17

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


to wtravel:
thanks, i have enabled cache except forum. this do help a lot,but the host is still complain that my site cost too much memorry and cpu (my site is about 60 users online,sometimes got 100+)

to Mithrandir :yes XOOPS is more powerful so i choose it i just want to know is there anyway to optimise xoops.

Now i want to apart some pages from xoops, change some blocks to html (such like mainmenu).but i don't know whether these will works~~

6
wtravel
Re: How to decrease the xoops's mysql queries

Hi Karuna,

I think it would be pretty hard to reduce the number of queries without compromising the main idea of the CMS.

But I do think that your web host should be able to handle the web traffic with that amount users.

Because the web host is complaining about memory and CPU, I think that his configuration is not a perfect match with your web site. If you try to cache your newbb module and blocks I suggest you have the web host take another look and see if it is still giving the server a lot of hard work.

If so, I am convinced that the problems lies in the configuration not being suitable for xoops.

Regards,

Martijn

7
karuna
Re: How to decrease the xoops's mysql queries
  • 2004/5/24 13:52

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Hi Martijn,

The first host i used is P4 2.8GC 1G DDR400 use freebsd and Zues (It's said to be a great web server client). about 5 site on it ,2 of these sites has 1000+ online. these sites got 502 badgate error and can't connect the MySQL frequently in the night. but after closed my site the other sites work well


My current host told me that my site takes about 4%cpu 14%memory.
The server is XEON*2 2G ddr ecc use freebsd and apache. i seldom got the can't connect the database error.
the host server is able to handle my site but the seller thought it's not worth the price~~

maybe i have to got some ad to supply this site~

I don't know cache forum for 30 seconds will works?
will it cost more resources to generates cache files.
but the user will not like that his words need a long time after he posted~~

8
cptwinky
Re: How to decrease the xoops's mysql queries
  • 2004/5/24 14:09

  • cptwinky

  • Just popping in

  • Posts: 37

  • Since: 2004/5/1 2


I have seen cache packages out there that allowing for partial caching of pages. This would really help with the forum so that it will cache whole pages and then on each page load only one query is neccesary, to see if there is any posts newer than the cached file, if so then recreate the cache for that page otherwise load the cached file....

I can't find the cache class now but I originally found it on phpclasses.org. Maybe smarty is capable of this though, I am not really sure. Either way its something to look into for caching pages that rely on fresh dynamic content.

9
intel352
Re: How to decrease the xoops's mysql queries
  • 2004/5/24 14:34

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


that sounds pretty unlikely for XOOPS to consume that much resources... are you running any type of Gallery module on your site?

maybe you have a poorly coded 3rd-party module installed..

hmm... not a good situation if the host is reading his stats correctly..

10
cptwinky
Re: How to decrease the xoops's mysql queries
  • 2004/5/24 14:48

  • cptwinky

  • Just popping in

  • Posts: 37

  • Since: 2004/5/1 2


I can see it...

My homepage with the NewBB2b2 module installed produces about 124 queries per request. I have brought this up with the developers as well and we all agree that it needs to be reduced its just a matter how. One definate thing though is taking queries out of loops all together, get the data then loop over it.

Login

Who's Online

366 user(s) are online (252 user(s) are browsing Support Forums)


Members: 0


Guests: 366


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits