2010-01-02, 10:29 PM
In inc/class_session.php
What's the advantage of using shutdown_query instead of update_query? Also in my database processes this section locks an aweful lot. Any tips on optimizing this? I have hundreds of users online at once and it appears that every click this is run. I might just delete it entirely and remove the online time feature of mybb. It would be nice however to either optimize this or maybe in 1.6x have a toggle to turn it off.
More adjustments imho have to be made for large forums. My HF database is 1.8gb and server is a dedicated mysql but I have problems daily. Looking at the processes while problems occur it seems it's two things. One is the above mentioned and the other is userfields join. I actually went into class_sessions.php and showthread.php removed the join. I don't use profile fields at all on that site so it won't be missed.
Thank for any input.
This didn't get a single response. Any chance I can get someone knowledgable to make a comment that would help?
// If the last visit was over 900 seconds (session time out) ago then update lastvisit.
$time = TIME_NOW;
if($time - $mybb->user['lastactive'] > 900)
{
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$mybb->user['lastactive']}', lastactive='$time' {$lastip_add} WHERE uid='{$mybb->user['uid']}'");
$mybb->user['lastvisit'] = $mybb->user['lastactive'];
require_once MYBB_ROOT."inc/functions_user.php";
update_pm_count('', 2);
}
else
{
$timespent = TIME_NOW - $mybb->user['lastactive'];
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastactive='$time', timeonline=timeonline+$timespent {$lastip_add} WHERE uid='{$mybb->user['uid']}'");
}
What's the advantage of using shutdown_query instead of update_query? Also in my database processes this section locks an aweful lot. Any tips on optimizing this? I have hundreds of users online at once and it appears that every click this is run. I might just delete it entirely and remove the online time feature of mybb. It would be nice however to either optimize this or maybe in 1.6x have a toggle to turn it off.
More adjustments imho have to be made for large forums. My HF database is 1.8gb and server is a dedicated mysql but I have problems daily. Looking at the processes while problems occur it seems it's two things. One is the above mentioned and the other is userfields join. I actually went into class_sessions.php and showthread.php removed the join. I don't use profile fields at all on that site so it won't be missed.
Thank for any input.
This didn't get a single response. Any chance I can get someone knowledgable to make a comment that would help?