MyBB Community Forums

Full Version: mybb_sessions is taking a while to execute
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
some users have been reporting getting mysql max_user_connections errors so I was browsing around my mysql_slow_queries log and noticed that mybb_sessions seems to be appearing quite often in the log file.

here's a few examples:

# Tue Aug  7 22:39:35 2012
# Query_time: 40.115125  Lock_time: 24.652540 Rows_sent: 0  Rows_examined: 1
use *REMOVED*;
SET timestamp=1344400775;
UPDATE *REMOVED*_sessions
  SET `uid`='842', `time`='1344400725', `location`='/forumdisplay.php?fid=8', `useragent`='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.', `location1`='8', `location2`='0', `nopermission`='0' WHERE sid='ba3e107bfc806cde28d4852fbf6aea6b' LIMIT 1

# Tue Aug  7 22:39:34 2012
# Query_time: 48.960592  Lock_time: 8.465386 Rows_sent: 1  Rows_examined: 1
use *REMOVED*;
SET timestamp=1344400774;
SELECT u.*, f.*
  FROM *REMOVED*_users u 
  LEFT JOIN *REMOVED*_userfields f ON (f.ufid=u.uid) 
  WHERE u.uid='200'
  LIMIT 1

# Tue Aug  7 22:39:36 2012
# Query_time: 29.796764  Lock_time: 28.472628 Rows_sent: 0  Rows_examined: 1
use *REMOVED*;
SET timestamp=1344400776;
DELETE FROM *REMOVED*_sessions  WHERE ip='*REMOVED*'

I just changed the operation type for the mybb_sessions table from MyISAM to MEMORY, which is supposed to speed up the execution times.

any other suggestions to help with those long execution times?
What engine is your sessions table? Have tried using InnoDB?
(2012-08-08, 06:05 AM)crazy4cs Wrote: [ -> ]What engine is your sessions table? Have tried using InnoDB?

I just switched it to MEMORY.