Opened 15 years ago
Closed 15 years ago
#11499 closed (invalid)
The default clean session will certainly not work with a huge session database
Reported by: | Batiste Bieler | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Keywords: | cleanup, session | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
I have a huge session table that is about 1 month old.
I have is gigabytes of session data. I really doubt that the default cleanup will work properly.
I have to admit I didn't try but if the script has to collect gigabytes of session it certainly not gonna work.
Here is the script I use instead :
What you guys think about that? Do you think it could make sense to integrate something like this instead of the default one or it's a bad idea?
Change History (5)
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 15 years ago
Hi,
So I tried to launch the command yesterday, and it's always running. The SQL command is extremely slow. Mysql InnoDB is extremely slow with comparison on no indexed value.
I have no solution with this. I can't really add an index on the date live. Even the script I presented seems to create strange lock issues. The only solution I see is to create a new table and switch to it or drop the old one...
comment:4 by , 15 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Here is a "kind" of solution that seems to work well for me:
I don't like this script, but that seems to be the only thing that works for me.
comment:5 by , 15 years ago
milestone: | 1.2 |
---|---|
Resolution: | → invalid |
Status: | reopened → closed |
Just because you forgot to add an index, does not make it a bug or anything which should be fixed or changed.
If the pasted solution works for you, use it, but please, stop reopening this ticket as this is not a general problem.
Maybe you SHOULD have looked at the one in django-admin, because it is quite a bit more efficient than the one you got running there and is actually doing it the proper way.
What is does is just tell the database to delete any data older than expire_date instead of loading it all into python and parsing it like you're doing.