Slow queries on large website - #_assets is NOT the problem

Discussion regarding Joomla! 2.5 Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
garyjaybrooks
Joomla! Guru
Joomla! Guru
Posts: 556
Joined: Wed Feb 20, 2008 4:34 am
Location: Michigan
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by garyjaybrooks » Tue Apr 17, 2012 10:15 pm

ervik,

We see the issue in your database. I need a copy of your site. I would like an akeeba backup. Would you be willing to share a copy so I can see how we can fix this?
Gary Brooks - Joomla Hosting with Phone Support http://www.CloudAccess.net Official host of http://demo.joomla.org

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Tue Apr 17, 2012 10:34 pm

Yes, I can give you an url to download it from! I'll pm you the details from where to download it!

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by mcsmom » Wed Apr 18, 2012 2:26 pm

Can you try doing a category rebuild?
How many items do you have in com_rokcandy?
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Wed Apr 18, 2012 3:51 pm

Hi,

Not entirely sure what you mean by rebuild of my categories, do you mean if I can start from scratch with that table and build it all up again? That will take a loong time to do!

As for the the table for rokcandy in phpmyadmin shows 7 rows:

1 0 0000-00-00 00:00:00 7
Edit Delete 21 151 {text} <em>{text}</em> 1 0 0000-00-00 00:00:00 6
Edit Delete 22 151 {text} <strong>{text}</strong> 1 0 0000-00-00 00:00:00 5
Edit Delete 23 151 [h4]{text}[/h4] <h4>{text}</h4> 1 0 0000-00-00 00:00:00 4
Edit Delete 24 151 [h1]{text}[/h1] <h1>{text}</h1> 1 0 0000-00-00 00:00:00 1
Edit Delete 25 151 [h2]{text}[/h2] <h2>{text}</h2> 1 0 0000-00-00 00:00:00 2
Edit Delete 26 151 [h3]{text}[/h3] <h3>{text}</h3> 1 0 0000-00-00 00:00:00 3
Last edited by ervik on Wed Apr 18, 2012 4:08 pm, edited 1 time in total.

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by mcsmom » Wed Apr 18, 2012 3:58 pm

There is an icon in the tool bar of every category tab called Rebuild (green round arrow). Just click that.

Can you open and save each of the 7 and see if that helps?
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Wed Apr 18, 2012 4:20 pm

So, I should select all from the Categories menu, and hit the rebuild button right?

shwaran
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Apr 19, 2010 1:13 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by shwaran » Wed Apr 18, 2012 4:30 pm

yes you must do that!.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Wed Apr 18, 2012 4:36 pm

Did that now. Checked phpmyadmin when selecting an article and I still get this:

ID User Host Database Command Time Status SQL query
Kill 21949 root localhost ervikasdb Query 5 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW

and it doesn't seem to get any quicker... I also uninstalled the rokcandy component and plugin, I wasn't using it anyways...

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Wed Apr 18, 2012 7:35 pm

Just a quick update, I posted a new article and I now see the same in the processes alot of them and they have up to 05:12 in running time!!!!!

D User Host Database Command Time Status SQL query
SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgt WHERE (a.name = 'com_content' OR a.parent_id=0) GROUP BY b.id, b.rules, b.lft ORDER BY b.lft

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by mcsmom » Wed Apr 18, 2012 11:21 pm

https://github.com/elinw/AssetDiagnosis

That's the link to the newer version of the diagnosis.

From that query you see why having messed up assets will kill you site.

Did the categories for rokcandy get deleted?

Make sure you have no trashed items in categories or anywhere.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Thu Apr 19, 2012 7:27 am

Hi,
I ran this script last night: https://github.com/ikajaste/Joomla-2.5-Asset-Weaver
There are still some issues, regarding the query, I see less now that before the script!!
root localhost namedb Query 6 Copying to tmp table SELECT b.rules
FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW. I downloaded and typically what I've seen now, is that the queries go faster than before, but still some times it peaks. The service mysql -> /usr/sbin/mysqld runs steady on 60-60% cpu, this is still a lot!

I've attached both files
You do not have the required permissions to view the files attached to this post.
Last edited by ervik on Thu Apr 19, 2012 7:45 am, edited 1 time in total.

shwaran
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Apr 19, 2010 1:13 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by shwaran » Thu Apr 19, 2012 7:40 am

