Forums / General / Session table not being cleared in a 3.6.2 site

Session table not being cleared in a 3.6.2 site

Author Message

Tony Wood

Tuesday 14 March 2006 1:53:31 am

Hi,

Has anyone else had the problem where the session table is not cleared? We have a site where the session table is just growing and is not cleared.

Questions:

Would InnoDB cause this problem?

What code clears down this table; is it a cron or triggered by a user?

I have had a look but cannot find where it is, any ideas so we can either patch or report a bug.

Any ideas?

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Xavier Dutoit

Tuesday 14 March 2006 7:19:44 am

Hi Paul,

I've had the same problem in a production site a while ago. The session table grew out of proportion, crashed and I couldn't repair it.

What I did was drop the table and recreated it. I didn't dig any further as it kind of solved the problem. I'll look at it again and tell you how this table behave.

X+

http://www.sydesy.com

Tony Wood

Tuesday 14 March 2006 7:22:14 am

Hi,

Yep we are dropping it and adding it. The problem is why did it happen... Any ideas? eZ?

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

David Boman

Tuesday 14 March 2006 7:41:47 am

I have had similar problem causing a full crash when we ran out of disk space. I think the problem is related to anonymous sesssions. Although I'm not sure, I belive there is a 'session' created for every request from the anynomous user, i.e. subsequent request for an anynomous user is not handled as one session but as many, casuing the sessiontable to fill up. Have a look in the admin interface under Sessions (and make sure to show all session for all users) to se the current number of sessions.

Tony Wood

Tuesday 14 March 2006 8:12:52 am

this appears to only affect some sites...

We have some high traffic sites that are just not affected, but they are MyISAM

I think it might have something to do with InnoDB. I have a gut feeling that the code that clears these does not finish its transction and this means that InnoDB roles back the transaction. I cannot prove it, but it just feels like that sort of problem.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Esteban Rodriguez

Thursday 17 May 2007 4:36:58 pm

I am having the same problem, all with InnoDB eZSession tables, and can't seem to find the problem.
Did you get any more data about the issue?

Esteban

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Xavier Dutoit

Friday 18 May 2007 12:48:51 am

Hi,

It seems that the ever growing table is a feature.

./update/common/scripts/cleanup.php -s siteaccess expired_session

is your friend. cron it nightly and it should work.

Don't remember who (thanks to him), offered this little script that I might have modified (all errors being mine of course ):

for siteaccess in `ls ./settings/siteaccess`; do
   nice -19 php4 ./update/common/scripts/cleanup.php -s $siteaccess expired_session
done

http://www.sydesy.com

Frédéric DAVID

Friday 18 May 2007 3:26:23 am

You can find some information there :http://pwet.fr/blog/nettoyage_des_sessions_dans_ez_publish_bug_10431

It's a solution without cronjob script.

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

Paul Forsyth

Friday 18 May 2007 7:26:32 am

We recently hit this issue again and the solution used was to drop the ezsession table and re-add it as myisam.

With mysql 4.1 we have a single innodb file which simply keeps growing. If you clear the session table the innodb size doesnt change, so we hit disk space issues because of this. Switching to myisam solves this because that table does clear down when sessions expire.

Does anyone know if innodb is better in recent mysql versions?

Once you get close to disk limits innodb rollbacks then start causing instabilities in the system...

Paul

Damien Pobel

Tuesday 22 May 2007 3:35:03 pm

Paul> the innoDB file will never decrease. The solution is to dump your bases with mysqldump, delete innoDB file, and then import the dump.
See http://dev.mysql.com/doc/refman/4.1/en/adding-and-removing.html

For the Session table problem see this bug report : http://issues.ez.no/10431
In most case, It seems that it is related to the default config of Debian.

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Paul Forsyth

Wednesday 23 May 2007 2:24:42 am

Hi Damien,

Yip, innodb is sometimes very inflexible. The point of ezsession is to not grow... Wonder if eZ needs to reconsider the table type for new installations or update the docs to make sure tables like this are always set to have their own separate file.

Our system is running on debian but that wasnt the issue. Simply invoking a sql 'DELETE' for huge ezsession caused timeouts and rollbacks - not pleasant! MyISAM may be more basic but it works quite well for the use this table is used for.

Paul

Gaetano Giunta

Monday 04 February 2008 2:03:36 am

See also patch #12490 in the bug tracker - the delete on the sessions table should not be dependent on database configuration after all...

Principal Consultant International Business
Member of the Community Project Board