TinyPortal

Development => Support => Topic started by: domeen on April 08, 2008, 11:08:44 AM

Title: smf_sessions
Post by: domeen on April 08, 2008, 11:08:44 AM
Hello,

I have a very busy site, and I checked if everything is correct, and I saw that the sql tabel:smf_sessions   is 1Gb..... Can I empty that table?
Title: Re: smf_sessions
Post by: Ken. on April 08, 2008, 12:01:53 PM
Sounds like a question for the SMF forums domeen because it's an SMF table.
Title: Re: smf_sessions
Post by: ianus on April 08, 2008, 12:42:51 PM
Greetings!

Yes, this is a know problem with SMF 1.1.x
I can give you a link to a german solution and try to translate the interesting parts.

1.) You can delete the contend of the sessions table (not the table itself)
->sideeffect: all users have to log in again.

2.)
Workaround:
In index.php insert after

// Start the session. (assuming it hasn't already been.)
loadSession();


this

sessionGC();



Than make the sessionGC-Funktion in Load.php more usefull

Change:
DELETE FROM {$db_prefix}sessions

to

DELETE LOW_PRIORITY FROM {$db_prefix}sessions

This will delete all sessions if the DB has "not much to do"


Original thread:
http://www.simplemachines.org/community/index.php?topic=80805.msg922769#msg922769

I will not take any response. Use at your own risk and please backup first.
I have changed my SMF this way, and for me, it works and keep the sessions table small.
Title: Re: smf_sessions
Post by: domeen on April 08, 2008, 04:57:33 PM
so first I empty the table and then the workaroun? so if I do the workaround, the smf_session table  will be small in the future?
Title: Re: smf_sessions
Post by: G6Cad on April 08, 2008, 04:59:17 PM
ypu got the link to the discussions on this issue on SMF, i suggest you browse there and read the topic he linked to.
This issue is pure SMF and have nothing to do with TP what so ever (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.familjegodis.se%2FSmileys%2Ffgcustom%2Fflash.gif&hash=c8d1affc08bd64df191ea8e6521f61dfe19915fa)