i am running 2 Joomla 2.5.4 websites only in the server,

website 1 online visitors 50+
website 2 online visitors below 10

when i run the top comment using ssh i can see that

MYSQL high CPU usage is 175%

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Thu Apr 19, 2012 7:52 am

Here is also the output from the assetsweaver today: ( I ran it again!)
> sudo php /usr/share/apache2/www.ervik.as/assetweaver.php /usr/share/apache2/www.ervik.as/configuration.php
No entry for terminal type "unknown";
using dumb terminal settings.
Reading configuration from /usr/share/apache2/www.ervik.as/configuration.php
Connecting to ervikasdb as root to read tables: j17_assets
Attempting to link assets by name structure: ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... done.
Attempting to fix article and category assets based on article category structure
Linking articles and categories ..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done.
Reindexing .....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done.

Errors: 5834 (16)
{1} Multiple root objects
{3011} Asset for category parent (0) not found
{3012} Asset for category parent (0) not found
{3013} Asset for category parent (0) not found
{3014} Asset for category parent (0) not found
{3016} Asset for category parent (0) not found
{3017} Asset for category parent (0) not found
{3018} Asset for category parent (0) not found
{3019} Asset for category parent (0) not found
{3020} Asset for category parent (0) not found
{3022} Asset for category parent (0) not found
{3024} Asset for category parent (0) not found

Break!

Applied fixes: 9071
SQL to execute: 3253

*** SKIPPING SQL EXECUTION

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by mcsmom » Thu Apr 19, 2012 9:44 am

For the assets listed there go to your back end, open each one and save it. When you have done that run the testing again.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Thu Apr 19, 2012 10:58 am

Hi, I've now actually deleted those articles since they were rather old... so I did not need them anymore...
Her is the new output!
Asset Table Diagnostics

This is an unofficial way of checking for problems in the asset tables of Joomla. It may not catch every problem, but it does give you some indication of where problems may exist.

Is there any asset besides root with parent_id of 0? If no things are good, if yes there is a problem.

Asset Table:
Yes

Category Table:
Yes

Is there any category without an asset in the asset table?

If any extension is listed below it has at least one category without an asset.

If any extensions are listed, try clicking the rebuild icon in any category manager. Then refresh this page to see if the issue has been corrected.

Is there any article without an asset in the asset table? if yes we have a problem, if no things are good

No

If there are a small number of articles without assets you should be able to correct this by opening and saving each one. With a large number you may want to use bulk copy to trigger asset creation.

Is there any category with an asset level of < 2? If yes, there is a problem, if no, things are good

If the answer is yes, try clicking the rebuild icon in any category manager. Then refresh this page to see if the issue has been corrected. If it still has an a problem you may need to open each category and save it.

Is there any article that has an asset level of < 3? If yes bad, if no good

Yes: 3052articles

If you have a small number of problem articles, try opening and saving each article. For larger numbers you may want to use bulk copy into a new category and then back to the old one.

Is there any asset for an article that has a parent_id that does not correspond to a category? if yes there is a problem, if no things are good.

No article has this issue.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Thu Apr 19, 2012 11:28 am

This is what phpmyadmin now shows, and the cpu is still going about it's biz on 80-150 %:
Kill 1214 root localhost nameofdb Query 159 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1225 root localhost nameofdb Query 153 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1230 root localhost nameofdb Query 149 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1232 root localhost nameofdb Query 150 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1236 root localhost nameofdb Query 143 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1237 root localhost nameofdb Query 143 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1240 root localhost nameofdb Query 143 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1241 root localhost nameofdb Query 142 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1243 root localhost nameofdb Query 135 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1247 root localhost nameofdb Query 134 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1249 root localhost nameofdb Query 132 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1252 root localhost nameofdb Query 128 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1253 root localhost nameofdb Query 128 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1257 root localhost nameofdb Query 122 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1264 root localhost nameofdb Query 114 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1267 root localhost nameofdb Query 111 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1270 root localhost nameofdb Query 101 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1273 root localhost nameofdb Query 101 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1274 root localhost nameofdb Query 101 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1275 root localhost nameofdb Query 99 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1278 root localhost nameofdb Query 97 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1279 root localhost nameofdb Query 89 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1280 root localhost nameofdb Query 89 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1281 root localhost nameofdb Query 84 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1284 root localhost nameofdb Query 83 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1288 root localhost nameofdb Query 80 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1290 root localhost nameofdb Query 65 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1291 root localhost nameofdb Query 65 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1297 root localhost nameofdb Query 54 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1299 root localhost nameofdb Query 55 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1300 root localhost nameofdb Query 42 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1301 root localhost nameofdb Query 41 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1303 root localhost nameofdb Query 36 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1308 root localhost nameofdb Query 5 Copying to tmp table SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.cati
Kill 1310 root localhost nameofdb Query 4 removing tmp table SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.cati
Kill 1311 root localhost nameofdb Query 6 Copying to tmp table SELECT b.rules FROM j17_assets AS a LEFT JOIN j17_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgtW
Kill 1312 root localhost nameofdb Query 2 removing tmp table SELECT c . * , CASE WHEN CHAR_LENGTH( c.alias ) THEN CONCAT_WS( ':', c.id, c.alias ) ELSE c.id END AS slug,

shwaran
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Apr 19, 2010 1:13 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by shwaran » Thu Apr 19, 2012 11:54 am

server support person warn me about the following queries

Code: Select all

SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,contact.id as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published
FROM jar_content AS a
LEFT JOIN jar_content_frontpage AS fp ON fp.content_id = a.id
LEFT JOIN jar_categories AS c ON c.id = a.catid
LEFT JOIN jar_users AS ua ON ua.id = a.created_by
LEFT JOIN jar_users AS uam ON uam.id = a.modified_by
LEFT JOIN (
SELECT contact.user_id, MAX(contact.id) AS id, contact.language
FROM jar_contact_details AS contact
WHERE contact.published = 1
GROUP BY contact.user_id, contact.language) AS contact ON contact.user_id = a.created_by
LEFT JOIN jar_categories as parent ON parent.id = c.parent_id
LEFT JOIN jar_content_rating AS v ON a.id = v.content_id
LEFT OUTER JOIN (SELECT cat.id as id FROM jar_categories AS cat JOIN jar_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id
WHERE a.access IN (1) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2012-04-19 10:58:14') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2012-04-19 10:58:14')
GROUP BY a.id, a.title, a.alias, a.title_alias, a.introtext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, a.created, a.modified, a.modified_by, uam.name, a.publish_up, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, a.fulltext, a.state, a.publish_down, badcats.id, c.title, c.path, c.access, c.alias, uam.id, ua.name, ua.email, contact.id, parent.title, parent.id, parent.path, parent.alias, v.rating_sum, v.rating_count, c.published, c.lft, a.ordering, parent.lft, fp.ordering, c.id, a.images, a.urls
ORDER BY a.created DESC LIMIT 0, 15 
and he said these are very hard queries into mysql so in that case mysql have to has spikes from time to time can any one help me on this please

User avatar
garyjaybrooks
Joomla! Guru
Joomla! Guru
Posts: 556
Joined: Wed Feb 20, 2008 4:34 am
Location: Michigan
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by garyjaybrooks » Thu Apr 19, 2012 9:19 pm

@shwaran can you please open a new thread so someone can help you directly with you issue. We are live on this issue so you might want to watch it unfold before you jump in the middle of this thread.
Gary Brooks - Joomla Hosting with Phone Support http://www.CloudAccess.net Official host of http://demo.joomla.org

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Slow queries on large website - #_assets is NOT the prob

Post by mcsmom » Fri Apr 20, 2012 2:59 am

shwaran please run the assetdisagnostic.
We know that query is mainly an issue when your asset table is corrupted.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Mon Apr 23, 2012 11:22 am

Any news on my problem? garyjaybrooks and mcsmom?

Also, each time I post a new article, the cpu kicks up from stable 30-50% to 140%.
I have 2 vcpus, it runs on XenServer...

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Mon Apr 23, 2012 12:41 pm

Hi, I just tried to execute the assetweaver.php file again, and this is the output I'm getting! It get's really slow when I add a new article. Have you taken a look at the copy of the website I gave you?

> sudo php /usr/share/apache2/xxxxxxx/assetweaver.php /usr/share/apache2/xxxxxxx/configuration.php
No entry for terminal type "unknown";
using dumb terminal settings.
Reading configuration from /usr/share/apache2/xxxxxxxxxx/configuration.php
Connecting to nameofdb as root to read tables: j17_assets
Attempting to link assets by name structure: ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ done.
Attempting to fix article and category assets based on article category structure
Linking articles and categories ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done.
Reindexing ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done.

