Keyword

K2 does many queries to a DB!

  • Yuri Popov
  • Yuri Popov's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #77147 by Yuri Popov
K2 does many queries to a DB! was created by Yuri Popov
I make about 1200 categories and subcategories.
5 main categories and 1195 subcategories.
When i click the link (one of the main category), the site is very long loaded.
I enable Debug Mode and have seen, that the system does 1225 queries to a DB.
When i click the other link (other of the main category), the site is very-very-very long loaded.
I enable Debug Mode and have seen, that the system does 4243 queries to a DB.

I think it is bug.

How can I reduce CPU load?

p.S. i use k2 2.1

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #77148 by Lefteris
Replied by Lefteris on topic K2 does many queries to a DB!
Hi. Try to set "catalog mode" to yes in order to prevent K2 to check each subcategory for children. If you set this to yes and you want to display also items from the children categories try to create a menu link and select them manually. This way you will dramatically reduce the number of queries.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • nuno miguel duarte santa antunes
  • nuno miguel duarte santa antunes's Avatar
  • Offline
  • New Member
More
14 years 6 months ago #77149 by nuno miguel duarte santa antunes
Replied by nuno miguel duarte santa antunes on topic K2 does many queries to a DB!
where can i change the "catalog mode"??? i have the same problem. my server blocked my site because it is loading a lot of CPU and it can damage other sites that are hosted there.

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #77150 by Bryan Smith
Replied by Bryan Smith on topic K2 does many queries to a DB!
Catalog Mode is found in the category params. you assign it per category.

nuno miguel duarte santa antunes said:where can i change the "catalog mode"??? i have the same problem. my server blocked my site because it is loading a lot of CPU and it can damage other sites that are hosted there.

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #77151 by Parth Lawate
Replied by Parth Lawate on topic K2 does many queries to a DB!
What else can be done to reduce the Resource utilization of K2 ? We have a pretty small site by K2 standards hosted on Rochen.. using K2 primarily because of the categorization flexibility it offers.

We have benchmarked the site & it seems only K2 is to blame.. there is practically nothing else on the site..

Total articles are only 110 ..

Need help ASAP !

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #77152 by Lefteris
Replied by Lefteris on topic K2 does many queries to a DB!
Hi. K2 is designed with performance in mind. It powers gazzetta.gr and tnawrestling.com which are the second and thrid most popular, heavy traffic Joomla! sites around the world. So if you are sure that K2 is the reason your site is slow please try the following:

1. Make sure that Joomla! cache is enabled.
2. Enable the system cache plugin.
3. Switch catalog mode setting to "Yes".
4. Check for any other extension causing performance isuues.

Parth Lawate said:What else can be done to reduce the Resource utilization of K2 ? We have a pretty small site by K2 standards hosted on Rochen.. using K2 primarily because of the categorization flexibility it offers. We have benchmarked the site & it seems only K2 is to blame.. there is practically nothing else on the site..

Total articles are only 110 ..

Need help ASAP !

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #77153 by Parth Lawate
Replied by Parth Lawate on topic K2 does many queries to a DB!
Hi,

We have catalog mode set to no for our News & Blogs Sections where it needs to be no. Everywhere else its set to yes. Regarding Cache we have the Joomla cache ( global config ) set to yes & also have the the system cache plugin enabled..

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #77154 by David R.
Replied by David R. on topic K2 does many queries to a DB!
This could easily be optimized with the addition of a denormalized "hasChild" column to the k2_categories table. When a child is added or deleted, this flag would need to be updated. For situations like the ones described, it could be used to short circuit unnecessary queries for categories with no children.

By the same token it makes sense to also have a "hasItem" flag.

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #77155 by Parth Lawate
Replied by Parth Lawate on topic K2 does many queries to a DB!
Makes sense..

Maybe one of the devs can make a comment on this ?

Parth

David R. said:This could easily be optimized with the addition of a denormalized "hasChild" column to the k2_categories table. When a child is added or deleted, this flag would need to be updated. For situations like the ones described, it could be used to short circuit unnecessary queries for categories with no children.
By the same token it makes sense to also have a "hasItem" flag.

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #77156 by Parth Lawate
Replied by Parth Lawate on topic K2 does many queries to a DB!
General Question ,

For a site hosted at a Shared host like Rochen , should a site having around 250 visitors per day as per analytics and roughly 110 articles.. should it need a VPS ?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum