2 blueyed Sep 26, 2006 23:56

Thanks for your response ! :D
The debug info =>
Wow. There are faar too many SQL queries, which also get shown in the Debuglog. I bet you're displaying a blog list and there's one query per blog.
But there are 50 seconds (80 total - 30 for queries) that get not timed.
You could insert
$GLOBALS['Timer']->resume( 'X' );
...
$GLOBALS['Timer']->pause('X' );
lines e.g. into your skin.
I'd also add a
$GLOBALS['Timer']->resume( 'skin_total' );
line into _blog_main.inc.php, at the end, before the block that starts the skin:
if( !empty( $skin ) )
{ // We want to display now:
I tried your inserts, but without solving the problem :(
Perhaps there is a problem with the cache. :?: :?: :?: All blogs from the database are loaded in the cache:
dataobjects:
.......
Loading Blog(2215) into cache
Loading Blog(2216) into cache
Loading Blog(2217) into cache
......
and
DB:
....
Query #1259: DataObjectCache::get_by_ID()
SELECT *
FROM evo_blogs
WHERE blog_ID = 1227
Rows: 1 – Time: 0.0004s (0.00%)Query #1260: DataObjectCache::get_by_ID()
SELECT *
FROM evo_blogs
WHERE blog_ID = 1228
.....
Debug info part 2 =>
This happens when I go to the admin =>
Query #32:
SELECT *
FROM evo_blogusers
WHERE bloguser_blog_ID = 7
AND bloguser_user_ID = 1
Rows: 0 – Time: 0.0002s (0.00%)
Query #33:
SELECT *
FROM evo_bloggroups
WHERE bloggroup_blog_ID = 7
AND bloggroup_group_ID = 1
Rows: 0 – Time: 0.0002s (0.00%)
Query #34:
SELECT *
FROM evo_blogusers
WHERE bloguser_blog_ID = 8
AND bloguser_user_ID = 1
Rows: 0 – Time: 0.0002s (0.00%)
I did not meant to solve the queries, just getting more numbers/information.
The number of queries will go down, if you change the "load_all" param of BlogCache and UserCache to true, e.g. in inc/MODEL/collections/_blog.class.php
/**
* Constructor
*/
function BlogCache()
{
parent::DataObjectCache( 'Blog', [b]true[/b], 'T_blogs', 'blog_', 'blog_ID' );
}
Do the same for UserCache in inc/MODEL/users/_usercache.class.php.
This will load all users and blogs at once, instead of in a single query.
However, this will still cause the categories plugin to take a huge amout of time rendering the categories etc. You need to tweak it to not display all categories, but only the ones from the selected blog for example.
The above changes will probably help a bit, but as long as there are all blogs and/or users displayed/requested on a page, it will be slow.
Thanks for your suggestions :lol:
First: I have changed the _blogcache.class.php and _usercache.class.php to true and then there was only a white page in the blogs and admin.
Second: I have changed only _blogcache.class.php to true and the blogs were visible and there was only one query for the blogs but in the admin there were a lot of queries.
Third: I turned off the categories.
Unfortunately b2evolution as it is now is to slow to use for our university. The memory usage is to high 445 MB. :'(
Is it possible not to load every blog en user but only the blogs where the user is admin /member …. from?
Do you know why the blog_main.inc and skin_total are taking so much time?
No, I don't know. It's difficult to remotely diagnose this. You should put $Timer calls in there (see above).
"skin_total" is a subset of "blog_main.inc". "blog_main.inc" consumes over 20 seconds before it displays the skin..!
At least there are no slow queries any more when displaying the skin.. ;)
First: I have changed the _blogcache.class.php and _usercache.class.php to true and then there was only a white page in the blogs and admin.
Seems like a fatal error. Have you error_reporting=E_ALL and display_errors=on in your PHP setup? (see http://manual.b2evolution.net/Debugging)
Second: I have changed only _blogcache.class.php to true and the blogs were visible and there was only one query for the blogs but in the admin there were a lot of queries.
What kind of queries? Looks like one query per blog and user..?
You can enable further debugging for the DB class by setting e.g.
$db_config['debug_dump_function_trace_for_queries'] =20;
in /conf/_basic_config.php (or directly in /inc/_misc/_db.class.php), which will show you were the query is done (backtrace).
Whew. That many posts... Just out of curiosity's sake, why did you have so many users?
Interesting use case.. B)
Enable debugging ($debug in /conf/_advanced.php) and look at the Timer table at the top of the Debuglog (at the end of the page).
Please post the numbers here..