Errors: 5816 (16)
{1} Multiple root objects
{3011} Asset for category parent (0) not found
{3012} Asset for category parent (0) not found
{3013} Asset for category parent (0) not found
{3014} Asset for category parent (0) not found
{3016} Asset for category parent (0) not found
{3017} Asset for category parent (0) not found
{3018} Asset for category parent (0) not found
{3019} Asset for category parent (0) not found
{3020} Asset for category parent (0) not found
{3022} Asset for category parent (0) not found
{3024} Asset for category parent (0) not found

Break!

Applied fixes: 9056
SQL to execute: 3256

*** SKIPPING SQL EXECUTION

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Fri May 04, 2012 9:55 am

Hi,

Did you have a chance to look at this? My diag now shows( I still have a lot of copy to tmp table operations) and how do I find the article with the < 3 and the last entry here?:

This is an unofficial way of checking for problems in the asset tables of Joomla. It may not catch every problem, but it does give you some indication of where problems may exist.

Is there any asset besides root with parent_id of 0? If no things are good, if yes there is a problem.

Asset Table:
No

Category Table:
No

Is there any category without an asset in the asset table?

If any extension is listed below it has at least one category without an asset.

If any extensions are listed, try clicking the rebuild icon in any category manager. Then refresh this page to see if the issue has been corrected.

Is there any article without an asset in the asset table? if yes we have a problem, if no things are good

No

If there are a small number of articles without assets you should be able to correct this by opening and saving each one. With a large number you may want to use bulk copy to trigger asset creation.

Is there any category with an asset level of < 2? If yes, there is a problem, if no, things are good

No

If the answer is yes, try clicking the rebuild icon in any category manager. Then refresh this page to see if the issue has been corrected. If it still has an a problem you may need to open each category and save it.

Is there any article that has an asset level of < 3? If yes bad, if no good

Yes: 1 article

If you have a small number of problem articles, try opening and saving each article. For larger numbers you may want to use bulk copy into a new category and then back to the old one.

Is there any asset for an article that has a parent_id that does not correspond to a category? if yes there is a problem, if no things are good.

Yes at least one article has this issue
Last edited by ervik on Fri May 04, 2012 11:11 am, edited 2 times in total.

ervik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 170
Joined: Fri Nov 30, 2007 8:39 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by ervik » Fri May 04, 2012 10:00 am

And I get this, and I don't quite get what I am supposed to do with the for example {3011} Asset for category parent (0) not found
is the {3011} the ID of the Article?

sudo php /usr/share/apache2/websitename/assetweaver.php /usr/share/apache2/websitename/configuration.php ok
No entry for terminal type "unknown";
using dumb terminal settings.
Reading configuration from /usr/share/apache2/websitename/configuration.php
Connecting to ervikasdb as root to read tables: j17_assets
Attempting to fix article and category assets based on article category structure
Linking articles and categories done.

Errors: 15 (15)
{3011} Asset for category parent (0) not found
{3012} Asset for category parent (0) not found
{3013} Asset for category parent (0) not found
{3014} Asset for category parent (0) not found
{3016} Asset for category parent (0) not found
{3017} Asset for category parent (0) not found
{3018} Asset for category parent (0) not found
{3019} Asset for category parent (0) not found
{3020} Asset for category parent (0) not found
{3022} Asset for category parent (0) not found
{3024} Asset for category parent (0) not found
{3025} Asset for category parent (0) not found

Break!

Applied fixes: 0
SQL to execute: 0

Reconnecting to ervikasdb as root to write changes to: j17_assets
Executing SQL: done.

User avatar
nicholash
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Sun Feb 25, 2007 10:07 pm

Re: Slow queries on large website - #_assets is NOT the prob

Post by nicholash » Tue May 08, 2012 10:01 pm

I wanted to know how long each database query takes when I am trying to work out what is going on with a site.

I hope others find it intersting. It will also show you the calling location that made the query, so if there so a slow query, you can see exatly where it is made in the code.

have a try and tell me how it goes.

you can get it from http://www.conquerjoomla.com/cjspeed.html

it is new and well tested in my environment, if you do have any issues, just send me a private message or reply here.


Locked

Return to “Performance - Joomla! 2.5”