ezsession table size (700+ Mb)

Author Message

Ronnie Garcia

Tuesday 21 November 2006 12:38:52 pm

Hey,

One of our eZp site is getting his ezsession table really big. Actually, it's 720 Mb large, 519 093 entries.
Its running 3.6.1 so it might be a bug, i want to upgrade to 3.6.11.

I would like to empty the table before i upgrade.
Can i just drop everything in this table or it will break something ?

Thanks,
Ronnie.

Marco Zinn

Tuesday 21 November 2006 1:32:53 pm

You can empty the table. This will invalidate all your sessions, that means all logged in user will get kicked out and need to re-login.
So, it's best to take the whole site offline before that, but i guess, you will do this for the update anyway.

Don't drop the table, just "delete from ezsession" and remove all entries with this.

Marco
http://www.hyperroad-design.com

Joe Kepley

Tuesday 21 November 2006 1:35:48 pm

There's a script called cleanup.php in common/scripts. You can use this to clean all sorts of things in the DB, including all sessions, or only expired sessions if you prefer.

As with anything else, I'd run a backup first, just to be on the safe side.

Ronnie Garcia

Tuesday 21 November 2006 2:55:53 pm

Great !
Thanks for the tips.

Matthew Carroll

Tuesday 21 November 2006 8:44:12 pm

I just added a feature request that I think would help this issue - better control of anonymous sessions either by them timing out sooner or by disabling the storage of anonymous sessions entirely:

http://issues.ez.no/IssueView.php?Id=9536

...of course, even if this is implemented it will still be necessary to clean up expired sessions regularly like Joe explained, or with a cron job.

Matthew

http://carroll.org.uk

Xavier Dutoit

Wednesday 22 November 2006 1:11:19 am

You have a script:

./update/common/scripts/updatesession.php

See the details, but that's able to clear only the old sessions and keep the current onces. Put that into a cron.

X+

http://www.sydesy.com

micah anderson

Thursday 30 November 2006 11:06:28 pm

When I try to run the update/common/scripts/updatesession.php, I get the following error immediately back:

Fatal error: eZ publish did not finish its request
The execution of eZ publish was abruptly ended, the debug output is present below.

Xavier Dutoit

Saturday 02 December 2006 1:26:09 am

Hi,

looks like a php-cli problem. like the php-mysql extension isn't installed for the cli or wrong php version or something like that.

http://www.sydesy.com

kracker (the)

Saturday 09 December 2006 4:29:36 am

I believe the error you encounter is indeed a php-cli problem, possibly a reference problem.

I have encountered this problem, solved it on several occasions and documented my efforts and results.

The following reading should bring you up to speed as well as show you step by step how to solve this problem.

<i>http://ezpedia.org/wiki/en/ez/references
http://ezpedia.org/wiki/en/ez/solution_building_php_cli_for_ez_publish_command_line_scripts</i>

Cheers,
//kracker

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

meinhard benn

Monday 12 March 2007 2:55:30 pm

Hi Xavier,

regarding your reply from Wednesday 22 November 2006 10:11:19 am:

I looked at ./update/common/scripts/updatesession.php and I can not find any DELETE statement, only UPDATE. Are you sure that the script is capable of clearing sessions from the ezsession table?

I am using eZ publish 3.8.8.

Cheers, Meinhard.

http://goozee.benn.org/ - Google Co-op for eZ sites

Xavier Dutoit

Monday 12 March 2007 3:05:45 pm

My bad,

./update/common/scripts/cleanup.php expired_session

is your friend.

X+

http://www.sydesy.com

meinhard benn

Tuesday 13 March 2007 8:15:39 am

I don't think the script can clean all siteaccesses at once, so I did this (BASH):

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

Replace /usr/bin/php4 with your PHP path and you should be sorted.

http://goozee.benn.org/ - Google Co-op for eZ sites

Norman Leutner

Monday 07 May 2007 5:12:59 am

There'a also a cronjob extension which cleans up the sessions:

http://ez.no/community/contribs/cronjobs/session_cleanup

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:40:34
Script start
Timing: Jan 18 2025 10:40:34
Module start 'layout'
Timing: Jan 18 2025 10:40:34
Module start 'content'
Timing: Jan 18 2025 10:40:35
Module end 'content'
Timing: Jan 18 2025 10:40:35
Script end

Main resources:

Total runtime1.7957 sec
Peak memory usage4,096.0000 KB
Database Queries101

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.0234152.6250
Module start 'layout' 0.00700.0042 741.648439.4453
Module start 'content' 0.01111.7831 781.0938931.5781
Module end 'content' 1.79420.0014 1,712.671924.1641
Script end 1.7956  1,736.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.1976160.0002
Check MTime0.00140.0753160.0001
Mysql Total
Database connection0.00120.064110.0012
Mysqli_queries1.693694.31201010.0168
Looping result0.00150.0857990.0000
Template Total1.753297.620.8766
Template load0.00240.133120.0012
Template processing1.750897.500020.8754
Template load and register function0.00020.011410.0002
states
state_id_array0.00310.172110.0031
state_identifier_array0.00240.132720.0012
Override
Cache load0.00220.1219720.0000
Sytem overhead
Fetch class attribute can translate value0.00090.050890.0001
Fetch class attribute name0.00210.1150190.0001
XML
Image XML parsing0.00420.234890.0005
class_abstraction
Instantiating content class attribute0.00000.0026220.0000
General
dbfile0.00190.1040480.0000
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
22content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 57
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs