That's the first time I look into this, there is about ~63 000 sessions in the database (PostgreSQL).
For the availability of the platform, it is kind of the right time because we are well out of working hours here.
For my first attempts, don't know exactly the time I let but it is a matter of 1 minute.
Nicolas
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
Well finally the system completed the command (almost 8 minutes)
'
22:35:40 Trac[tracdb] DEBUG: "FormDBComponent" does not need a
schema upgrade.
real 8m25.808s
user 0m0.850s
sys 0m0.080s
'
The funny thing is that it has removed almost none sessions
during that time :-/
Well finally the system completed the command (almost 8 minutes)
'
22:35:40 Trac[tracdb] DEBUG: "FormDBComponent" does not need a schema upgrade.
real 8m25.808s
user 0m0.850s
sys 0m0.080s'
The funny thing is that it has removed almost none sessions during that time :-/
There was no surprise regarding the number of sessions removed
(almost zero), the site has been released publicly a few months
ago.
My command was just for testing purpose but I didn't expect it
would take some much time with no substantial operations on the
db.
In fact, we have a mean of 500 sessions created per day since
putting it online. I decided to cut by half and kept the sessions
only since September,
I'm not sure if we have an interest of keeping them.
The weird thing is that the command took about 4 mins while
parsing the same number of sessions.
Nicolas
There was no surprise regarding the number of sessions removed (almost zero), the site has been released publicly a few months ago.
My command was just for testing purpose but I didn't expect it would take some much time with no substantial operations on the db.In fact, we have a mean of 500 sessions created per day since putting it online. I decided to cut by half and kept the sessions only since September,
I'm not sure if we have an interest of keeping them.
The weird thing is that the command took about 4 mins while parsing the same number of sessions.
Nicolas
Back to this thread, I launched a anonymous sessions purge with
your recommended options:
$ psql -c "SELECT COUNT(*) FROM session;" count ------- 32107 $ time trac-admin ~/trac/ session purge "01/01/15 00:00:00" 17:43:22 Trac[env] INFO: -------------------------------- environment startup [Trac 1.0.1] -------------------------------- ... 17:43:23 Trac[util] DEBUG: SQL: DELETE FROM session WHERE authenticated=0 AND last_visit<%s
17:43:23 Trac[util] DEBUG: args: (1420066800,)* 17:43:23 Trac[util] DEBUG: SQL: DELETE FROM session_attribute WHERE authenticated=0 AND sid NOT IN (SELECT sid FROM session WHERE authenticated=0)
real 1m54.222s user 0m0.760s sys 0m0.120s
$ psql -c "SELECT COUNT(*) FROM session;" count ------- 32108
It took all the time (~2 mns) in the second DELETE operation
because it wasn't expecting to find a session previous to
01-01-2015.
I have repeated the same command third times with a similar
running time.
Then I modified the command to remove anonymous sessions from last September and it took almost the same time
$ time trac-admin ~/trac/ session purge "09/01/17 00:00:00" 18:34:31 Trac[env] INFO: -------------------------------- environment startup [Trac 1.0.1] -------------------------------- ... 18:34:32 Trac[util] DEBUG: SQL: DELETE FROM session WHERE authenticated=0 AND last_visit<%s
18:34:32 Trac[util] DEBUG: args: (1504216800,) 18:34:32 Trac[util] DEBUG: SQL: DELETE FROM session_attribute WHERE authenticated=0 AND sid NOT IN (SELECT sid FROM session WHERE authenticated=0) real 1m55.482s user 0m0.790s sys 0m0.090s
[nemo@forge ~]$ psql -c "SELECT COUNT(*) FROM session;" count ------- 32116
I'm quite a newbie in SQL stuff but from my standpoint these 2 minutes are much too long for parsing the database.
Couldn't we have a hidden issue here ?
Finally I cut by three the number of remaining anonymous sessions
(~10 000) in order to get a workable running time, by this I hope
to improve the overall behavior of Trac.
I set '1 month ago' in trac-admin purge argument and insert the
command in the cron.
Maybe it won't stay that way in the future.
Nicolas