SMF Support > Server Performance and Configuration

IMPORTANT: Large sessions table on Debian/Ubuntu Linux hosted forum?

<< < (3/13) > >>


--- Quote from: Daniel15 on December 16, 2007, 08:00:14 PM ---Hi everyone,
 If you're using Debian Linux to host a SMF forum and are using database-driven sessions, I'd suggest to apply the below change immediately.

--- End quote ---

my hosts uses Debian Linux ver-4.0
regarding this data base driven - how to know whether i am using this feature or not..

i am new to smf.. but i am interested to learn

could u pls help me..

Are you on shared hosting or have your own VPS or Dedi?


--- Quote ---I suppose this will do the same trick for SMF2.0b1?
--- End quote ---
It should... I've been clearing mine manually, haven't had time to implement this yet. :P

--- Quote ---A Cronjob could be set up to empty it couldnt it?
--- End quote ---
That should also work :)
Although, I think using the in-built garbage collection is better. Basically, it runs the sessionGC() function in Load.php to delete old sessions:

--- Code: ---function sessionGC($max_lifetime)
global $db_prefix, $modSettings;

// Just set to the default or lower?  Ignore it for a higher value. (hopefully)
if (!empty($modSettings['databaseSession_lifetime']) && ($max_lifetime <= 1440 || $modSettings['databaseSession_lifetime'] > $max_lifetime))
$max_lifetime = max($modSettings['databaseSession_lifetime'], 60);

// Clean up ;).
return db_query("
DELETE FROM {$db_prefix}sessions
WHERE last_update < " . (time() - $max_lifetime), __FILE__, __LINE__);

--- End code ---

--- Quote ---regarding this data base driven - how to know whether i am using this feature or not..
--- End quote ---
Admin panel → Server Settings → Feature Configuration → Use database driven sessions. If that's ticked, it's using database-driven sessions.

Whoa, exactly my issue!!

I'm on Ubuntu 6.06 and began researching because my sessions table reached 250Mb..

Thank you Daniel.

PS: lucky for me I was patient enough. Was searching for the 'sessions table' using the forum's search function, and this post was the LAST one. Why aren't sticky posts displayed first in the search result ?

Thanks for the info, I've got a fairly large Debian hosted forum which currently has a 2.8 GB sessions table, even after having truncated it about a year ago. :P
Looks like I'll be truncating the table again for sure and everybody will have to log back in, oh well. At least after this change the sessions table should remain a manageable size.

Again, many thanks.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version