Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 09 Jan 2007, 21:29
netwind netwind is offline
 
Join Date: Feb 2005
user lastactivity speedup ?

I found this comments in code in file includes/session.php :
// if this line is removed (say to be replaced by a cron job, you will need to change all of the 'online'
// status indicators as they use $userinfo['lastactivity'] to determine if a user is online which relies
// on this to be updated in real time.
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET lastactivity = " . TIMENOW . "
WHERE userid = $bbuserinfo[userid]
", 'lastvisit');


But not found somebody who use cron script for lastactivity update.
Remove this query can provide more scalability and reduce one query.
If i don't need instant showing online users and it's locations,
is it safe remove this query ?
Does worked cron job example exists ?
Reply With Quote
  #2  
Old 10 Jan 2007, 18:45
noppid noppid is offline
 
Join Date: Mar 2003
The last activity could be croned how? By storing the batch in a table and then running a batch of updates often? I don't see that as logical. The comment probaby has more behind it then meets the eye.

In any event, that query while it is in real time and a write, is index targeted and is of no real consequence IMO.

There are queries and then there are queries. This one is pretty friendly it appears.
__________________
Add a photo gallery garage to your auto forum and get noticed by your members. Find out how at the vBulletin Computer Help Forum.
An informed rider makes their first destination the motorcycle forum at rider info.
Reply With Quote
  #3  
Old 11 Jan 2007, 12:12
netwind netwind is offline
 
Join Date: Feb 2005
If session exists then lastactivity stored in session.
I think user.lastactivity need update after logout and purge session in cron.
I monitor my mysql activity and see much locked queryes.
lastactivity not indexed. Maybe simple add index?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 01:46.

Layout Options | Width: Wide Color: