'Twas brillig, and Michael Renzmann at 25/03/09 05:47 did gyre and gimble:
>> There are 84542 rows here. Is this a lot? Doesn't sound like much,
>> but who knows :)
> 
> Wow, that's a nice amound. Is that a public site?

Yup a public site, or technically two public sites: avahi.org and 
pulseaudio.org

>> Or would something like:
>> DELETE FROM session where authenticated=0 and last_visit <
>> (strftime('%s','now') - 24*60*60*7);
>> do the job fine?
> 
> Deleting from session is only part of the job, you also want to get rid of
> the corresponding session_attributes for purged sessions, for example.

Yeah I did this too now with some SQL based on the session table:
DELETE FROM session_attribute WHERE authenticated=0 and sid NOT IN 
(SELECT sid FROM session WHERE authenticated=0);

That did the trick.

>> If so, is there not some built in purging that goes on?
> 
> Trac's session management does house-keeping while user requests are
> served, namely cleaning outdated entries from the session and
> session_attribute tables (outdated as in "older than 90 days" by default).

I get the impression that this number didn't built up in the last 90 
days... but I could be wrong.. I've trashed the data now so I can't 
really check.

> This works for small Trac instances, but it appears to be a bad idea for
> sites like trac-hacks.org where we had ~52k rows table sessions and ~200k
> rows in table session_attributes. Depending on the general server load,
> the "in-request house-keeping" has led to delays of up to 3500 ms for
> requests where it happened.

Not ideal.

> To avoid these delays, I've disabled the in-request house-keeping and
> implemented a small (bash) script that does it once per hour. I intend to
> provide a patch that makes in-request house-keeping configurable in
> trac.ini and adds the functionality of my bash script to trac-admin.

Yeah that would be a good idea IMO.

I can say that we're definitely seeing improvement with just removing 
the session data.

I think the Git backend does still need some work and perhaps the sync() 
process hangs things up a bit more than needed which I'll try and take a 
look at at some point (e.g. to stop the repo sync happening every 
time... maybe 1 in 10 or something like that). If the data is a little 
outdated, it's not big deal... it'll catch up :)

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to