Forums / General / ezsession table size (700+ Mb)

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

eZ debug

Timing: Jan 18 2025 11:05:51
Script start
Timing: Jan 18 2025 11:05:51
Module start 'content'
Timing: Jan 18 2025 11:05:52
Module end 'content'
Timing: Jan 18 2025 11:05:52
Script end

Main resources:

Total runtime0.8868 sec
Peak memory usage4,096.0000 KB
Database Queries238

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 587.7031180.8438
Module start 'content' 0.00720.7483 768.5469936.6563
Module end 'content' 0.75550.1312 1,705.2031353.3203
Script end 0.8867  2,058.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4345210.0002
Check MTime0.00150.1674210.0001
Mysql Total
Database connection0.00120.129910.0012
Mysqli_queries0.777087.61912380.0033
Looping result0.00280.31402360.0000
Template Total0.853396.220.4267
Template load0.00200.228120.0010
Template processing0.851395.989720.4256
Template load and register function0.00020.019910.0002
states
state_id_array0.00120.140410.0012
state_identifier_array0.00170.191920.0009
Override
Cache load0.00190.2163720.0000
Sytem overhead
Fetch class attribute can translate value0.00250.2778100.0002
Fetch class attribute name0.00140.1600190.0001
XML
Image XML parsing0.00650.7283100.0006
class_abstraction
Instantiating content class attribute0.00000.0041220.0000
General
dbfile0.00580.6539590.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 57
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs