Piwigo Bugtracker

Viewing Issue Advanced Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002338 [Piwigo] database minor N/A 2011.06.12 00:14 2011.07.13 22:18
Reporter plg View Status public  
Assigned To plg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 2.2.4 Product Version 2.2.2
  Target Version 2.2.4 Product Build
Summary 0002338: sessions table gets huge, use automatic purge
Description The only way to reduce size of #sessions table is to run the maintainance action "purge sessions". If you have a very popular gallery and don't like to repeat maintainance actions every week, an automatic purge would be better.

Maybe some code in include/common like:

if (mt_rand(0,100) == 0)
{
  pwg_session_gc();
}
Steps To Reproduce
Additional Information
Tags No tags attached.
browser any
Database engine and version
PHP version
Web server Apache 1.3.x
Attached Files

- Relationships

-  Notes
(0005245)
rvelices (developer)
2011.06.17 19:43

Normally this is done automatically by php ini configuration.
See
session.gc_probability
session.gc_divisor
session.gc_maxlifetime

on
http://us3.php.net/manual/en/session.configuration.php [^]

I think these work fine. However beware of robots - every hit generates a new entry in the table
(0005246)
plg (manager)
2011.06.17 20:27

Here is what we have on a standard Debian (which runs many web servers)


; This is disabled in the Debian packages, due to the strict permissions
; on /var/lib/php5. Instead of setting this here, see the cronjob at
; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below.
; php scripts using their own session.save_path should make sure garbage
; collection is enabled by setting session.gc_probability
;session.gc_probability = 0
session.gc_divisor = 100

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440


We can say that Piwigo uses its own session.save_path because sessions are saved in the database. I have a serious doubt that the session table will ever be automatically purged.

On Piwigo Demo, we had 5M (millions) sessions and 99,999% where out of date.
(0005329)
svn (reporter)
2011.07.13 22:16

[Subversion] r11736 by plg on branch 2.2

-----[Subversion commit log]----------------------------------------------------
bug 2338 fixed: force purge on sessions table (each time a user gets connected)
(0005330)
svn (reporter)
2011.07.13 22:16

[Subversion] r11737 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r11736 from branch 2.2 to trunk

bug 2338 fixed: force purge on sessions table (each time a user gets connected)

- Issue History
Date Modified Username Field Change
2011.06.12 00:14 plg New Issue
2011.06.12 00:14 plg Status new => assigned
2011.06.12 00:14 plg Assigned To => plg
2011.06.12 00:14 plg browser => any
2011.06.12 00:14 plg Web server => Apache 1.3.x
2011.06.17 19:43 rvelices Note Added: 0005245
2011.06.17 20:27 plg Note Added: 0005246
2011.07.13 22:16 svn Checkin
2011.07.13 22:16 svn Note Added: 0005329
2011.07.13 22:16 svn Checkin
2011.07.13 22:16 svn Note Added: 0005330
2011.07.13 22:18 plg Status assigned => closed
2011.07.13 22:18 plg Resolution open => fixed
2011.07.13 22:18 plg Fixed in Version => 2.2.4


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Contact
Powered by Mantis Bugtracker