FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » How to stop recording in the table forumsfud_ses ?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to stop recording in the table forumsfud_ses ? [message #27183] Mon, 29 August 2005 20:05 Go to next message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
Hello
Fudforum is perfect, very fast, efficient (love rss), etc.
Thank you !

But i have one problem, the table 'forumsfud_ses' that in the past crashed several times (had to re-create it..), and which becomes VERY quickly HUGE (~ 40mo) and i don't like it very well.

How to disable the forumsfud_ses recording, which is, I think, not necessary for fudforum to work.

Thank you
Matthieu
Re: How to stop recording in the table forumsfud_ses ? [message #27190 is a reply to message #27183] Mon, 29 August 2005 21:07 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
It is a critical table where the sessions are stored, without it the forum cannot track users. The table is automtically cleared of old entries periodically on login.php. If that is not frequent enough you can add a cron job to do the same thing.

FUDforum Core Developer
Re: How to stop recording in the table forumsfud_ses ? [message #27196 is a reply to message #27190] Mon, 29 August 2005 21:17 Go to previous messageGo to next message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
Maybe i have a older version
Powered by: FUDforum 2.6.13.

But it seems that this table is not cleared automatically because the size before I purge it was 40Mo.

Thank you
Re: How to stop recording in the table forumsfud_ses ? [message #27197 is a reply to message #27196] Mon, 29 August 2005 21:23 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The forum does not have a cron job of its own, so the way it clears it is whenever someone access the login page. You can find the query @ the bottom of login.php.t

FUDforum Core Developer
Re: How to stop recording in the table forumsfud_ses ? [message #27198 is a reply to message #27183] Mon, 29 August 2005 21:37 Go to previous messageGo to next message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
Ok i understand, but don't you think its strange that nobody loggued in so long that 40Mb can be logged in the DB ?

Anyway wouldn't it be interesting to add a cron task to do this ?

I'm thinking of such a feature for phpmyvisites.

I'm not still sure of how I will do this, but i have this idea (my task is once a day).

- Add a @ignore_user_abort( true ); at the top of the file.
- at the bottom of each page view, visitor looks the last modification time of a file "last.dat"
- if day is not today, launch cron task
- when task is lauching, edit the file and add information about the task, and update with info about what is accomplished, etc. for example
- when task is finished, touch the file with today time
- if day is today, skip


what do you think of this idea ?

it will be used for archiving huge datas, sending mails, update rss, etc.
The advantage is that the big process could be computed in several times if server limits time execution.

Mat
Re: How to stop recording in the table forumsfud_ses ? [message #27199 is a reply to message #27198] Mon, 29 August 2005 21:57 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, you are probably using cookies with long expiry time so sessions can hang around for a long time. if you want to avoid massive build-up of the sessions table, simply running the following query:

DELETE FROM sessions_table WHERE time_sec< NOW() + 2*86400

This will remove all sessions older then 2 days.

High usage forum installs should really be using cron and not adding various hacks to the code. The only reason the hack exists in the place is that not everyone has access to cron.


FUDforum Core Developer

[Updated on: Mon, 29 August 2005 21:57]

Report message to a moderator

Re: How to stop recording in the table forumsfud_ses ? [message #27200 is a reply to message #27199] Mon, 29 August 2005 22:05 Go to previous messageGo to next message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
I understand perfectly your thoughts, the real problem is that a lot of FUD forums users, and a lot of phpmyvisites users don't have access to a cron, and a lot of them don't know what a cron is. They just install the "great" package they've discovered, and it must work by itself, without other technical considerations than give the loging/password/db host.

And for their usage of our software, I'm considering seriously such a cron task job emulation.

I think it's a good idea, because it makes software more "user friendly" that it is. And "user friendly" is really good for software.

[Updated on: Mon, 29 August 2005 22:06]

Report message to a moderator

Re: How to stop recording in the table forumsfud_ses ? [message #27201 is a reply to message #27200] Mon, 29 August 2005 22:07 Go to previous messageGo to next message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
of course when saying

Quote:

I'm not still sure of how I will do this, but i have this idea (my task is once a day).


I was speaking about phpmyvisites implementation of a cron tast job emulation, not for FUDForum Wink I won't hack your code Smile
Re: How to stop recording in the table forumsfud_ses ? [message #27202 is a reply to message #27200] Mon, 29 August 2005 22:13 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Sessions table is well indexed, even if you have take up 40 megs (not all that much data actually) is not a problem. The forum does remove absolete entries from it, but not on every request that is ineffecient. There are a number of things you can do to reduce the number of entries via simple configuration tricks:
1) make cookies expire sooner.
2) use session cookies.


FUDforum Core Developer
Re: How to stop recording in the table forumsfud_ses ? [message #27203 is a reply to message #27202] Mon, 29 August 2005 22:21 Go to previous message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
Ok i didn't remember I chose the session/cookie lifetime.
I just set them to 260000, and I think it will be better now.

Thank you for support!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Funktions for the regstriation of an User-Session
Next Topic: Calendar Discussion
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 07:59:19 GMT 2024

Total time taken to generate the page: 0.02644 seconds