-
AuthorPosts
-
zener79 Friend
zener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 13, 2012 at 8:48 pm #180676Hi, I’m working on a website with almost 5000 articles. I’m still on development mode, so I turned off the Cache.
The problem is that the home page take about a minute to load.
I turned on the debug mode and you can check the results yourself.For example… mod_jacontentslider take about 25 seconds and 100MB to load.
If I turn the Cache ON everything is fine, but I can not operate in this way… there must be a problem somewhere…
Thank you for you support
Claudio
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 14, 2012 at 8:59 am #467024Hi zener79,
IF Your site is still under the development mode why did you worry about that ? Once your site turning to production mode you can turn on the cache and I think it will be ok.
zener79 Friendzener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 14, 2012 at 12:32 pm #467063Ok, I found something…
the mod_jacontentslider fire the following query that returns all the 5000 articles and take about 15 seconds and 100MB.
I attach a screenshot of my backend module configuration
I tried to upgrade the module to the last version 2.5.6, but nothing changed
SELECT a.id, a.title, a.alias, a.title_alias,a.images, 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,
CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up, a.publish_down, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore ,a.id, a.title, a.alias, a.title_alias,a.images, 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,
CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up, a.publish_down, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LENGTH(a.fulltext) AS readmore ,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 j25_content AS a
LEFT JOIN j25_content_frontpage AS fp
ON fp.content_id = a.id
LEFT JOIN j25_categories AS c
ON c.id = a.catid
LEFT JOIN j25_users AS ua
ON ua.id = a.created_by
LEFT JOIN j25_users AS uam
ON uam.id = a.modified_by
LEFT JOIN ( SELECT contact.user_id, MAX(contact.id) AS id, contact.language
FROM j25_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 j25_categories as parent
ON parent.id = c.parent_id
LEFT JOIN j25_content_rating AS v
ON a.id = v.content_id
LEFT
OUTER JOIN (SELECT cat.id as id
FROM j25_categories AS cat JOIN j25_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,1,2,3)
AND c.access IN (1,1,2,3)
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-09-14 12:14:06')
AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2012-09-14 12:14:06')
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 created DESCThank you for your help
Claudio
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 17, 2012 at 3:24 am #467162hi zener79,
you have choose to show alll of your articles and the module has no ways other than queried to get out all of them, I think you have to limit the number of articles to show from this module.
zener79 Friendzener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 17, 2012 at 9:02 am #467213Where have I chosen to show all items???
I chose to show 2 articles per category, from all the category as you can see from the screenshot above.Thanks
Claudiozener79 Friendzener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 17, 2012 at 9:07 am #467215<em>@Sherlock Holmes 338187 wrote:</em><blockquote>Hi zener79,
IF Your site is still under the development mode why did you worry about that ? Once your site turning to production mode you can turn on the cache and I think it will be ok.</blockquote>
beacause I can’t work in this way… Is in development mode, it means that I have to make change and see the results… I can’t wait 30-40 sec for a refresh every time.
Any way, even in production mode, the cache will expire… and then, there are going to be big problems…
Thanks
ClaudioSherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 18, 2012 at 3:35 am #467334Hi zener79,
if the problem came from server side I think you have to contact your hosting provider to get a hand on that, regarding the client side you can try as following
Open the file of templatesja_nexhtmlmod_jacontentsliderdefault.php looking for this line of code
window.addEvent( ‘domready’, function(){ contentSliderInit_<?php echo $module->id;?>(<?php echo $firstCid; ?>); } );You change it to
window.addEvent( ‘load’, function(){ contentSliderInit_<?php echo $module->id;?>(<?php echo $firstCid; ?>); } );I hope that would help !
zener79 Friendzener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 18, 2012 at 8:41 am #467372There is no hosting provider… The website you are seeing is running on my development server. Is a simple Debian Squeeze with LAMP installed.
I tried to move the website on a production server, but the problem remain.Anyway, I don’t care about client side stuff. I’m worried about server-side resource.
How can a SQL query depends on hosting provider? The SQL query returns about 5000 record instead of 2 articles for each category…
Did you check the query I posted above? If you like I can try yourself using PhpMyAdmin on the following address:
www2.disabiliabili.net/phpmyadminYou can grab the credentials on configuration.php file (You have FTP access)
Please, I really need to put the website in production.
Thanks
ClaudioSherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 19, 2012 at 6:57 am #467479Hi zener79,
Okay, sorry for misunderstanding, I guess you are running an old version of the module that holding the problem of loading all articles although the Max Articles per category has been set, you can try to replace the file of modulesmod_jacontentsliderhelper.php by my attachment file (remember to unzip it first )
zener79 Friendzener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 19, 2012 at 8:36 am #467497Ok, thank you… now that query seems better but the problem remains.
With JA Content Slider Module disabled my homepage fire 83 query.
If I enable the module the homepage fire 8197 query.. yes, 8197… :-Ostill 18 seconds and 152MB
...
Application 14.857 seconds (+0.001); 13.31 MB (+0.014) - beforeRenderModule mod_custom (Partecipa anche tu)
Application 14.858 seconds (+0.001); 13.31 MB (+0.004) - afterRenderModule mod_custom (Partecipa anche tu)
Application 14.858 seconds (+0.000); 13.31 MB (+0.004) - beforeRenderModule mod_janewspro (JA News Pro! Module)
Application 16.960 seconds (+2.103); 16.36 MB (+3.046) - afterRenderModule mod_janewspro (JA News Pro! Module)
Application 16.982 seconds (+0.022); 14.53 MB (-1.834) - beforeRenderModule mod_jacontentslider (Ultime aggiunte)
Application 35.419 seconds (+18.436); 167.08 MB (+152.555) - afterRenderModule mod_jacontentslider (Ultime aggiunte)
Application 35.957 seconds (+0.539); 24.04 MB (-143.040) - beforeRenderModule mod_acymailing (Newsletter)
Application 35.961 seconds (+0.003); 24.06 MB (+0.019) - afterRenderModule mod_acymailing (Newsletter)
Application 35.961 seconds (+0.000); 24.04 MB (-0.018) - beforeRenderModule mod_banners (AdvPromo)
Application 36.035 seconds (+0.074); 24.21 MB (+0.165) - afterRenderModule mod_banners (AdvPromo)
Application 36.035 seconds (+0.000); 24.20 MB (-0.008) - beforeRenderModule mod_banners (AdvCatalogo)
Application 36.063 seconds (+0.028); 24.21 MB (+0.013) - afterRenderModule mod_banners (AdvCatalogo)
...
I enabled debug mode, check yourself: http://www2.disabiliabili.net
Thanks
ClaudioSherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 20, 2012 at 3:36 am #467588Hi zener79,
The module would make a query per each category you have, probably you have quite a lot categories there, I am sorry but I think we do not have any alternatives here: (
zener79 Friendzener79
- Join date:
- July 2012
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
September 20, 2012 at 1:45 pm #467658I can ensure you, and you can check yourself, that I do NOT have 8197 categories…
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 21, 2012 at 9:18 am #467746Okay zener79,
You could open the file of modulesmod_jacontentsliderhelper.php looking for this code
[PHP] if (!empty($catid) && intval($catid[0]) > 0) {
for($i=0; $i<count($catid); $i++){
if(intval($catid[$i]) > 0){
$model->setState(‘filter.category_id’, $catid[$i]);
$model->setState(‘list.limit’, $params->get(‘maxitems’, 10));
$data = array_merge($data, $model->getItems());
}
}
}else{
//$model->setState(‘list.limit’, $params->get(‘maxitems’, 10));
$data = array_merge($data, $model->getItems());
}[/PHP]and change it to
[PHP]
if (!empty($catid) && intval($catid[0]) > 0) {for($i=0; $i<count($catid); $i++){
if(intval($catid[$i]) > 0){
$model->setState(‘filter.category_id’, $catid[$i]);
$model->setState(‘list.limit’, $params->get(‘maxitems’, 10));
$data = array_merge($data, $model->getItems());
}
}
}else{$categories = JCategories::getInstance(‘Content’, array());
$categories = $categories->get(‘root’);
if ($categories && is_object($categories) && method_exists($categories, ‘getChildren’)) {
$_categories = &$categories->getChildren(true);for($i=0; $i<count($_categories); $i++){
if(intval($_categories[$i]->id) > 0){
$model->setState(‘filter.category_id’, $_categories[$i]->id);
$model->setState(‘list.limit’, $params->get(‘maxitems’, 10));
$data = array_merge($data, $model->getItems());
}
}}
}
[/PHP]I hope it should help !
AuthorPostsViewing 13 posts - 1 through 13 (of 13 total)This topic contains 13 replies, has 2 voices, and was last updated by Sherlock 12 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum